Files
wordcraft/crates/layout
Valentin KleinandClaude Opus 5.5 f6a6ded2cc Tests no longer depend on the installed fonts; PDF text of field results with ligatures (#261)
On a Linux machine with Carlito and Noto Naskh Arabic installed, four
layout and PDF tests failed on main:

- field_results_are_extractable_text found a real bug: a field result is
  laid out as one cluster, and the display list gave each of its glyphs one
  character. A ligature (Carlito, the Calibri substitute, joins "ti") took
  only its first letter and shifted the rest, so the PDF text read
  "Sectio  3.01 fir details3". The layout now keeps each glyph's text range
  from shaping, so a ligature carries all its letters. A new test pins this
  with bundled Source Sans 3 ("fi", "ffi"), whatever fonts are installed.
- fragmented_hidden_text_lays_out_like_the_visible_text compared visible
  text in alternating bold runs with an all-regular paragraph, so it only
  passed when the default font's bold happened to break lines the same.
  The plain paragraph now has the same bold runs.
- persian_letters_join_and_brackets_mirror counted glyphs, but Noto Naskh
  Arabic draws a dotted letter as two glyphs (the dotless form and the
  dot). It now compares letters by shaping cluster.
- glyph_runs_carry_their_text_for_pdf_export expected لا as one ligature
  glyph; Noto Naskh Arabic draws the lam and the alef separately. The
  ligature check now applies when the font forms the ligature.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 13:55:28 -04:00
..