Skip to content

Do not justify the last line in a paragraph

In SVG 2.0 text, the manual breaks are not split between spans. So the check for manual breaks must be done when adding the justification to a line.

Because the code was already checking for end of span and single word conditions, justification of a line could happen seemingly at random if the last line in a paragraph ended up only containing one word. And change in the text would see the line's justification flip back and forth depending on how many words were on that final line.

This change shouldn't effect SVG 1.1 text since their manual breaks are encoded in separate spans and we still check for this condition.

Fixes #1661 (closed)

Before:

before

After:

after

Merge request reports