Files
docx/docs/usage
Dolan 3061519334 feat(layout): measure italic and bold italic text with Word's widths of the fonts' italics, as Word draws them (#3633)
* feat(layout): measure italic and bold italic text with Word's widths of the fonts' italics, as Word draws them

Generate italic and bold italic width tables from the open fonts' italics,
checked against Word's PDF of a new probe, word-italic-widths, that has every
character of the tables in italic and bold italic in the five fonts. Read
w:iCs, and lay out right-to-left and complex-script runs in their own
italics, as their boldness. Read each character's word in Word's PDFs only
as the pieces that follow on from its code point, so characters drawn with
boxes off their line aren't counted in another's width.

* test(layout): compare where docx/layout breaks the lines of the character width probes with where Word breaks them

word-character-widths.py --json now also reads where each line of W
starts, and word-character-widths-layout.ts lays the same paragraphs out
with docx/layout and compares. 839 of 851 italic paragraphs and 849 of
864 upright ones break where Word breaks them.

* test(layout): count a word broken across lines on the line it starts on, as the reader does

A line with only the end of a broken word starts no code point or word, so
it has no marker, and the reader records nothing for it either.
2026-10-02 03:34:00 +01:00
..