Utilties for working with Unified Font Object files.
The types in this crate correspond to types described in the spec.
Instantiate a UFO font object with a
Font struct like this:
use norad::Font; let inpath = "RoflsExtraDim.ufo"; let mut font_obj = Font::load(inpath).expect("failed to load font");
The API may be used to access and modify data in the
let layer = font_obj.default_layer(); let glyph_a = layer.get_glyph("A").expect("missing glyph"); assert_eq!(glyph_a.name().as_ref(), "A");
let outpath = "RoflsSemiDim.ufo"; font_obj.save(outpath);
Refer to the
examples directory of the source repository
for additional source code examples.
Details on the full API for working with UFO fonts are available in these docs.
Source files are available at https://github.com/linebender/norad.
pub use fontinfo::FontInfo;
- Storage structures for UFO data and images.
- Reading and writing designspace files.
- Error types.
- The contents of
- A 2D affine transformation.
- A reference position in a glyph, such as for attaching accents.
- A set of Unicode codepoints
- A color in RGBA (Red-Green-Blue-Alpha) format.
- A reference to another glyph, to be included in this glyph’s outline.
- A single open or closed bezier path segment.
- A single point in a
- A type that describes which components of a UFO should be loaded.
- A font object, corresponding to a UFO directory. A Unified Font Object.
- A glyph, loaded from a
- A guideline associated with a glyph.
- An image included in a glyph.
- A UFO layer, corresponding to a ‘glyphs’ sub-directory.
- The ordered list of
Layerobjects within a UFO.
- The contents of the
- Options that can be set when writing the UFO to disk.
- A version of the UFO spec.
- An infinite line.
- Possible types of points that can exist in a
- The quote character used to write the XML declaration.
- Given a
name, return an appropriate file name.
- A map of group name to a list of glyph names.
- A map of kerning pairs.
- A Plist dictionary.