#true-type #opentype #otf

no-std owned_ttf_parser

ttf-parser plus support for owned data

29 releases (breaking)

0.25.0 Oct 4, 2024
0.24.0 Jul 2, 2024
0.23.0 Jul 2, 2024
0.20.0 Oct 22, 2023
0.8.0 Jul 23, 2020

#5 in Data formats

Download history 105132/week @ 2024-07-17 106880/week @ 2024-07-24 108081/week @ 2024-07-31 126048/week @ 2024-08-07 121838/week @ 2024-08-14 115481/week @ 2024-08-21 114473/week @ 2024-08-28 122963/week @ 2024-09-04 117379/week @ 2024-09-11 118665/week @ 2024-09-18 124125/week @ 2024-09-25 126510/week @ 2024-10-02 121913/week @ 2024-10-09 126587/week @ 2024-10-16 135094/week @ 2024-10-23 106568/week @ 2024-10-30

511,475 downloads per month
Used in 1,504 crates (10 directly)

Apache-2.0

155KB
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

~1MB
~19K SLoC