The package provides a font toolbox.
use font::{Font, Segment};
let path = "SourceSerifPro-Regular.otf";
let font = Font::open(path).unwrap();
let glyph = font.draw('&').unwrap().unwrap();
for contour in glyph.iter() {
for segment in contour.iter() {
match segment {
&Segment::Linear(..) => { /* … */ },
&Segment::Quadratic(..) => { /* … */ },
&Segment::Cubic(..) => { /* … */ },
}
}
}
Your contribution is highly appreciated. Do not hesitate to open an issue or a pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE.md.