#[non_exhaustive]pub enum ScaleError {
GlyphNotFound(GlyphId),
InsufficientMemory {
required: usize,
supplied: usize,
},
Outline(Error),
Hinting(HintError),
}Expand description
An error from drawing a glyph with a ScalerFont.
Each variant names the step that failed and carries what that step knows.
kind gives the same failure as a read-fonts Error, for
a caller that only sorts errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
GlyphNotFound(GlyphId)
The font has no outline for the glyph.
InsufficientMemory
The memory supplied for the draw is smaller than the glyph needs.
Fields
required: usizeThe size in bytes the glyph needs, as
ScalerOutline::required_memory_size
reports it.
Outline(Error)
Reading or evaluating the outline failed.
Hinting(HintError)
A TrueType program failed.
This is the font or control value program when the scaler was configured, or a glyph program when hinting is pedantic.
Implementations§
Source§impl ScaleError
impl ScaleError
Sourcepub(super) fn from_outline(
error: Error,
required: usize,
supplied: usize,
) -> Self
pub(super) fn from_outline( error: Error, required: usize, supplied: usize, ) -> Self
Converts an error from drawing an outline into supplied bytes of a
required size.
Sourcepub(super) fn from_draw_error(
error: DrawError,
required: usize,
supplied: usize,
) -> Self
pub(super) fn from_draw_error( error: DrawError, required: usize, supplied: usize, ) -> Self
Converts an error from skrifa’s automatic hinter, which drew into
supplied bytes of a required size.
Trait Implementations§
Source§impl Clone for ScaleError
impl Clone for ScaleError
Source§fn clone(&self) -> ScaleError
fn clone(&self) -> ScaleError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScaleError
impl Debug for ScaleError
Source§impl Display for ScaleError
impl Display for ScaleError
Source§impl Error for ScaleError
impl Error for ScaleError
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()