{"record":{"id":"c70ad59c6cd6b7f4","repo":"zed-industries/zed","slug":"dwrite-e-unsupportedoperation","errorCode":"DWRITE_E_UNSUPPORTEDOPERATION","errorMessage":"Failed to cast font face","messagePattern":"Failed to cast font face","errorType":"error_code","errorClass":"windows::core::Error","httpStatus":null,"severity":"error","filePath":"crates/gpui_windows/src/direct_write.rs","lineNumber":1494,"sourceCode":"                dx: 0.0,\n                dy: 0.0,\n            };\n        }\n        Ok(())\n    }\n\n    fn GetPixelsPerDip(\n        &self,\n        _clientdrawingcontext: *const ::core::ffi::c_void,\n    ) -> windows::core::Result<f32> {\n        Ok(1.0)\n    }\n}\n\n#[allow(non_snake_case)]\nimpl IDWriteTextRenderer_Impl for TextRenderer_Impl {\n    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        };","sourceCodeStart":1476,"sourceCodeEnd":1512,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/gpui_windows/src/direct_write.rs#L1476-L1512","documentation":"In the DirectWrite glyph-run renderer, the cached font face could not be cast to IDWriteFontFace3. The renderer returns DWRITE_E_UNSUPPORTEDOPERATION so callers can take a fallback path for this glyph run.","triggerScenarios":"Thrown at crates/gpui_windows/src/direct_write.rs:1494 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Let the caller fall back to a simpler rendering path on unsupported-operation","Ensure the font face was created via an API that yields IDWriteFontFace3 (older/custom font sources may only provide earlier interfaces)"],"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"}