{"record":{"id":"fd1d3a5a7165e635","repo":"wezterm/wezterm","slug":"failed-to-get-menlo-font","errorCode":null,"errorMessage":"failed to get Menlo font","messagePattern":"failed to get Menlo font","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wezterm-font/src/locator/core_text.rs","lineNumber":132,"sourceCode":"                        fonts.push(parsed);\n                        loaded.insert(attr.clone());\n                    }\n                }\n                Err(err) => log::trace!(\"load_fonts: descriptor_from_attr: {:#}\", err),\n            }\n        }\n\n        Ok(fonts)\n    }\n\n    fn locate_fallback_for_codepoints(\n        &self,\n        codepoints: &[char],\n    ) -> anyhow::Result<Vec<ParsedFont>> {\n        let mut matches = vec![];\n\n        let menlo =\n            new_from_name(\"Menlo\", 0.0).map_err(|_| anyhow::anyhow!(\"failed to get Menlo font\"))?;\n\n        for &c in codepoints {\n            let mut wanted = RangeSet::new();\n            wanted.add(c as u32);\n            let text = CFString::new(&c.to_string());\n\n            let font = unsafe {\n                CTFontCreateForString(\n                    menlo.as_concrete_TypeRef(),\n                    text.as_concrete_TypeRef(),\n                    CFRange::init(0, 1),\n                )\n            };\n\n            if font.is_null() {\n                continue;\n            }\n","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/wezterm/wezterm/blob/9c04f79f86649f76a8c978ff4b674f60297a6ec9/wezterm-font/src/locator/core_text.rs#L114-L150","documentation":"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.","triggerScenarios":"Running on macOS where Menlo is absent or disabled — slimmed VM images, sandboxed environments blocking system font access, or corrupted font registration.","commonSituations":"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.","solutions":["Verify Menlo is installed: system_profiler SPFontsDataType | grep -i menlo","Reinstall/enable macOS system fonts (they can be restored from the OS installer or another machine)","In sandboxed apps, ensure the com.apple.fonts / system font entitlements or access are not blocked","Fall back to seeding the fallback lookup with another installed monospace font instead of Menlo"],"exampleFix":"// before\nlet menlo = new_from_name(\"Menlo\", 0.0).map_err(|_| anyhow::anyhow!(\"failed to get Menlo font\"))?;\n\n// after\nlet seed = new_from_name(\"Menlo\", 0.0)\n    .or_else(|_| new_from_name(\"Courier New\", 0.0))\n    .map_err(|_| anyhow::anyhow!(\"failed to get a seed monospace font\"))?;","handlingStrategy":"fallback","validationCode":"if new_from_name(\"Menlo\", 0.0).is_err() {\n    log::warn!(\"Menlo unavailable; system font set may be incomplete\");\n}","typeGuard":null,"tryCatchPattern":"let seed = new_from_name(\"Menlo\", 0.0)\n    .or_else(|_| new_from_name(\"Courier New\", 0.0))\n    .or_else(|_| new_from_name(\"Helvetica\", 0.0))\n    .map_err(|_| anyhow::anyhow!(\"no usable seed font for CoreText fallback\"))?;","preventionTips":["Do not hard-depend on a single system font for fallback seeding; try a chain of seed fonts","On slimmed macOS images, verify the base system font set during image build","Ensure sandboxed builds grant access to system fonts"],"tags":["macos","coretext","menlo","system-fonts","fallback","rust","wezterm"],"backgroundTag":"system-font-missing","analyzedSha":"9c04f79f86649f76a8c978ff4b674f60297a6ec9","analyzedAt":"2026-08-16T21:23:27.157Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}