mirror of
https://github.com/penpot/penpot.git
synced 2026-11-05 01:20:38 +00:00
SkParagraph moves each line right by half the letter-spacing of its first character. That centres span tracking, but the spacing added to single characters (distribution and justification gaps, squeezing, compression and ruby room) must only open the gap after them. A distributed label of two characters started half a gap in and overflowed the box by as much: "国家" in a 200px box drew 国 92px from the left edge. Builders of horizontal text record how far each adjusted character's letter-spacing departs from its span tracking, and `LayoutParagraph` takes back half of that on each line, next to its baseline shifts: painting, glyph and placeholder rects, line metrics, hit testing and text paths. Span tracking keeps its half spacing before the line. AI-assisted-by: claude-opus-5-5