Skip to content

Apply dx and dy in logical order in right-to-left text - #1145

Open
teolines wants to merge 1 commit into
linebender:mainfrom
teolines:fix-rtl-relative-shift
Open

teolines wants to merge 1 commit into
linebender:mainfrom
teolines:fix-rtl-relative-shift

Conversation

@teolines

Copy link
Copy Markdown

Right-to-left text with dy shifts collapsed onto one line. The shifts are now applied in logical order instead of screen order.

Fixes #1093

LLM Contributions: investigation, implementation and tests with Claude Code, reviewed by me. The description is my own, edited for grammar.

`dx` and `dy` shift a character and every character after it in logical
order, but the shifts were accumulated while positioning the clusters in
visual order. In right-to-left text, the first character is the last
cluster, so a `dy` on a `tspan` only moved its first character, and a
multi-line text collapsed onto its first line.

Accumulate the shifts in logical order before positioning the clusters.
Left-to-right text is unchanged.

Fixes linebender#1093
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RTL text with multi-line <tspan dy> layout collapses onto one line (usvg 0.47.0)

1 participant