zed-industries/zed · error

requested font family contains no font matching the other pa

Error message

requested font family contains no font matching the other parameters

What it means

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.

Source

Thrown at crates/gpui_wgpu/src/cosmic_text_system.rs:788

    }

    !text.is_ascii() && text.chars().any(is_paragraph_separator)
}

fn clip_font_runs(font_runs: &[FontRun], range: Range<usize>) -> SmallVec<[FontRun; 4]> {
    let mut clipped = SmallVec::new();
    let mut offs = 0;
    for run in font_runs {
        let run_start = offs;
        offs += run.len;
        if offs <= range.start {
            continue;
        }
        if run_start >= range.end {
            break;
        }
        let start = run_start.max(range.start);
        let end = offs.min(range.end);
        if start < end {
            clipped.push(FontRun {
                len: end - start,
                font_id: run.font_id,
            });
        }
    }
    clipped
}

#[cfg(feature = "font-kit")]
fn find_best_match(
    font: &Font,
    candidates: &[FontId],
    state: &CosmicTextSystemState,
) -> Result<usize> {
    let candidate_properties = candidates
        .iter()

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Install the requested font family, or fix the family name in the theme/settings
  2. On Linux, refresh the font cache after installing fonts (fc-cache -f)
  3. Register a fallback: resolve families through a chain (requested then default) and catch resolution errors to drop to the default family
  4. Bundle a default font with the app for deterministic rendering

Example fix

// before
let ix = find_best_match(&font, &candidates, state)?; // bails when family is unknown

// after: fall back to a known-good family
let fallback_font = Font { family: "DejaVu Sans".into(), ..font.clone() };
let ix = find_best_match(&font, &candidates, state)
    .or_else(|_| find_best_match(&fallback_font, &fallback_candidates, state))?;
Defensive patterns

Strategy: fallback

Validate before calling

// before resolving a family, confirm the font system knows it
let candidates = state.font_ids_for_family(&font.family);
if candidates.is_empty() {
    // switch to a bundled default family instead of erroring
}

Try / catch

let font_index = find_best_match(&font, &candidates, state)
    .or_else(|_| find_best_match(&fallback_font, &fallback_candidates, state))?;

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/5bf4f0620e66fb4e. Report an issue: GitHub.