{"record":{"id":"cca6787b4f14ced3","repo":"typst/typst","slug":"failed-to-process","errorCode":null,"errorMessage":"failed to process {}","messagePattern":"failed to process (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/typst-pdf/src/text.rs","lineNumber":97,"sourceCode":"fn build_font(typst_font: FontInstance) -> SourceResult<krilla::text::Font> {\n    let font_data: Arc<dyn AsRef<[u8]> + Send + Sync> =\n        Arc::new(typst_font.data().clone());\n\n    let variations = typst_font\n        .variations()\n        .0\n        .iter()\n        .map(|(tag, value)| (krilla::text::Tag::new(&tag.to_bytes()), value.0))\n        .collect::<Vec<_>>();\n\n    match krilla::text::Font::new_variable(\n        font_data.into(),\n        typst_font.index(),\n        &variations,\n    ) {\n        Some(f) => Ok(f),\n        None => {\n            bail!(\n                Span::detached(),\n                \"failed to process {}\",\n                display_font(Some(&typst_font)),\n            )\n        }\n    }\n}\n\n#[derive(Debug, TransparentWrapper)]\n#[repr(transparent)]\nstruct PdfGlyph(Glyph);\n\nimpl krilla::text::Glyph for PdfGlyph {\n    #[inline(always)]\n    fn glyph_id(&self) -> GlyphId {\n        GlyphId::new(self.0.id as u32)\n    }\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/typst/typst/blob/35417aa769ab9d699a60384f91082b09bc6ba421/crates/typst-pdf/src/text.rs#L79-L115","documentation":"Fires in build_font when krilla's Font::new_variable returns None: the font data (with its variations) could not be turned into an embeddable krilla font. The font bytes are invalid, unsupported, or the variable-font configuration can't be processed, so PDF export cannot proceed.","triggerScenarios":"Thrown at crates/typst-pdf/src/text.rs:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the font file is valid and not corrupted","Try a non-variable version of the font","Use a different font for the document"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35417aa769ab9d699a60384f91082b09bc6ba421","analyzedAt":"2026-08-17T21:03:48.984Z","contentChangedAt":"2026-08-17T21:03:48.984Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}