#typography #opentype #typeface #woff

font

The package provides a builder and parser of fonts

90 releases (38 breaking)

new 0.38.1 Jul 18, 2024
0.37.0 Jul 18, 2024
0.29.3 Feb 24, 2024
0.25.0 Oct 24, 2023
0.0.1 Aug 13, 2015

#20 in Rendering

Download history 99/week @ 2024-04-01 499/week @ 2024-04-08 163/week @ 2024-04-15 30/week @ 2024-04-22 23/week @ 2024-04-29 42/week @ 2024-05-06 9/week @ 2024-05-13 680/week @ 2024-05-20 1098/week @ 2024-05-27 359/week @ 2024-06-03 176/week @ 2024-06-10 8/week @ 2024-06-17 24/week @ 2024-06-24 48/week @ 2024-07-01 7/week @ 2024-07-08 415/week @ 2024-07-15

494 downloads per month
Used in 5 crates

Apache-2.0/MIT

98KB
2.5K SLoC

Font Package Documentation Build

The package provides a builder and 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].glyph('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

~2.5MB
~42K SLoC