{"record":{"id":"5dfe323a9436d70e","repo":"zed-industries/zed","slug":"dwrite-e-nofont","errorCode":"DWRITE_E_NOFONT","errorMessage":"Failed to create font","messagePattern":"Failed to create font","errorType":"error_code","errorClass":"windows::core::Error","httpStatus":null,"severity":"error","filePath":"crates/gpui_windows/src/direct_write.rs","lineNumber":1511,"sourceCode":"        let Ok(font_face) = &font_face.cast::<IDWriteFontFace3>() else {\n            return Err(Error::new(\n                DWRITE_E_UNSUPPORTEDOPERATION,\n                \"Failed to cast font face\",\n            ));\n        };\n\n        let font_face_key = font_face.cast::<IUnknown>().unwrap().as_raw().addr();\n        let font_id = context\n            .text_system\n            .font_info_cache\n            .get(&font_face_key)\n            .copied()\n            // in some circumstances, we might be getting served a FontFace that we did not create ourselves\n            // so create a new font from it and cache it accordingly. The usual culprit here seems to be Segoe UI Symbol\n            .map_or_else(\n                || {\n                    let font = font_face_to_font(font_face, &self.locale)\n                        .ok_or_else(|| Error::new(DWRITE_E_NOFONT, \"Failed to create font\"))?;\n                    let font_id = match context.text_system.font_to_font_id.get(&font) {\n                        Some(&font_id) => font_id,\n                        None => context\n                            .text_system\n                            .select_and_cache_font(context.components, &font)\n                            .ok_or_else(|| Error::new(DWRITE_E_NOFONT, \"Failed to create font\"))?,\n                    };\n                    context\n                        .text_system\n                        .font_info_cache\n                        .insert(font_face_key, font_id);\n                    windows::core::Result::Ok(font_id)\n                },\n                Ok,\n            )?;\n\n        let color_font = unsafe { font_face.IsColorFont().as_bool() };\n","sourceCodeStart":1493,"sourceCodeEnd":1529,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_windows/src/direct_write.rs#L1493-L1529","documentation":"The renderer encountered a font face it did not create itself (cache miss), and creating a new font from the face's font info failed. Glyph rendering for this run cannot proceed with full font metadata.","triggerScenarios":"Thrown at crates/gpui_windows/src/direct_write.rs:1511 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fall back to rendering the glyph run with default font metrics when font creation fails","Prune stale font_info_cache entries so fresh lookups are attempted"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}