Skip to content

Conversation

@JimBobSquarePants
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

This is a rework of #492 (thanks @Socolin) that introduces a Tracking property on TextOptions, allowing uniform adjustment of spacing between characters, measured in em units.

To support this correctly, fixes were required in SpanGraphemeEnumerator to handle Indic conjuncts involving virama correctly. Specifically, a GB9c-style special case was added so sequences such as consonant + virama + consonant are treated as a single grapheme cluster rather than being split into a “dead consonant” followed by a new grapheme. This ensures tracking is applied at the correct cluster boundary instead of being injected inside a shaping unit.

Additional fixes were required in vertical layout paths to ensure grapheme boundaries are respected consistently when applying tracking. This includes handling graphemes composed of multiple codepoints correctly in both vertical and vertical-mixed rendering modes, preventing incorrect splitting, misalignment, or over-accumulation when glyphs are rotated or laid out in vertical flow.

Example rendered layout is included in the reference tests.

@JimBobSquarePants JimBobSquarePants merged commit 5ff7825 into main Jan 21, 2026
25 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/add-tracking branch January 21, 2026 13:02
@Socolin
Copy link
Contributor

Socolin commented Jan 21, 2026

Looks good ! Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants