use cosmic_text::CacheKey;
use thiserror::Error;
#[derive(Debug, PartialEq, Eq, Error)]
pub enum TextError {
#[error("font not found")]
NoSuchFont,
#[error("failed to add glyph to newly-created atlas {0:?}")]
FailedToAddGlyph(u16),
#[error("failed to get scaled glyph image for cache key: {0:?}")]
FailedToGetGlyphImage(CacheKey),
#[error("missing texture atlas layout for the font")]
MissingAtlasLayout,
#[error("missing texture for the font atlas")]
MissingAtlasTexture,
#[error("failed to find glyph in atlas after it was added")]
InconsistentAtlasState,
#[error("scale factor <= 0")]
DegenerateScaleFactor,
}