{"record":{"id":"12111ce38eb15f5c","repo":"bevyengine/bevy","slug":"failed-to-get-scaled-glyph-image-for-cache-key-0","errorCode":null,"errorMessage":"failed to get scaled glyph image for cache key: {0:?}","messagePattern":"failed to get scaled glyph image for cache key: (.+?)","errorType":"exception","errorClass":"TextError","httpStatus":null,"severity":"error","filePath":"crates/bevy_text/src/error.rs","lineNumber":18,"sourceCode":"use thiserror::Error;\n\n#[derive(Debug, PartialEq, Eq, Error)]\n/// Errors related to the textsystem\npub enum TextError {\n    /// Font was not found, this could be that the font has not yet been loaded, or\n    /// that the font failed to load for some other reason\n    #[error(\"font not found\")]\n    NoSuchFont,\n    /// Font was not found, this could be that the font has not yet been loaded, or\n    /// that the font failed to load for some other reason\n    #[error(\"No such font family {0:?}\")]\n    NoSuchFontFamily(String),\n    /// Failed to add glyph to a newly created atlas for some reason\n    #[error(\"failed to add glyph to newly-created atlas {0:?}\")]\n    FailedToAddGlyph(u16),\n    /// Failed to get scaled glyph image for cache key\n    #[error(\"failed to get scaled glyph image for cache key: {0:?}\")]\n    FailedToGetGlyphImage(u16),\n    /// Missing texture atlas layout for the font\n    #[error(\"missing texture atlas layout for the font\")]\n    MissingAtlasLayout,\n    /// Missing texture for the font atlas\n    #[error(\"missing texture for the font atlas\")]\n    MissingAtlasTexture,\n    /// Failed to find glyph in atlas after it was added\n    #[error(\"failed to find glyph in atlas after it was added\")]\n    InconsistentAtlasState,\n    #[error(\"scale factor <= 0\")]\n    /// Text cannot be rendered for a scale factor <= zero.\n    DegenerateScaleFactor,\n}\n","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_text/src/error.rs#L1-L33","documentation":"Produced in get_outlined_glyph_texture (crates/bevy_text/src/font_atlas.rs:207): swash's Render (trying ColorOutline, ColorBitmap, then Outline sources) returns None when asked to render the given glyph id, so Bevy has no image to put in the atlas. It means the scaler/font combination produced no renderable image for that glyph index.","triggerScenarios":"Calling text queueing/shaping where the resolved glyph id has no outline or bitmap in the selected font: broken fonts whose .notdef is unrenderable, bitmap-only fonts missing a strike at the requested size, or glyph ids that don't match the font actually used (font substitution/index drift).","commonSituations":"Using a stripped-down or subsetted font that lost glyphs, emoji/bitmap fonts without suitable strikes, variable font instancing quirks, or an old swash version bundled with an older Bevy. Also seen after hand-editing font files.","solutions":["Test the font in another renderer to confirm the character renders; if not, use a complete font","Re-subset or regenerate the font so all needed glyphs (including .notdef) have outlines","Update Bevy so its swash dependency picks up rasterizer fixes","Match on TextError::FailedToGetGlyphImage and skip/log the glyph instead of aborting the whole text update"],"exampleFix":"// before: broken font silently breaks every frame\nmatch font_atlas.add_glyph_to_atlas(...) { ... }\n\n// after: degrade gracefully per glyph\nmatch add_glyph_to_atlas(&mut font_atlases, textures, scaler, smoothing, glyph_id) {\n    Ok(info) => atlas_info = Some(info),\n    Err(TextError::FailedToGetGlyphImage(gid)) => {\n        warn_once!(\"font lacks a renderable glyph {gid}\");\n        continue;\n    }\n    Err(e) => return Err(e),\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match add_glyph_to_atlas(&mut font_atlases, textures, scaler, smoothing, glyph_id) {\n    Ok(info) => atlas_info = Some(info),\n    Err(TextError::FailedToGetGlyphImage(gid)) => {\n        warn_once!(\"glyph {gid} has no renderable image in this font\");\n        continue;\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Prefer complete, well-formed fonts over heavily subsetted ones","Test all scripts/characters you render with a new font before shipping","Update Bevy/swash when rasterizer fixes land"],"tags":["rust","bevy","text","glyph","rasterization","font"],"backgroundTag":"glyph-rasterization-failed","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}