#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

#25 in Rendering

Download history 218/week @ 2024-10-20 21/week @ 2024-10-27 30/week @ 2024-11-03 24/week @ 2024-11-10 20/week @ 2024-11-17 6/week @ 2024-11-24 25/week @ 2024-12-01 32/week @ 2024-12-08 267/week @ 2024-12-15 87/week @ 2024-12-22 244/week @ 2024-12-29 39/week @ 2025-01-05 8/week @ 2025-01-12 4/week @ 2025-01-19 40/week @ 2025-01-26 54/week @ 2025-02-02

108 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