#typeface #typography #parser

font

The package provides a parser for fonts

46 releases (11 breaking)

0.11.2 Mar 5, 2023
0.11.0 Feb 22, 2023
0.7.0 Dec 24, 2022
0.4.2 Nov 24, 2022
0.0.1 Aug 13, 2015

#16 in Rendering

Download history 25/week @ 2022-12-01 161/week @ 2022-12-08 85/week @ 2022-12-15 62/week @ 2022-12-22 23/week @ 2022-12-29 151/week @ 2023-01-05 233/week @ 2023-01-12 59/week @ 2023-01-19 219/week @ 2023-01-26 220/week @ 2023-02-02 279/week @ 2023-02-09 245/week @ 2023-02-16 127/week @ 2023-02-23 180/week @ 2023-03-02 49/week @ 2023-03-09 32/week @ 2023-03-16

457 downloads per month
Used in 4 crates

Apache-2.0/MIT

46KB
1K SLoC

Font Package Documentation Build

The package provides a parser for fonts.

Example

use font::{File, Segment};

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].draw('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

~340KB