Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/crates/bevy_text/src/error.rs
9299 views
1
use cosmic_text::CacheKey;
2
use thiserror::Error;
3
4
#[derive(Debug, PartialEq, Eq, Error)]
5
/// Errors related to the textsystem
6
pub 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
#[error("scale factor <= 0")]
27
/// Text cannot be rendered for a scale factor <= zero.
28
DegenerateScaleFactor,
29
}
30
31