#typeface

font

The package provides a builder and parser of fonts

92 releases (39 breaking)

0.39.1 Oct 20, 2024
0.38.1 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 415/week @ 2024-07-15 126/week @ 2024-07-22 26/week @ 2024-07-29 12/week @ 2024-08-05 40/week @ 2024-08-12 31/week @ 2024-08-19 154/week @ 2024-08-26 13/week @ 2024-09-02 26/week @ 2024-09-09 47/week @ 2024-09-16 127/week @ 2024-09-23 9/week @ 2024-09-30 32/week @ 2024-10-07 180/week @ 2024-10-14 65/week @ 2024-10-21 19/week @ 2024-10-28

296 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
~42K SLoC