emilk/egui · error

FontFamily::{family:?} is not bound to any fonts

Error message

FontFamily::{family:?} is not bound to any fonts

What it means

Error "FontFamily::{family:?} is not bound to any fonts" thrown in emilk/egui.

Source

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

        self.atlas.options()
    }

    /// Take the recycled shaping buffer (or create a new one if already taken).
    pub fn take_shape_buffer(&mut self) -> harfrust::UnicodeBuffer {
        self.shape_buffer.take().unwrap_or_default()
    }

    /// Return a shaping buffer for reuse.
    pub fn return_shape_buffer(&mut self, buffer: harfrust::UnicodeBuffer) {
        self.shape_buffer = Some(buffer);
    }

    /// Get the right font implementation from [`FontFamily`].
    pub fn font(&mut self, family: &FontFamily) -> Font<'_> {
        let cached_family = self.family_cache.entry(family.clone()).or_insert_with(|| {
            let fonts = &self.definitions.families.get(family);
            let fonts =
                fonts.unwrap_or_else(|| panic!("FontFamily::{family:?} is not bound to any fonts"));

            let fonts: Vec<FontFaceKey> = fonts
                .iter()
                .map(|font_name| {
                    *self
                        .fonts_by_name
                        .get(font_name)
                        .unwrap_or_else(|| panic!("No font data found for {font_name:?}"))
                })
                .collect();

            CachedFamily::new(fonts, &mut self.fonts_by_id)
        });
        Font {
            fonts_by_id: &mut self.fonts_by_id,
            cached_family,
            atlas: &mut self.atlas,
        }

View on GitHub (pinned to b9a0723d88)

Solutions

  1. Bind at least one font to this FontFamily in FontDefinitions::families before use.

Example fix

fonts.families.entry(FontFamily::Proportional).or_default().push("MyFont".to_owned());

When it happens

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

Common situations: See trigger scenarios.


AI-assisted analysis of emilk/egui@b9a0723d88 (2026-08-19). Data as JSON: /api/errors/56d58bf22ca49c94. Report an issue: GitHub.