You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ce0b85b
Browse filesBrowse the repository at this point in the historyBrowse files
[skparagraph] Leave room for the soft hyphen when justifying
A justified line that breaks at a soft hyphen spreads its text across
the whole paragraph width, and the rendered hyphen is then drawn after
the text, so it overflows the paragraph width by the hyphen's advance.
In an RTL paragraph, a justified line with no spaces is right aligned
instead, and its hyphen overflows the same way.
TextLine::justify now spreads the text over the paragraph width minus
the hyphen's advance, so the text and the hyphen together fill the
line.
It also skips soft hyphen clusters when it counts and spreads the
justification patches. They aren't rendered in the text run, but they
ended the patch after an ideograph and advanced prevShift, so a
justified line of ideographs that broke at a soft hyphen left a gap
before the hyphen, and an unbroken soft hyphen between two ideographs
doubled the gap after it. Leading clusters are now tracked from the
start instead of by index 0, so a leading soft hyphen doesn't open a
patch either, and neither do leading spaces before an ideograph.
For example, "xy abcdefgh" justified at width("xy abcd-") plus
15 in Roboto 20 drew the hyphen at [88.69, 94.21] on an 88.69 wide
line; it now ends at 88.69.
[email protected], [email protected]
Bug: flutter/flutter#194582
Change-Id: I8e97de2429ac3dd4e4e656dbd897bea1e9535963
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1406297
Reviewed-by: Julia Lavrova <[email protected]>
Auto-Submit: David H Bebawy <[email protected]>
Reviewed-by: Alexis Cruz-Ayala <[email protected]>
Commit-Queue: Julia Lavrova <[email protected]>
0 commit comments