pub enum Error {
UnexpectedEof,
BadMagic,
BadHeader,
MissingTable(&'static str),
BadOffset,
GlyphOutOfRange(u16),
UnsupportedCmapFormat(u16),
CompositeTooDeep,
BadLocaOffset,
BadStructure(&'static str),
SubfontOutOfRange(u32),
}Expand description
Errors emitted during font parsing or glyph lookup.
Variants§
UnexpectedEof
The input slice is too short for the requested header / structure.
BadMagic
The sfnt magic version did not match 0x00010000, OTTO, or true.
BadHeader
The table count in the sfnt header is implausibly large.
MissingTable(&'static str)
A required table was missing from the table directory.
BadOffset
A length / offset field pointed outside the file.
GlyphOutOfRange(u16)
A glyph index was out of range vs. maxp.numGlyphs.
UnsupportedCmapFormat(u16)
A cmap subtable used a format we do not implement in round 1.
CompositeTooDeep
A composite-glyph chain exceeded the max recursion depth (16).
BadLocaOffset
A loca offset pointed past the end of glyf.
BadStructure(&'static str)
A varying-length structure was malformed.
SubfontOutOfRange(u32)
A from_collection_bytes call asked for a subfont index that
the TTC header does not contain. Carries the requested index.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()