46 releases (11 breaking)
0.11.2 | Mar 5, 2023 |
---|---|
0.11.0 | Feb 22, 2023 |
0.7.0 | Dec 24, 2022 |
0.4.2 | Nov 24, 2022 |
0.0.1 | Aug 13, 2015 |
#16 in Rendering
457 downloads per month
Used in 4 crates
46KB
1K
SLoC
Font

The package provides 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(..) => { /* … */ },
}
}
}
Contribution
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.
Dependencies
~340KB