mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
SVG export wrote each style run of a line of live text as one <tspan> and positioned the text again only after tabs and, on justified lines, after word spaces. A viewer then spaced the characters inside the <tspan> with the font's own advances, so it lost the letter gaps of a Justify All line without word spaces, the gaps between the characters of a justified Japanese line and the spacing that a Mojikumi Set changes. On justified lines, the textLength of horizontally scaled type also took in the justification space after it, so a viewer stretched the glyphs into that space. On a line that is justified or set with a Mojikumi Set, text_lines now lays the text out again as point type without the Mojikumi Set to get the advance a viewer gives each character. Each character that the layout draws away from where a viewer would draw it starts a new positioned <tspan>, and textLength and line anchors use the viewer's widths. The last character of a horizontally scaled <tspan> takes its width without the font's kerning against the next character. Other lines, and lines written with Fewer <tspan> Elements, are written as before. Docs: docs/target-app-parity.md.