Skip to content

v0.6.2

Choose a tag to compare

@danmolitor danmolitor released this 06 Mar 18:33
· 685 commits to main since this release

Justified Text (PDF Tw operator)

  • Implemented proper word spacing for textAlign: 'justify' using the PDF Tw operator, computed from natural glyph advances rather than Knuth-Plass adjusted positions.

Line Breaking Modes

  • Added lineBreaking style property ('optimal' | 'greedy') with inheritance, letting users choose between Knuth-Plass optimal and simple greedy algorithms.

Font Weight Fallback Fix

  • Bold text (weight 700) now falls back to weight 400 when a custom font is only registered at 400, instead of skipping to Helvetica. Fixes Arabic/CJK "tofu" (missing glyph boxes) in headings.

Text Alignment Fix

  • Right/center alignment now uses actual rendered glyph width instead of the line breaker's overestimated width, fixing misalignment.

Per-Character Width Fix

  • Font fallback measure_chars now uses per-character hmtx widths instead of full-text shaping, preventing line overflow from shaping context mismatch.

Shaping Cluster Fix

  • Rustybuzz byte-offset cluster values are now correctly converted to char indices, fixing multi-byte character (Arabic, CJK) cluster lookups.

PDF Standard Font /Widths

  • Standard fonts (Helvetica, Times, Courier) now emit /Widths arrays in PDF, ensuring viewers use exact glyph metrics.

Minor

  • Chart legend items shrunk with flex-wrap for the grid dashboard template
  • CI fix: Arabic font fallback test skips gracefully on Linux (no macOS system fonts)