#opentype #otf #true-type

no-std owned_ttf_parser

ttf-parser plus support for owned data

24 releases (15 breaking)

0.20.0 Oct 22, 2023
0.19.0 Apr 17, 2023
0.18.1 Jan 31, 2023
0.17.1 Nov 11, 2022
0.8.0 Jul 23, 2020

#6 in Data formats

Download history 81297/week @ 2023-11-29 88934/week @ 2023-12-06 83286/week @ 2023-12-13 64350/week @ 2023-12-20 47984/week @ 2023-12-27 78950/week @ 2024-01-03 79623/week @ 2024-01-10 92170/week @ 2024-01-17 80529/week @ 2024-01-24 77794/week @ 2024-01-31 83161/week @ 2024-02-07 86768/week @ 2024-02-14 89692/week @ 2024-02-21 96044/week @ 2024-02-28 96403/week @ 2024-03-06 75815/week @ 2024-03-13

372,979 downloads per month
Used in 1,175 crates (8 directly)

Apache-2.0

150KB
254 lines

owned_ttf_parser crates.io Documentation

ttf-parser plus support for owned data.

Provides OwnedFace, AsFaceRef and re-exports ttf_parser::*.

Example

use owned_ttf_parser::{AsFaceRef, OwnedFace, Face};

let owned_face = OwnedFace::from_vec(owned_face_data, 0).unwrap();
let face_ref: &Face<'_> = owned_face.as_face_ref();

assert_eq!(face_ref.ascender(), 2254);

no_std

no_std environments are supported using alloc.

owned_ttf_parser = { default-features = false }

Minimum supported rust compiler

All crates maintained with latest stable rust.


lib.rs:

Extends ttf_parser with owned version of Face: OwnedFace.

Re-exports ttf_parser::*.

Example

use owned_ttf_parser::{AsFaceRef, Face, OwnedFace};

let owned_face = OwnedFace::from_vec(owned_font_data, 0).unwrap();
let face_ref: &Face<'_> = owned_face.as_face_ref();

assert_eq!(face_ref.ascender(), 2254);

Dependencies

~670KB
~16K SLoC