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 d13c86b
Browse filesBrowse the repository at this point in the historyBrowse files
[skparagraph] Count the hyphen in min intrinsic width at soft hyphens
A word that ends at a soft hyphen is drawn with a hyphen when the line
breaks there, but the min intrinsic width left the hyphen out. Laid out
at its min intrinsic width, "xy abcd\u00ADef" broke as "xy" / "abcd-" /
"ef" and the second line overflowed by the hyphen's width.
TextWrapper::lookAhead now adds the hyphen string's width to such a
word, both where words end normally and for a word too long for the
line, so the result doesn't depend on the layout width. This matches
CSS min-content in Chrome, where "abcd\u00ADefgh" is as wide as
"abcd-". A soft hyphen that ends the text adds nothing, since no
hyphen is drawn there. Lines that may get an ellipsis still reserve no
room for the hyphen while breaking, but their words now count it in
the min intrinsic width too.
The hyphen is measured in the soft hyphen's font when that font has
glyphs for the hyphen string, and otherwise shaped with font fallback
the same way it is drawn (TextLine::ShapeString, factored out of
shapeEllipsis). The too-long-word measurement includes the soft break
cluster's own width, which letter spacing makes non-zero, and records
the hyphenated word's width even when the word fits on a line. The
scan of the text after maxLines now ends words at soft breaks as well
as at spaces, so truncated text without spaces, such as CJK, also gets
the min intrinsic width of its longest word rather than of the whole
remainder.
[email protected], [email protected]
Bug: flutter/flutter#194582
Change-Id: I2aff91fdd7db647d5c81b9296fe8521449497724
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1398738
Reviewed-by: Julia Lavrova <[email protected]>
Commit-Queue: Julia Lavrova <[email protected]>
Reviewed-by: Alexis Cruz-Ayala <[email protected]>
Auto-Submit: David H Bebawy <[email protected]>
0 commit comments