{"record":{"id":"45c4eaee1cb4b28f","repo":"slint-ui/slint","slug":"no-font-fallback-found-the-software-renderer-requ","errorCode":null,"errorMessage":"No font fallback found. The software renderer requires enabling the `EmbedForSoftwareRenderer` option when compiling slint files.","messagePattern":"No font fallback found\\. The software renderer requires enabling the `EmbedForSoftwareRenderer` option when compiling slint files\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/renderers/software/fonts.rs","lineNumber":195,"sourceCode":"                fonts\n                    .iter()\n                    .cloned()\n                    .filter(|bitmap_font| bitmap_font.italic == request.italic)\n                    .min_by_key(|bitmap_font| bitmap_font.weight.abs_diff(requested_weight))\n                    .or_else(|| fonts.first().cloned())\n            }) {\n                fallback_bitmap_font\n            } else {\n                #[cfg(feature = \"systemfonts\")]\n                return systemfonts::fallbackfont(\n                    request,\n                    scale_factor,\n                    &mut font_context.collection,\n                    &mut font_context.source_cache,\n                )\n                .into();\n                #[cfg(not(feature = \"systemfonts\"))]\n                panic!(\n                    \"No font fallback found. The software renderer requires enabling the `EmbedForSoftwareRenderer` option when compiling slint files.\"\n                )\n            }\n        }\n    };\n\n    let requested_pixel_size: PhysicalLength =\n        (request.pixel_size.unwrap_or(DEFAULT_FONT_SIZE).cast() * scale_factor).cast();\n\n    let nearest_pixel_size = font\n        .glyphs\n        .partition_point(|glyphs| pixel_size(glyphs) <= requested_pixel_size)\n        .saturating_sub(1);\n    let matching_glyphs = &font.glyphs[nearest_pixel_size];\n\n    let pixel_size = if font.sdf { requested_pixel_size } else { pixel_size(matching_glyphs) };\n\n    pixelfont::PixelFont { bitmap_font: font, glyphs: matching_glyphs, pixel_size }.into()","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/internal/renderers/software/fonts.rs#L177-L213","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Enable the EmbedForSoftwareRenderer option when compiling the .slint files so a font is embedded","Add the `systemfonts` feature so system fonts can be used as fallback","Embed/select a font family that actually covers the characters being rendered"],"exampleFix":"// build.rs\n// before\nslint_build::compile(\"ui/app.slint\").unwrap();\n// after\nlet config = slint_build::CompilerConfiguration::new()\n    .embed_resources(slint_build::EmbedResourcesKind::EmbedForSoftwareRenderer);\nslint_build::compile_with_config(\"ui/app.slint\", config).unwrap();","handlingStrategy":"validation","validationCode":"// at build time: assert a font is embedded when building for the software renderer\n// (build.rs)\nif cfg_software_renderer && !fonts_embedded {\n    panic!(\"Set EmbedForSoftwareRenderer so the software renderer has a font\");\n}","typeGuard":null,"tryCatchPattern":"// panic! is not catchable; guarantee an embedded font at compile time\nlet config = slint_build::CompilerConfiguration::new()\n    .embed_resources(slint_build::EmbedResourcesKind::EmbedForSoftwareRenderer);","preventionTips":["Always set EmbedForSoftwareRenderer in embedded/software-renderer builds","Include a font covering all glyphs your UI uses (e.g. a DejaVu subset)","Smoke-test text rendering on the target in CI with the exact release features"],"tags":["software-renderer","fonts","embedded","panic"],"backgroundTag":"missing-dependency","analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}