Expand description
A parser for fonts.
Example
use font::{File, Segment};
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
pub extern crate opentype;
Structs
- A contour.
- A file.
- Flags.
- A font.
- A glyph.
- Metrics.
- An offset.
Enums
- A segment.
Type Definitions
- An error.
- A number.
- A result.