pub struct PostTable<'a> { /* private fields */ }Expand description
Zero-copy view over the post table.
Implementations§
Source§impl<'a> PostTable<'a>
impl<'a> PostTable<'a>
Sourcepub fn parse(data: &'a [u8]) -> Result<Self, ParseError>
pub fn parse(data: &'a [u8]) -> Result<Self, ParseError>
Parse and validate the post table header.
§Errors
ParseError::TruncatedTable when shorter than 32 bytes.
Sourcepub fn version(&self) -> Result<u32, ParseError>
pub fn version(&self) -> Result<u32, ParseError>
Sourcepub fn italic_angle(&self) -> Result<f32, ParseError>
pub fn italic_angle(&self) -> Result<f32, ParseError>
Sourcepub fn underline_position(&self) -> Result<i16, ParseError>
pub fn underline_position(&self) -> Result<i16, ParseError>
Sourcepub fn underline_thickness(&self) -> Result<i16, ParseError>
pub fn underline_thickness(&self) -> Result<i16, ParseError>
Sourcepub fn is_fixed_pitch(&self) -> Result<u32, ParseError>
pub fn is_fixed_pitch(&self) -> Result<u32, ParseError>
Sourcepub fn glyph_name(&self, gid: u16) -> Result<Option<&'a str>, ParseError>
pub fn glyph_name(&self, gid: u16) -> Result<Option<&'a str>, ParseError>
Glyph name for gid (version 2 tables).
Returns None for glyphs with no name (index 0/NULL handling per
spec: unmapped indices yield no name) or non-v2 tables.
§Errors
ParseError::TruncatedTable when the v2 arrays are truncated;
ParseError::InvalidGlyphFormat when glyphNameIndex values run
past the custom-name storage.
Trait Implementations§
impl<'a> Copy for PostTable<'a>
impl<'a> Eq for PostTable<'a>
impl<'a> StructuralPartialEq for PostTable<'a>
Auto Trait Implementations§
impl<'a> Freeze for PostTable<'a>
impl<'a> RefUnwindSafe for PostTable<'a>
impl<'a> Send for PostTable<'a>
impl<'a> Sync for PostTable<'a>
impl<'a> Unpin for PostTable<'a>
impl<'a> UnsafeUnpin for PostTable<'a>
impl<'a> UnwindSafe for PostTable<'a>
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