Skip to content

Honour useMarkFilteringSet lookup flag during glyph iteration - #373

Open
lehni wants to merge 2 commits into
foliojs:masterfrom
lineto:fix/use-mark-filtering-set
Open

lehni wants to merge 2 commits into
foliojs:masterfrom
lineto:fix/use-mark-filtering-set

Conversation

@lehni

@lehni lehni commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Marks outside a lookup's filtering set must be skipped during iteration per the OT spec — useMarkFilteringSet overrides both ignoreMarks and markAttachmentType for marks. Without honouring it, contextual rules either fail to fire or fire on the wrong context, and mark-to-mark positioning attaches to the wrong candidate.

The lookup's filtering set is resolved lazily into a Set<glyphId> (cached per Coverage), threaded through GlyphIterator.reset, and checked in shouldIgnore before the legacy mark-skipping flags.

Test note

The added Mada test exercises an rclt chain whose backtrack also depends on #372 (chain-context backtrack matching order). This branch is therefore stacked on #372 and includes its commit; please merge #372 first, after which only this PR's own commit remains.

lehni added 2 commits October 18, 2026 17:41
- Backtrack arrays are stored in reverse buffer order per OT spec
- Reverse before matching so backtrack[0] aligns with position before input
- Skip marks not in the lookup's filtering set per OT spec
- Overrides ignoreMarks and markAttachmentType for marks
@lehni
lehni force-pushed the fix/use-mark-filtering-set branch from 154e1cc to efbf0a8 Compare October 18, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant