#typography #opentype #typeface #woff

font

The package provides a builder and parser of fonts

77 releases (30 breaking)

0.30.1 Apr 10, 2024
0.29.4 Apr 9, 2024
0.29.3 Feb 24, 2024
0.25.0 Oct 24, 2023
0.0.1 Aug 13, 2015

#24 in Rendering

Download history 29/week @ 2024-01-19 16/week @ 2024-01-26 50/week @ 2024-02-02 5/week @ 2024-02-09 249/week @ 2024-02-16 346/week @ 2024-02-23 58/week @ 2024-03-01 78/week @ 2024-03-08 85/week @ 2024-03-15 35/week @ 2024-03-22 64/week @ 2024-03-29 433/week @ 2024-04-05 258/week @ 2024-04-12 29/week @ 2024-04-19 19/week @ 2024-04-26 55/week @ 2024-05-03

419 downloads per month
Used in 5 crates

Apache-2.0/MIT

63KB
1.5K 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