Repository navigation
Read right-to-left /ActualText spans in reading order - #97
Merged
Merged
Conversation
Upstream's ArabicActualTextOrdering (64df52a) writes بِسْمِ as one /ActualText span per letter, in four orders; the fork read none of them as typed. Two causes: - CloseTempLine() passed a right-to-left segment that starts with a span forward whole, so spans drawn in visual order came out in visual order. A segment now reverses unit by unit: a span is one unit, kept as written, and every other character is its own. No span is reversed ahead of time any more (this replaces S8's FollowsLiteralRightToLeftText). - A mark drawn above or below its letter started a new line. A line's reference glyph is now its last one that isn't a mark, and a mark joins a line within a font size of it. All four variants read بِسْمِ. Chrome wraps each Arabic glyph in a one-letter span, so in its output every Arabic line now reads as typed; Acrobat's and Pages' output is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream's
ArabicActualTextOrdering(64df52afe) writes بِسْمِ as one/ActualTextspan per letter, in four orders. The fork read none of them as typed. Two causes:CloseTempLine()passed a right-to-left segment that starts with a span forward whole, so spans drawn in visual order came out in visual order. A segment now reverses unit by unit: a span is one unit, kept as written, and every other character is its own. No span is reversed ahead of time any more (this replaces S8'sFollowsLiteralRightToLeftText).DrawsOnlyMarks()).Results
/ActualTextand draws them in visual order. Every Arabic line of our Proton (Chrome) fixture now reads as typed; before, whole words came out reversed (ابحرمfor مرحبا)./ActualTextis mirrored once too often (the pairs are now in place); marks drawn without/ActualTextstill break lines.Tests (darwin-arm64)
ActualTextRtl,ActualTextReadsAsWrittenand the rich-text RTL round trips pass unchanged.