pub struct TrueTypePdfFont {
pub data: Vec<u8>,
pub encoding: [Option<String>; 256],
pub widths: [f64; 256],
pub cmap: HashMap<u32, u16>,
pub cmap_is_unicode: bool,
pub post_name_to_gid: HashMap<String, u16>,
pub units_per_em: f64,
pub to_unicode: HashMap<u16, u32>,
pub identity_gid: bool,
pub gid_hex: bool,
}Fields§
§data: Vec<u8>§encoding: [Option<String>; 256]§widths: [f64; 256]§cmap: HashMap<u32, u16>§cmap_is_unicode: boolWhether the cmap maps Unicode values (true) or re-encoded char codes (false). Non-Unicode cmaps come from (1,0) Mac Roman or (3,0) Symbol subtables in subset fonts — the encoding→unicode→cmap lookup path must be skipped.
post_name_to_gid: HashMap<String, u16>Glyph name → GID mapping from the post table (for ligatures and
other glyphs not reachable via Unicode cmap lookup).
units_per_em: f64§to_unicode: HashMap<u16, u32>Char code → Unicode mapping from /ToUnicode CMap (for gNNNN glyph names in substituted fonts where AGL lookup fails).
identity_gid: boolWhen true, char codes map directly to GIDs (identity mapping). Set for symbolic TrueType fonts without an explicit /Encoding, where the cmap subtable maps to misleading Unicode values (re-encoded fonts).
gid_hex: boolWhen true, gNNNN glyph names in the encoding use hexadecimal GIDs (e.g. g003a = GID 58). Set when any gNNNN name contains hex letters (a-f). When false, gNNNN names use decimal (e.g. g1863 = GID 1863).
Auto Trait Implementations§
impl Freeze for TrueTypePdfFont
impl RefUnwindSafe for TrueTypePdfFont
impl Send for TrueTypePdfFont
impl Sync for TrueTypePdfFont
impl Unpin for TrueTypePdfFont
impl UnsafeUnpin for TrueTypePdfFont
impl UnwindSafe for TrueTypePdfFont
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more