Repository navigation
Take the morx end-of-text transition (#144, #147, #151) - #434
Merged
Merged
Conversation
…#142, foliojs#143) Skip a rearrangement verb when nothing has been marked yet or when the marked range is shorter than the glyphs the verb moves, like CoreText and HarfBuzz. Clamp the end of the range at the end of the text.
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.
Fixes #144, fixes #147, fixes #151
Cause
AATStateMachine.processlooks up the entry for the end-of-text class and moves to its new state, but never passes the entry to the subtable. So the actions a font puts on its end-of-text transitions are dropped:Fix
The state machine now passes the end-of-text entry to the subtable with a
nullglyph, and still never stays at the end of the text, whatever DontAdvance says. Each subtable then follows HarfBuzz, which matches CoreText here:ABABABA B A B A BA B A B B AA B A B B ABABBAABXB A B B A A B XB A B B A X A BB A B B A X A BABA BB AB AABCDEA B C D EA B C.alt D E.alt1A B C.alt D E.alt1AEA EA.alt E.alt1A.alt E.alt1Across all 174 MORT/MORX cases of text-rendering-tests, this goes from 131 to 139 passing on top of #433: MORX-10, MORX-11, MORX-17 and the five failing MORX-20 cases. No other results change.
This builds on #433, because the rearrangement cases need its MarkLast clamp. Only the last commit is new here.
Tests
test/issues.js: MORX-10, MORX-11, MORX-17 and all seven MORX-20 inputs. All three tests fail without the fix.TestMORXTen.ttf,TestMORXEleven.ttf,TestMORXSeventeen.ttfandTestMORXTwenty.ttffrom text-rendering-tests, added totest/data/fonttest/under the Apache License 2.0 intest/data/fonttest/LICENSE.txt.npm test: 715 passing.npm run format:checkpasses.