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

font

The package provides a builder and parser of fonts

94 releases (39 breaking)

new 0.39.3 Dec 20, 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

#26 in Rendering

Download history 161/week @ 2024-08-30 13/week @ 2024-09-06 58/week @ 2024-09-13 84/week @ 2024-09-20 57/week @ 2024-09-27 15/week @ 2024-10-04 34/week @ 2024-10-11 216/week @ 2024-10-18 26/week @ 2024-10-25 30/week @ 2024-11-01 25/week @ 2024-11-08 22/week @ 2024-11-15 7/week @ 2024-11-22 22/week @ 2024-11-29 34/week @ 2024-12-06 28/week @ 2024-12-13

98 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