{"record":{"id":"5b159883a17d8d2a","repo":"bevyengine/bevy","slug":"fatal-error-when-processing-text-e","errorCode":null,"errorMessage":"Fatal error when processing text: {e}.","messagePattern":"Fatal error when processing text: (.+?)\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/bevy_sprite/src/text2d.rs","lineNumber":302,"sourceCode":"                    | TextError::NoSuchFontFamily(_)\n                    | TextError::DegenerateScaleFactor,\n                ) => {\n                    // There was an error processing the text layout.\n                    // Add this entity to the queue and reprocess it in the following frame\n                    reprocess_queue.insert(entity);\n                    continue;\n                }\n                Err(e @ TextError::FailedToGetGlyphImage(_)) => {\n                    bevy_log::warn_once!(\"{e}.\");\n                    text_layout_info.clear();\n                }\n                Err(\n                    e @ (TextError::FailedToAddGlyph(_)\n                    | TextError::MissingAtlasLayout\n                    | TextError::MissingAtlasTexture\n                    | TextError::InconsistentAtlasState),\n                ) => {\n                    panic!(\"Fatal error when processing text: {e}.\");\n                }\n                Ok(()) => {}\n            }\n        }\n\n        match text_pipeline.update_text_layout_info(\n            &mut text_layout_info,\n            &mut font_atlas_set,\n            &mut textures,\n            &mut computed,\n            &mut scale_cx,\n            text_bounds,\n            block.justify,\n            *hinting,\n        ) {\n            Err(TextError::NoSuchFont | TextError::NoSuchFontFamily(_)) => {\n                // There was an error processing the text layout.\n                // Add this entity to the queue and reprocess it in the following frame.","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_sprite/src/text2d.rs#L284-L320","documentation":"In the Text2d layout system (text2d.rs:296-303), errors from TextPipeline::update_buffer that are considered unrecoverable — FailedToAddGlyph, MissingAtlasLayout, MissingAtlasTexture, InconsistentAtlasState — panic with this message. They indicate the font atlas machinery is in a broken state: a glyph could not be added to a newly created atlas, or the atlas layout/texture components the text system expects are missing or inconsistent. (NoSuchFont/NoSuchFontFamily/DegenerateScaleFactor are retried; FailedToGetGlyphImage is only warned.)","triggerScenarios":"Font atlas storage/components (FontAtlasStorage, atlas layout, atlas texture) removed or mutated while the text system runs; corrupted font files producing unusable glyph metrics; engine bugs in atlas creation; mismatched bevy_text/bevy_sprite versions.","commonSituations":"Custom plugins that touch FontAtlas* components or the CosmicFontSystem resource; hot-replacing fonts; mixing Bevy crate versions in one dependency graph; fonts with broken tables.","solutions":["Verify all bevy_* crates resolve to the same version (cargo tree) and update","Stop manually removing/mutating FontAtlasStorage, atlas layouts, or atlas texture components","Try a different font file to rule out a corrupted font","Minimize the repro and report it upstream with the full panic backtrace — this path indicates an engine invariant broke"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never remove or mutate FontAtlasStorage / atlas layout / atlas texture components while text systems run","Keep bevy_text, bevy_sprite, and bevy_render versions identical (check cargo tree)","Sanity-check font files open cleanly in a font editor before shipping them as assets"],"tags":["bevy","text","font-atlas","glyph","text2d","panic"],"backgroundTag":"glyph-atlas-error","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"}