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
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.meta: MetaInfo
font_info: FontInfo
layers: LayerSet
lib: Plist
groups: Groups
kerning: Kerning
features: String
data_request: DataRequest
data: DataStore
images: ImageStore
Implementations
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.
pub fn load_requested_data(
path: impl AsRef<Path>,
request: DataRequest
) -> Result<Font, Error>
pub fn load_requested_data(
path: impl AsRef<Path>,
request: DataRequest
) -> Result<Font, Error>
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.
pub fn save_with_options(
&self,
path: impl AsRef<Path>,
options: &WriteOptions
) -> Result<(), Error>
pub fn save_with_options(
&self,
path: impl AsRef<Path>,
options: &WriteOptions
) -> Result<(), Error>
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
Auto Trait Implementations
impl !RefUnwindSafe for Font
impl !UnwindSafe for Font
Blanket Implementations
Mutably borrows from an owned value. Read more