{"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":"    fn DrawGlyphRun(\n        &self,\n        clientdrawingcontext: *const ::core::ffi::c_void,\n        _baselineoriginx: f32,\n        _baselineoriginy: f32,\n        _measuringmode: DWRITE_MEASURING_MODE,\n        glyphrun: *const DWRITE_GLYPH_RUN,\n        glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION,\n        _clientdrawingeffect: windows::core::Ref<windows::core::IUnknown>,\n    ) -> windows::core::Result<()> {\n        let glyphrun = unsafe { &*glyphrun };\n        let glyph_count = glyphrun.glyphCount as usize;\n        if glyph_count == 0 {\n            return Ok(());\n        }\n        let desc = unsafe { &*glyphrundescription };\n        let context = unsafe { &mut *(clientdrawingcontext.cast::<RendererContext>().cast_mut()) };\n        let Some(font_face) = glyphrun.fontFace.as_ref() else {\n            return Ok(());\n        };\n        // This `cast()` action here should never fail since we are running on Win10+, and\n        // `IDWriteFontFace3` requires Win10\n        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","sourceCodeStart":1493,"sourceCodeEnd":1529,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/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":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}