pub struct FontMetricsData {
pub widths: Vec<u16>,
pub upem: u16,
pub ascender: i16,
pub descender: i16,
pub font_data: Option<Vec<u8>>,
pub face_index: u32,
pub simple_unicode_to_code: Option<HashMap<u16, u8>>,
}Expand description
Resolved font metrics for a typeface, used for accurate text measurement.
Fields§
§widths: Vec<u16>Unicode-indexed widths derived from PDF /Widths or font data.
upem: u16Units per em of the font.
ascender: i16Font ascender in font units.
descender: i16Font descender in font units (typically negative).
font_data: Option<Vec<u8>>Raw font data for glyph ID lookup (Identity-H fonts).
face_index: u32Font face index within a collection.
simple_unicode_to_code: Option<HashMap<u16, u8>>Optional Unicode->code map for simple PDF fonts with custom encodings.
When Identity-H glyph encoding is unavailable (font_data == None),
this map lets us emit bytes in the source font’s actual encoding space
instead of assuming WinAnsi for every simple font.
Trait Implementations§
Source§impl Clone for FontMetricsData
impl Clone for FontMetricsData
Source§fn clone(&self) -> FontMetricsData
fn clone(&self) -> FontMetricsData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FontMetricsData
impl RefUnwindSafe for FontMetricsData
impl Send for FontMetricsData
impl Sync for FontMetricsData
impl Unpin for FontMetricsData
impl UnsafeUnpin for FontMetricsData
impl UnwindSafe for FontMetricsData
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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