Skip to content
Lamina PDF
Unreleased

These docs describe changes that aren’t released yet. For the newest release, see the released docs.

font-not-shapable

All codes

  • Type: error
  • Kind: unsupported (valid input that Lamina PDF doesn’t implement)

What happened

A standard 14 font (Font::standard) was given to the shaper, itemize, break_lines or pdf_run.

Why

The standard 14 fonts are referred to by name and never embedded. Lamina PDF has their metrics (Adobe’s AFM files) but no font program, so there is nothing for HarfRust to shape with and no cmap for itemizing. Nor are there CIDs for a shaped run: a standard 14 font is written as a simple font with one-byte codes.

How to fix

Draw standard 14 text with FontRegistry::encode (one glyph per character, kerning not applied), or load a real font with Font::from_bytes and shape with it.

Example

let helvetica = Font::standard(Standard14::Helvetica);
shaper.shape(&helvetica, "Hello", &options)?; // font-not-shapable

Data fields

  • font: the standard font’s PostScript name (fixed text: one of the fourteen).