9 releases (breaking)
0.12.0 | Feb 14, 2021 |
---|---|
0.11.0 | Feb 4, 2021 |
0.10.0 | Jan 16, 2021 |
0.9.0 | Dec 5, 2020 |
0.5.1 | Apr 21, 2020 |
#10 in Data formats
67,886 downloads per month
Used in 131 crates
(3 directly)
22KB
82 lines
owned_ttf_parser

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, OwnedFace, Face};
# let owned_font_data = include_bytes!("../fonts/font.ttf").to_vec();
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
~455KB
~11K SLoC