pub struct MaxpTable<'a> { /* private fields */ }Expand description
Zero-copy view over the maxp table.
Version 0.5 (CFF fonts) carries only numGlyphs (6 bytes); version 1.0
(TrueType) adds the memory-hint fields (32 bytes).
Implementations§
Source§impl<'a> MaxpTable<'a>
impl<'a> MaxpTable<'a>
Sourcepub fn parse(data: &'a [u8]) -> Result<Self, ParseError>
pub fn parse(data: &'a [u8]) -> Result<Self, ParseError>
Parse and validate the maxp table bytes.
§Errors
ParseError::TruncatedTable when the table is shorter than its
version’s size (6 for 0.5, 32 for 1.0).
Sourcepub fn version(&self) -> Result<u32, ParseError>
pub fn version(&self) -> Result<u32, ParseError>
Sourcepub const fn num_glyphs(&self) -> u16
pub const fn num_glyphs(&self) -> u16
The glyph count.
Sourcepub fn max_points(&self) -> Result<u16, ParseError>
pub fn max_points(&self) -> Result<u16, ParseError>
Sourcepub fn max_contours(&self) -> Result<u16, ParseError>
pub fn max_contours(&self) -> Result<u16, ParseError>
Sourcepub fn max_composite_points(&self) -> Result<u16, ParseError>
pub fn max_composite_points(&self) -> Result<u16, ParseError>
Sourcepub fn max_composite_contours(&self) -> Result<u16, ParseError>
pub fn max_composite_contours(&self) -> Result<u16, ParseError>
Sourcepub fn max_component_elements(&self) -> Result<u16, ParseError>
pub fn max_component_elements(&self) -> Result<u16, ParseError>
maxComponentElements — number of components in the most complex
glyph; version 1.0 only.
§Errors
ParseError::TruncatedTable on a 0.5 table.
Sourcepub fn max_component_depth(&self) -> Result<u16, ParseError>
pub fn max_component_depth(&self) -> Result<u16, ParseError>
maxComponentDepth — nesting level of the most complex composite;
version 1.0 only.
§Errors
ParseError::TruncatedTable on a 0.5 table.
Trait Implementations§
impl<'a> Copy for MaxpTable<'a>
impl<'a> Eq for MaxpTable<'a>
impl<'a> StructuralPartialEq for MaxpTable<'a>
Auto Trait Implementations§
impl<'a> Freeze for MaxpTable<'a>
impl<'a> RefUnwindSafe for MaxpTable<'a>
impl<'a> Send for MaxpTable<'a>
impl<'a> Sync for MaxpTable<'a>
impl<'a> Unpin for MaxpTable<'a>
impl<'a> UnsafeUnpin for MaxpTable<'a>
impl<'a> UnwindSafe for MaxpTable<'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