#opentype-font #opentype #typography #typeface #woff

font

The package provides a builder and parser of fonts

95 releases (40 breaking)

0.40.0 Dec 29, 2024
0.39.1 Oct 20, 2024
0.38.1 Jul 18, 2024
0.29.3 Feb 24, 2024
0.0.1 Aug 13, 2015

#5 in #opentype-font

Download history 26/week @ 2024-12-02 33/week @ 2024-12-09 285/week @ 2024-12-16 183/week @ 2024-12-23 132/week @ 2024-12-30 37/week @ 2025-01-06 5/week @ 2025-01-13 6/week @ 2025-01-20 60/week @ 2025-01-27 36/week @ 2025-02-03 22/week @ 2025-02-10 94/week @ 2025-02-17 20/week @ 2025-02-24 70/week @ 2025-03-03 4/week @ 2025-03-10

109 downloads per month
Used in 5 crates

Apache-2.0/MIT

105KB
3K 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
~41K SLoC