mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-30 21:37:41 -06:00
Character scale (`w:w`, Format > Font > Advanced > Scale) widens or
narrows the letters themselves. WordCraft multiplied the advances but
drew each glyph at its natural width, so text at 200 % looked letter-
spaced (pdftotext even split it into words) and text at 50 % overlapped.
- layout: `Draw::Glyphs` carries `x_scale` (1 = 100 %), the run's scale
for its text and its line-end hyphen (whose advance is scaled too);
list labels, tab leaders, ruby, equations and shape text keep 1.
- pdf: a scaled run is drawn under a horizontal scale from its first pen
position, the positions brought back so each glyph lands where the
layout put it; the text and its extraction are unchanged.
- render: each glyph's outline is stretched across from its pen
position.
Checked against Word for Microsoft 365, "HIHIH" in Arial 20 pt
(Liberation Sans here), right end of the word (pdftotext) and ink:
200 % Word 179.78, ink 73.92..176.52; before: split in three words,
ink to 163.68; after 179.74, ink 74.04..176.52
150 % Word 152.19; after 152.52
50 % Word 97.76; after 98.07
100 % unchanged
Test: in the PDF, letters at 200 % are drawn twice as wide and as high,
at pen positions twice as far apart; at 100 % unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>