#typography #typeface #opentype #font-file #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

#24 in Rendering

Download history 70/week @ 2024-09-18 77/week @ 2024-09-25 9/week @ 2024-10-02 39/week @ 2024-10-09 208/week @ 2024-10-16 31/week @ 2024-10-23 19/week @ 2024-10-30 29/week @ 2024-11-06 26/week @ 2024-11-13 16/week @ 2024-11-20 17/week @ 2024-11-27 25/week @ 2024-12-04 32/week @ 2024-12-11 308/week @ 2024-12-18 211/week @ 2024-12-25 78/week @ 2025-01-01

640 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