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 9a0def8
Browse filesBrowse the repository at this point in the historyBrowse files
Reland "[skparagraph] Render visible hyphen at soft hyphen (U+00AD) line breaks"
This is a reland of commit cc0c72c
The original CL was reverted because soft hyphen tests failed on
Ubuntu-NativeFonts bots. The fix: use ResourceFontCollection(true)
(test fonts only) instead of ResourceFontCollection() (which falls
back to native fonts with different metrics).
Original change's description:
> When text is laid out and a line break occurs at a soft hyphen
> (U+00AD) position, a visible hyphen glyph ("-") is now shaped
> and appended to the end of that line. Soft hyphens that are not
> at line break positions remain invisible (zero-width), as before.
>
> This behavior is gated behind ParagraphStyle::setRenderSoftHyphens(),
> which defaults to false to preserve existing behavior for current
> consumers. Callers must opt in to enable visible hyphen rendering.
>
> The implementation follows the existing ellipsis pattern:
> - Added Cluster::isSoftHyphen() to detect U+00AD clusters
> - Added TextLine::fHyphen (parallel to fEllipsis) to store the
> shaped hyphen Run
> - TextLine::createSoftHyphen() reuses shapeEllipsis() to shape
> a "-" character with the correct font/style from the last cluster
> - The hyphen is included in line width calculation and visual
> run iteration for both LTR and RTL text
> - Ellipsis takes precedence over soft hyphen when both apply
>
> This addresses Flutter issue:
> flutter/flutter#18443
Change-Id: I04d20838985bf32710bd5045dbcd891fe0922016
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1202938
Reviewed-by: Julia Lavrova <[email protected]>
Reviewed-by: Kaylee Lubick <[email protected]>
Commit-Queue: Julia Lavrova <[email protected]>
0 commit comments