Expand description
Parser for fonts.
Example
use font::glyph::Segment;
use font::File;
macro_rules! ok(($result:expr) => ($result.unwrap()));
let path = "SourceSerifPro-Regular.otf";
let File { mut fonts } = ok!(File::open(path));
let glyph = ok!(ok!(fonts[0].draw('a')));
for contour in glyph.iter() {
for segment in contour.iter() {
match segment {
&Segment::Linear(..) => { /* … */ },
&Segment::Quadratic(..) => { /* … */ },
&Segment::Cubic(..) => { /* … */ },
}
}
}
Re-exports
Modules
- Design axes.
- Layout features.
- Glyphs.
Structs
- A file.
- A font.
- Metrics.
- An offset.
Type Aliases
- Design axes.
- Unicode code points.
- Layout features.
- Multilingual strings.
- A number.
- Tables.