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 fcf3a18
Browse filesBrowse the repository at this point in the historyBrowse files
[skparagraph] Use surrounding run's bidi level in shapeEllipsis
shapeEllipsis passed SkBidiIterator::kLTR to its internal
BidiRunIterator regardless of the surrounding paragraph's direction,
so in RTL text the affix's neutral and weak characters resolved LTR.
For the default "-" and "…" this only gives the shaped run the wrong
bidi level; the glyphs are the same. But a custom ellipsis that mixes
RTL letters with a neutral, such as "النهاية!", is split into two
bidi runs (the "!" resolves LTR), and ShapeHandler supports only one:
debug builds fail SkASSERT(!fRun), and release builds keep only the
last run.
The fix uses the bidi level of the surrounding cluster's run, which
is already in scope via the existing 'cluster' parameter. Both call
sites (createEllipsis, createSoftHyphen) pass the cluster adjacent
to the break, so the affix inherits the correct direction at the
shaping boundary.
This also unblocks a follow-up that exposes a configurable soft
hyphen string, and addresses reviewer feedback on the Flutter design
doc for flutter/flutter#18443.
Tests:
- SkParagraph_SoftHyphenRTLBidiLevel / SoftHyphenLTRBidiLevel assert
the shaped hyphen run's bidi level matches the paragraph context.
- SkParagraph_EllipsisRTLCustomStringBidiLevel uses "النهاية!" as a
custom ellipsis in an RTL paragraph (hits the SkASSERT without
this change).
- SkParagraph_EllipsisLTRDefaultBidiLevel guards the common LTR
path against regression.
GM:
- paragraph_ellipsis_bidi adds Skia Gold visual coverage across
LTR/RTL x default/custom affix combinations.
[email protected], [email protected]
Change-Id: Id51f71e4506272662a95baae197bca808d27e7d1
Bug: flutter/flutter#189617
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1217709
Reviewed-by: Julia Lavrova <[email protected]>
Auto-Submit: David H Bebawy <[email protected]>
Commit-Queue: Alexis Cruz-Ayala <[email protected]>
Reviewed-by: Alexis Cruz-Ayala <[email protected]>
0 commit comments