Struct norad::Font[][src]

#[non_exhaustive]
pub struct Font { pub meta: MetaInfo, pub font_info: FontInfo, pub layers: LayerSet, pub lib: Plist, pub groups: Groups, pub kerning: Kerning, pub features: String, pub data_request: DataRequest, pub data: DataStore, pub images: ImageStore, }
Expand description

A Unified Font Object.

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
meta: MetaInfofont_info: FontInfolayers: LayerSetlib: Plistgroups: Groupskerning: Kerningfeatures: Stringdata_request: DataRequestdata: DataStoreimages: ImageStore

Implementations

Create a new, empty Font object.

Attempt to load a font object from a file.

path must point to a directory with the structure described in v3 of the Unified Font Object spec.

Note

This will consume the public.objectLibs key in the global lib and in glyph libs and assign object libs found therein to global guidelines and glyph objects with the matching identifier, respectively.

Attempt to load the requested elements of a font object from a file.

Attempt to save this UFO to the given path, overriding any existing contents.

This may fail; instead of saving directly to the target path, it is a good idea to save to a temporary location and then move that to the target path if the save is successful.

This will fail if either the global or any glyph lib contains the public.objectLibs key, as object lib management is done automatically.

Attempt to save the UFO, using the provided WriteOptions.

Returns a reference to the default layer.

Returns a mutable reference to the default layer.

Returns an iterator over all layers in this font object.

Returns an iterator over all the glyphs in the default layer.

Returns a reference to the glyph with the given name (in the default layer).

Returns a mutable reference to the glyph with the given name, IN THE DEFAULT LAYER, if it exists.

Returns the total number of glyphs in the default layer.

Return the font’s global guidelines, stored in FontInfo.

Returns a mutable reference to the font’s global guidelines.

These will be created if they do not already exist.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.