emilk/egui · error

Nonexistent font ID

Error message

Nonexistent font ID

What it means

Error "Nonexistent font ID" thrown in emilk/egui.

Source

Thrown at crates/epaint/src/text/fonts.rs:687

                (FontFaceKey::INVALID, PRIMARY_REPLACEMENT_CHAR)
            });
        slf.replacement_face_key = replacement_face_key;
        slf.replacement_char = replacement_char;

        slf
    }

    /// Walk the fallback chain and return the first face whose charmap supports `c`.
    ///
    /// Pure — does not touch any cache. Callers that want memoisation should
    /// insert into [`Self::face_cache`] themselves.
    pub(crate) fn find_face_for_char(
        &self,
        c: char,
        fonts_by_id: &mut nohash_hasher::IntMap<FontFaceKey, FontFace>,
    ) -> Option<FontFaceKey> {
        for font_key in &self.fonts {
            let font_face = fonts_by_id.get_mut(font_key).expect("Nonexistent font ID");
            if font_face.glyph_id_resolution(c).is_some() {
                return Some(*font_key);
            }
        }
        None
    }
}

// ----------------------------------------------------------------------------

/// The collection of fonts used by `epaint`.
///
/// Required in order to paint text. Create one and reuse. Cheap to clone.
///
/// Each [`Fonts`] comes with a font atlas textures that needs to be used when painting.
///
/// If you are using `egui`, use `egui::Context::set_fonts` and `egui::Context::fonts`.
///

View on GitHub (pinned to d802a982ce)

When it happens

Trigger: Thrown at crates/epaint/src/text/fonts.rs:687 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of emilk/egui@d802a982ce (2026-08-16). Data as JSON: /api/errors/61c94677d8209bd8. Report an issue: GitHub.