typst/typst · error
failed to process {}
Error message
failed to process {} What it means
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.
Source
Thrown at crates/typst-pdf/src/text.rs:97
fn build_font(typst_font: FontInstance) -> SourceResult<krilla::text::Font> {
let font_data: Arc<dyn AsRef<[u8]> + Send + Sync> =
Arc::new(typst_font.data().clone());
let variations = typst_font
.variations()
.0
.iter()
.map(|(tag, value)| (krilla::text::Tag::new(&tag.to_bytes()), value.0))
.collect::<Vec<_>>();
match krilla::text::Font::new_variable(
font_data.into(),
typst_font.index(),
&variations,
) {
Some(f) => Ok(f),
None => {
bail!(
Span::detached(),
"failed to process {}",
display_font(Some(&typst_font)),
)
}
}
}
#[derive(Debug, TransparentWrapper)]
#[repr(transparent)]
struct PdfGlyph(Glyph);
impl krilla::text::Glyph for PdfGlyph {
#[inline(always)]
fn glyph_id(&self) -> GlyphId {
GlyphId::new(self.0.id as u32)
}
View on GitHub (pinned to 35417aa769)
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/typst-pdf/src/text.rs:97 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of typst/typst@35417aa769 (2026-08-17).
Data as JSON: /api/errors/cca6787b4f14ced3.
Report an issue: GitHub.