pub struct NameTable<'a> { /* private fields */ }Expand description
Zero-copy view over the name table.
Implementations§
Source§impl<'a> NameTable<'a>
impl<'a> NameTable<'a>
Sourcepub fn parse(data: &'a [u8]) -> Result<Self, ParseError>
pub fn parse(data: &'a [u8]) -> Result<Self, ParseError>
Parse and validate the name table header.
§Errors
ParseError::TruncatedTable when header or records are truncated;
ParseError::InvalidGlyphFormat when the string storage falls
outside the table.
Sourcepub fn format(&self) -> Result<u16, ParseError>
pub fn format(&self) -> Result<u16, ParseError>
Sourcepub fn records(&self) -> Result<Vec<NameRecord<'a>>, ParseError>
pub fn records(&self) -> Result<Vec<NameRecord<'a>>, ParseError>
All records, in table order.
§Errors
ParseError::TruncatedTable when a record’s string range falls
outside the storage area.
Sourcepub fn get(&self, id: u16) -> Option<NameRecord<'a>>
pub fn get(&self, id: u16) -> Option<NameRecord<'a>>
First record matching id, preferring Windows (platform 3) then
Unicode (platform 0) then Macintosh (platform 1) encodings.
Sourcepub fn postscript_name(&self) -> Option<String>
pub fn postscript_name(&self) -> Option<String>
PostScript name (name id 6).
Trait Implementations§
impl<'a> Copy for NameTable<'a>
impl<'a> Eq for NameTable<'a>
impl<'a> StructuralPartialEq for NameTable<'a>
Auto Trait Implementations§
impl<'a> Freeze for NameTable<'a>
impl<'a> RefUnwindSafe for NameTable<'a>
impl<'a> Send for NameTable<'a>
impl<'a> Sync for NameTable<'a>
impl<'a> Unpin for NameTable<'a>
impl<'a> UnsafeUnpin for NameTable<'a>
impl<'a> UnwindSafe for NameTable<'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