{"record":{"id":"fb6b65efbe3e26b1","repo":"bevyengine/bevy","slug":"font-not-found","errorCode":null,"errorMessage":"font not found","messagePattern":"font not found","errorType":"exception","errorClass":"TextError","httpStatus":null,"severity":"warning","filePath":"crates/bevy_text/src/error.rs","lineNumber":8,"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","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_text/src/error.rs#L1-L26","documentation":"TextError::NoSuchFont (bevy_text/src/error.rs:8) means a text span's font could not be found: the font asset has not finished loading yet, or it failed to load. The text pipeline returns it when a FontSource::Handle fails to resolve in the Fonts map (pipeline.rs:114-117). UI and 2D text systems treat it as transient — the entity is queued and reprocessed the following frame — so it is usually a wait-a-frame condition unless the font can never load.","triggerScenarios":"Spawning Text2d/Text UI with a font handle obtained from asset_server.load() in the same frame; the font file missing from assets/, wrong path/case, or an unsupported/corrupted file so loading fails; using a weak/default handle for a font that is not loaded.","commonSituations":"Text appearing one frame late (benign); no text ever rendering because 'fonts/MyFont.ttf' does not exist or the extension/case is wrong on Linux; fonts in a directory not packaged into the assets folder; wasm builds missing font files.","solutions":["If it is purely async loading, do nothing — the reprocess queue renders the text next frame","Verify the font path and extension under assets/ (case-sensitive on Linux; .ttf/.otf)","Check the asset load error Bevy logs — a failed load makes this permanent","Gate text spawning on asset_server.is_loaded_with_dependencies(&handle) when the first frame must be correct"],"exampleFix":"// before — text spawns while the font is still loading\nlet font = asset_server.load(\"fonts/GameFont.ttf\");\ncommands.spawn(Text2d::new(\"hello\").with_font(TextFont { font, ..default() }));\n\n// after — spawn once the font (and its dependencies) are ready\nlet font = asset_server.load(\"fonts/GameFont.ttf\");\nif asset_server.is_loaded_with_dependencies(&font) {\n    commands.spawn(Text2d::new(\"hello\").with_font(TextFont { font, ..default() }));\n}","handlingStrategy":"retry","validationCode":"fn font_ready(server: &AssetServer, handle: &Handle<Font>) -> bool {\n    server.is_loaded_with_dependencies(handle)\n}","typeGuard":"fn font_loaded(server: &AssetServer, handle: &Handle<Font>) -> bool {\n    server.is_loaded_with_dependencies(handle)\n}","tryCatchPattern":"match text_pipeline.update_buffer(/* ... */) {\n    Err(TextError::NoSuchFont) => { /* requeue entity, retry next frame */ }\n    Err(e) => return Err(e),\n    Ok(()) => {}\n}","preventionTips":["Use exact, case-sensitive asset paths under assets/ and verify files ship with the build","Gate one-time-critical text on is_loaded_with_dependencies; otherwise rely on Bevy's automatic next-frame reprocessing","Check Bevy's asset-load error logs — a failed load makes this permanent until the path is fixed"],"tags":["bevy","text","font","asset-loading","text2d","ui"],"backgroundTag":"asset-not-yet-loaded","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"}