mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-13 22:21:59 +00:00
SVG 2 defines text-anchor start for right-to-left text as placing the right side of the text at its position, and end as placing the left side there (https://www.w3.org/TR/SVG2/text.html#TextAnchoringProperties). Import placed start at the left edge and end at the right edge whatever the direction. - Point type and type on a path swap start and end when the effective direction is rtl. On a path, right-to-left text anchored by start now ends at startOffset and text anchored by end begins there. Vertical type keeps its anchoring. - Each line and each absolutely placed chunk is anchored by the text-anchor and direction of the element holding its first character, a tspan's own included. A later chunk no longer takes the first chunk's anchor. - Each line of point type starts at its own x, also when it has the same anchor as the line before it or another line holds absolutely placed characters. Such lines were drawn at the first line's x. - A test covers letter-spaced right-to-left lines: the layout keeps the tracking of every letter in such a line, so the whole advance sits on its anchor.