bevyengine/bevy · critical
Fatal error when processing text: {e}.
Error message
Fatal error when processing text: {e}. What it means
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.)
Source
Thrown at crates/bevy_sprite/src/text2d.rs:302
| TextError::NoSuchFontFamily(_)
| TextError::DegenerateScaleFactor,
) => {
// There was an error processing the text layout.
// Add this entity to the queue and reprocess it in the following frame
reprocess_queue.insert(entity);
continue;
}
Err(e @ TextError::FailedToGetGlyphImage(_)) => {
bevy_log::warn_once!("{e}.");
text_layout_info.clear();
}
Err(
e @ (TextError::FailedToAddGlyph(_)
| TextError::MissingAtlasLayout
| TextError::MissingAtlasTexture
| TextError::InconsistentAtlasState),
) => {
panic!("Fatal error when processing text: {e}.");
}
Ok(()) => {}
}
}
match text_pipeline.update_text_layout_info(
&mut text_layout_info,
&mut font_atlas_set,
&mut textures,
&mut computed,
&mut scale_cx,
text_bounds,
block.justify,
*hinting,
) {
Err(TextError::NoSuchFont | TextError::NoSuchFontFamily(_)) => {
// There was an error processing the text layout.
// Add this entity to the queue and reprocess it in the following frame.View on GitHub (pinned to 396ca72708)
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
Defensive patterns
Strategy: validation
Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Fatal error when processing text: {e}.
- font not found
- failed to add glyph to newly-created atlas {0:?}
- failed to get scaled glyph image for cache key: {0:?}
- missing texture for the font atlas
AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20).
Data as JSON: /api/errors/5b159883a17d8d2a.
Report an issue: GitHub.