{"record":{"id":"5bf4f0620e66fb4e","repo":"zed-industries/zed","slug":"requested-font-family-contains-no-font-matching-th","errorCode":null,"errorMessage":"requested font family contains no font matching the other parameters","messagePattern":"requested font family contains no font matching the other parameters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_wgpu/src/cosmic_text_system.rs","lineNumber":788,"sourceCode":"    }\n\n    !text.is_ascii() && text.chars().any(is_paragraph_separator)\n}\n\nfn clip_font_runs(font_runs: &[FontRun], range: Range<usize>) -> SmallVec<[FontRun; 4]> {\n    let mut clipped = SmallVec::new();\n    let mut offs = 0;\n    for run in font_runs {\n        let run_start = offs;\n        offs += run.len;\n        if offs <= range.start {\n            continue;\n        }\n        if run_start >= range.end {\n            break;\n        }\n        let start = run_start.max(range.start);\n        let end = offs.min(range.end);\n        if start < end {\n            clipped.push(FontRun {\n                len: end - start,\n                font_id: run.font_id,\n            });\n        }\n    }\n    clipped\n}\n\n#[cfg(feature = \"font-kit\")]\nfn find_best_match(\n    font: &Font,\n    candidates: &[FontId],\n    state: &CosmicTextSystemState,\n) -> Result<usize> {\n    let candidate_properties = candidates\n        .iter()","sourceCodeStart":770,"sourceCodeEnd":806,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_wgpu/src/cosmic_text_system.rs#L770-L806","documentation":"gpui_wgpu's cosmic-text font system resolves a Font (family plus weight and style parameters) to a concrete font id from the candidate list for that family. The no-font-kit build bails when the candidates list is empty; the font-kit build surfaces the same message when font_kit::matching::find_best_match returns nothing. Either way, the requested family produced no usable face for the given parameters.","triggerScenarios":"Requesting text layout with a font family that is not installed or registered on the system (typo in a theme, missing font), or a family whose faces are all filtered out by the other parameters.","commonSituations":"Minimal Linux or container images without the theme font installed; user themes referencing uninstalled fonts; headless CI with an empty fontconfig cache; family name casing or aliasing differences across platforms.","solutions":["Install the requested font family, or fix the family name in the theme/settings","On Linux, refresh the font cache after installing fonts (fc-cache -f)","Register a fallback: resolve families through a chain (requested then default) and catch resolution errors to drop to the default family","Bundle a default font with the app for deterministic rendering"],"exampleFix":"// before\nlet ix = find_best_match(&font, &candidates, state)?; // bails when family is unknown\n\n// after: fall back to a known-good family\nlet fallback_font = Font { family: \"DejaVu Sans\".into(), ..font.clone() };\nlet ix = find_best_match(&font, &candidates, state)\n    .or_else(|_| find_best_match(&fallback_font, &fallback_candidates, state))?;","handlingStrategy":"fallback","validationCode":"// before resolving a family, confirm the font system knows it\nlet candidates = state.font_ids_for_family(&font.family);\nif candidates.is_empty() {\n    // switch to a bundled default family instead of erroring\n}","typeGuard":null,"tryCatchPattern":"let font_index = find_best_match(&font, &candidates, state)\n    .or_else(|_| find_best_match(&fallback_font, &fallback_candidates, state))?;","preventionTips":["Bundle a default font with the application","Validate theme font families at load time against installed fonts","Warm the fontconfig cache (fc-cache) on first run in containers and CI"],"tags":["gpui","wgpu","fonts","cosmic-text","linux","rendering"],"backgroundTag":"font-not-found","analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}