Repository navigation
v0.8.1
Forme 0.8.1
Patch release fixing three bugs reported after 0.8.0 shipped.
Bug Fixes
Latin Extended character widths
Characters like Å, Ä, Ö, Ü, ß, and other Latin Extended glyphs (U+00C0–U+00FF) had incorrect advance widths in all eight standard font width tables (Helvetica, Times, and their variants). The tables used PDF Standard Encoding glyph order for positions 160–255, but the engine indexes them using WinAnsi — two different encodings that assign different glyphs to the same code points in that range. The result was characters stacking on top of each other instead of spacing correctly.
All eight width tables have been regenerated from Adobe AFM data with correct WinAnsi ordering. Characters now render with the correct advance width.
Affects: Swedish (Å, Ä, Ö), German (Ü, ö, ü, ß), French (É, È, Ê, À, Ô), Spanish (Ñ, ¿, ¡), and other Latin Extended scripts using standard fonts.
Page number placeholder sizing
{{pageNumber}} and {{totalPages}} were measured as 14–16 character literal strings during layout, then replaced with short values like "1" or "3" during PDF generation. This caused text width mismatches in flex rows and footers — the layout reserved space for a 16-character string but rendered a 1-character number, leaving large unexpected gaps.
The fix replaces placeholders with single atomic sentinel characters before line breaking. Sentinels can't be split across lines, measure at the correct display width, and are replaced with real values at render time. The PDF serializer finds the sentinels reliably in every case.
Two-pass digit-accurate page number sizing
Building on the sentinel fix: the engine now verifies after the first layout pass that the estimated placeholder width matches the actual page count digit count. If not, it re-layouts with the correct width:
- 1–9 pages: re-layout with
"0"width (1 digit) - 10–99 pages: no re-layout needed — the default
"00"estimate is correct - 100–999 pages: re-layout with
"000"width (3 digits)
The common case (10–99 pages) has zero overhead — a single integer comparison. Documents outside that range get one additional layout pass. Maximum 3 total passes with an oscillation guard.
Performance: a 4-page document (which triggers a re-layout pass) renders in 18.7ms in release mode.
Upgrading
npm install @formepdf/react@0.8.1 @formepdf/core@0.8.1No breaking changes. Drop-in upgrade from 0.8.0.