slint-ui/slint · critical

No font fallback found. The software renderer requires…

Error message

No font fallback found. The software renderer requires enabling the `EmbedForSoftwareRenderer` option when compiling slint files.

What it means

The software renderer's match_font panics when no font can be matched and the `systemfonts` feature is disabled, meaning there is no embedded font to fall back to. The software renderer (used on embedded/no_std-style targets) requires a font compiled in via the EmbedForSoftwareRenderer option when system font enumeration is unavailable.

Solutions

  1. Enable the EmbedForSoftwareRenderer option when compiling the .slint files so a font is embedded
  2. Add the `systemfonts` feature so system fonts can be used as fallback
  3. Embed/select a font family that actually covers the characters being rendered

Example fix

// build.rs
// before
slint_build::compile("ui/app.slint").unwrap();
// after
let config = slint_build::CompilerConfiguration::new()
    .embed_resources(slint_build::EmbedResourcesKind::EmbedForSoftwareRenderer);
slint_build::compile_with_config("ui/app.slint", config).unwrap();
Defensive patterns

Strategy: validation

Validate before calling

// at build time: assert a font is embedded when building for the software renderer
// (build.rs)
if cfg_software_renderer && !fonts_embedded {
    panic!("Set EmbedForSoftwareRenderer so the software renderer has a font");
}

Try / catch

// panic! is not catchable; guarantee an embedded font at compile time
let config = slint_build::CompilerConfiguration::new()
    .embed_resources(slint_build::EmbedResourcesKind::EmbedForSoftwareRenderer);

Prevention

When it happens

Trigger: Rendering text with the software renderer while the slint files were compiled without EmbedForSoftwareRenderer and the crate is built without the `systemfonts` feature, so no font collection is available to satisfy any family request (including the fallback pass).

Common situations: Embedded builds that forgot to embed a font; enabling the software renderer in a no_std/embedded configuration; requesting a font family with no embedded match and no fallback embedded.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of slint-ui/slint@bb937076de (2026-09-16). Data as JSON: /api/errors/45c4eaee1cb4b28f. Report an issue: GitHub.

Appendix: source

Thrown at internal/renderers/software/fonts.rs:195

                fonts
                    .iter()
                    .cloned()
                    .filter(|bitmap_font| bitmap_font.italic == request.italic)
                    .min_by_key(|bitmap_font| bitmap_font.weight.abs_diff(requested_weight))
                    .or_else(|| fonts.first().cloned())
            }) {
                fallback_bitmap_font
            } else {
                #[cfg(feature = "systemfonts")]
                return systemfonts::fallbackfont(
                    request,
                    scale_factor,
                    &mut font_context.collection,
                    &mut font_context.source_cache,
                )
                .into();
                #[cfg(not(feature = "systemfonts"))]
                panic!(
                    "No font fallback found. The software renderer requires enabling the `EmbedForSoftwareRenderer` option when compiling slint files."
                )
            }
        }
    };

    let requested_pixel_size: PhysicalLength =
        (request.pixel_size.unwrap_or(DEFAULT_FONT_SIZE).cast() * scale_factor).cast();

    let nearest_pixel_size = font
        .glyphs
        .partition_point(|glyphs| pixel_size(glyphs) <= requested_pixel_size)
        .saturating_sub(1);
    let matching_glyphs = &font.glyphs[nearest_pixel_size];

    let pixel_size = if font.sdf { requested_pixel_size } else { pixel_size(matching_glyphs) };

    pixelfont::PixelFont { bitmap_font: font, glyphs: matching_glyphs, pixel_size }.into()

View on GitHub (pinned to bb937076de)