wezterm/wezterm · error

failed to get Menlo font

Error message

failed to get Menlo font

What it means

locate_fallback_for_codepoints seeds CoreText's per-string fallback with a Menlo font; CTFont new_from_name("Menlo", 0.0) failed. Menlo ships with macOS, so this failure indicates a stripped or broken system font set, a disabled Menlo, or a CoreText font manager in a bad state.

Source

Thrown at wezterm-font/src/locator/core_text.rs:132

                        fonts.push(parsed);
                        loaded.insert(attr.clone());
                    }
                }
                Err(err) => log::trace!("load_fonts: descriptor_from_attr: {:#}", err),
            }
        }

        Ok(fonts)
    }

    fn locate_fallback_for_codepoints(
        &self,
        codepoints: &[char],
    ) -> anyhow::Result<Vec<ParsedFont>> {
        let mut matches = vec![];

        let menlo =
            new_from_name("Menlo", 0.0).map_err(|_| anyhow::anyhow!("failed to get Menlo font"))?;

        for &c in codepoints {
            let mut wanted = RangeSet::new();
            wanted.add(c as u32);
            let text = CFString::new(&c.to_string());

            let font = unsafe {
                CTFontCreateForString(
                    menlo.as_concrete_TypeRef(),
                    text.as_concrete_TypeRef(),
                    CFRange::init(0, 1),
                )
            };

            if font.is_null() {
                continue;
            }

View on GitHub (pinned to 9c04f79f86)

Solutions

  1. Verify Menlo is installed: system_profiler SPFontsDataType | grep -i menlo
  2. Reinstall/enable macOS system fonts (they can be restored from the OS installer or another machine)
  3. In sandboxed apps, ensure the com.apple.fonts / system font entitlements or access are not blocked
  4. Fall back to seeding the fallback lookup with another installed monospace font instead of Menlo

Example fix

// before
let menlo = new_from_name("Menlo", 0.0).map_err(|_| anyhow::anyhow!("failed to get Menlo font"))?;

// after
let seed = new_from_name("Menlo", 0.0)
    .or_else(|_| new_from_name("Courier New", 0.0))
    .map_err(|_| anyhow::anyhow!("failed to get a seed monospace font"))?;
Defensive patterns

Strategy: fallback

Validate before calling

if new_from_name("Menlo", 0.0).is_err() {
    log::warn!("Menlo unavailable; system font set may be incomplete");
}

Try / catch

let seed = new_from_name("Menlo", 0.0)
    .or_else(|_| new_from_name("Courier New", 0.0))
    .or_else(|_| new_from_name("Helvetica", 0.0))
    .map_err(|_| anyhow::anyhow!("no usable seed font for CoreText fallback"))?;

Prevention

When it happens

Trigger: Running on macOS where Menlo is absent or disabled — slimmed VM images, sandboxed environments blocking system font access, or corrupted font registration.

Common situations: Minimal macOS CI images with subsets of system fonts; app sandboxes or managed fleets where system fonts were restricted; broken Font Book registration after mass font changes.

Related errors


AI-assisted analysis of wezterm/wezterm@9c04f79f86 (2026-08-16). Data as JSON: /api/errors/fd1d3a5a7165e635. Report an issue: GitHub.