bevy_text/
error.rs

1use cosmic_text::CacheKey;
2use thiserror::Error;
3
4#[derive(Debug, PartialEq, Eq, Error)]
5/// Errors related to the textsystem
6pub enum TextError {
7    /// Font was not found, this could be that the font has not yet been loaded, or
8    /// that the font failed to load for some other reason
9    #[error("font not found")]
10    NoSuchFont,
11    /// Failed to add glyph to a newly created atlas for some reason
12    #[error("failed to add glyph to newly-created atlas {0:?}")]
13    FailedToAddGlyph(u16),
14    /// Failed to get scaled glyph image for cache key
15    #[error("failed to get scaled glyph image for cache key: {0:?}")]
16    FailedToGetGlyphImage(CacheKey),
17    /// Missing texture atlas layout for the font
18    #[error("missing texture atlas layout for the font")]
19    MissingAtlasLayout,
20    /// Missing texture for the font atlas
21    #[error("missing texture for the font atlas")]
22    MissingAtlasTexture,
23    /// Failed to find glyph in atlas after it was added
24    #[error("failed to find glyph in atlas after it was added")]
25    InconsistentAtlasState,
26}