24 releases (breaking)

0.19.0 May 14, 2025
0.17.0 Dec 29, 2024
0.16.0 Aug 30, 2024
0.15.0 May 21, 2024
0.2.1 Mar 27, 2023

#82 in Data formats

Download history 19/week @ 2025-02-08 64/week @ 2025-02-15 44/week @ 2025-02-22 25/week @ 2025-03-01 17/week @ 2025-03-08 18/week @ 2025-03-15 2/week @ 2025-03-22 3/week @ 2025-04-05 14/week @ 2025-04-12 9/week @ 2025-04-19 10/week @ 2025-04-26 7/week @ 2025-05-03 303/week @ 2025-05-10 82/week @ 2025-05-17 3/week @ 2025-05-24

396 downloads per month
Used in 3 crates (via font)

Apache-2.0/MIT

105KB
313 lines

Contains (WOFF font, 93KB) NotoNaskhArabic-Regular.woff2

WebType Package Documentation Build

The package provides a parser for fonts in Web Open Font Format. It might be helpful to have a look at a higher-level abstraction called font, which internally relies on this package.

Example

use webtype::opentype::truetype::tables::FontHeader;
use webtype::File;

macro_rules! ok(($result:expr) => ($result.unwrap()));

let path = "NotoNaskhArabic-Regular.woff2";
let mut tape = ok!(std::fs::File::open(path));
let File { mut fonts, mut tape } = ok!(File::read(&mut tape));

let font_header = ok!(ok!(fonts[0].take::<_, FontHeader>(&mut tape)));
assert_eq!(font_header.units_per_em, 2048);

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