Give an Arabic joining form's plain context rule no backtrack or lookahead (#189) - #215
Merged
Merged
Conversation
…ahead (#189) A Type 5 rule has an input sequence and nothing else, but where it belonged to an Arabic joining form and was Format 1 or 2 the parser handed the shaper $backtrackGlyphs and $lookaheadGlyphs for its prel and postl. Type 5 never sets either, so the rule got the sequences of the last chained rule read for the script, and Shaper\Arabic gave the form only where the text also held that unrelated rule's context. Format 3 already gave both empty. The 5.1 and 5.2 calls no longer pass contextRule() those sequences, which was the only use of its $arabic parameter, so the parameter goes and the entry an Arabic form's rule becomes reads the rule's own backtrack and lookahead. Every branch of the walk that reads the two variables now sets them first, so their initialisation goes too. No font in tests/data/ttf reaches this, and regenerating every golden master from cold moves none of them. NotoSansArabic-GSUB5Form-Synthetic makes it visible: it is NotoSansArabic-Joining-Subset (Noto Sans Arabic 2.012, OFL 1.1) with its GSUB replaced, in fontTools 4.59.2, by a 'fina' Type 6 Format 3 giving beh its dotless final form after beh and before low alef, then an 'init' Type 5 Format 1 and a 'medi' Type 5 Format 2 giving the dotless initial and medial forms, and name IDs 1, 4 and 6 renamed. Before, both Type 5 rules asked for beh before and low alef after, so beh beh drew no initial form and beh beh beh low-alef no initial or medial one. hb-shape 14.3.1 draws both forms, as mPDF now does, and the font's shaping master draws the initial form before the tatweel. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Type 6 Format 1 was the last branch holding its backtrack and lookahead in walk-wide variables it did not need, the shape #189 came from; the other chained branches take theirs from coverageSequences() or classSequences(). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Closes #189.
This carries PR #196's change to
gravitypdf. #196 was merged into its stacked base branch after that branch had already been squash-merged intogravitypdf, so its commits never reachedgravitypdfand #189 stayed open. The commits are #196's own, replayed withgit rebase --ontoand patch-for-patch identical pergit range-diff. See #196 for the full description, measurements and review.🤖 Generated with Claude Code