[][src]Struct norad::glyph::Glyph

pub struct Glyph {
    pub name: GlyphName,
    pub format: GlifVersion,
    pub advance: Option<Advance>,
    pub codepoints: Option<Vec<char>>,
    pub note: Option<String>,
    pub guidelines: Option<Vec<Guideline>>,
    pub anchors: Option<Vec<Anchor>>,
    pub outline: Option<Outline>,
    pub image: Option<Image>,
    pub lib: Option<Plist>,
}

A glyph, loaded from a .glif file.

Fields

name: GlyphNameformat: GlifVersionadvance: Option<Advance>codepoints: Option<Vec<char>>note: Option<String>guidelines: Option<Vec<Guideline>>anchors: Option<Vec<Anchor>>outline: Option<Outline>image: Option<Image>lib: Option<Plist>

Implementations

impl Glyph[src]

impl Glyph[src]

pub fn load(path: impl AsRef<Path>) -> Result<Self, Error>[src]

Load the glyph at this path.

When loading glyphs in bulk, load_with_names should be preferred, since it will allow glyph names (in glyphs and components) to be shared between instances.

pub fn load_with_names(path: &Path, names: &NameList) -> Result<Self, Error>[src]

pub fn new_named<S: Into<GlyphName>>(name: S) -> Self[src]

Create a new glyph with the given name.

pub fn advance_width(&self) -> Option<f32>[src]

If this glyph has an advance, return the width value.

This is purely a convenience method.

Trait Implementations

impl Clone for Glyph[src]

impl Debug for Glyph[src]

impl PartialEq<Glyph> for Glyph[src]

impl StructuralPartialEq for Glyph[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,