Skip to content

Shape Tai Tham sakot after vowel signs without a dotted circle - #431

Merged
blikblum merged 1 commit into
foliojs:masterfrom
iliev-blnk:tai-tham-sakot
Oct 28, 2026
Merged

blikblum merged 1 commit into
foliojs:masterfrom
iliev-blnk:tai-tham-sakot

Conversation

@iliev-blnk

Copy link
Copy Markdown
Contributor

Cause

In Tai Tham, a sakot (U+1A60) and the consonant after it can come after vowel signs, for example ᨩᩢ᩠ᨿ (U+1A29 U+1A62 U+1A60 U+1A3F). fontkit shapes these words with a dotted circle before the stacked consonant:

SHLANA-1/39  ᨩᩢ᩠ᨿ
  expected  uni1A29 uni1A62 uni1A601A3F
  master    uni1A29 uni1A62 uni25CC uni1A601A3F

gen-use.js classifies the sakot as H (Indic syllabic category Invisible_Stacker). In use.machine, H B is only allowed in the consonant modifiers, before the vowel signs. A sakot after a vowel sign starts a new syllable, which matches broken_cluster and gets a dotted circle.

Fix

This follows HarfBuzz, which splits the sakot off of the halant into its own Sk category:

  • Sk is U+1A60, so it's no longer a halant for reordering (HarfBuzz's is_halant_use doesn't include it either).
  • Sk B is allowed wherever H B is, and also as (Sk B)* after the vowel modifiers.
  • A syllable can end in a sakot after its vowel signs (sakot_terminated_cluster), which gets the same reordering as the other cluster types.

The generated files are gitignored, so the diff is only the generator, the grammar and the shaper.

Across the 281 non-MORT/MORX cases of text-rendering-tests, this PR goes from 164 to 192 passing. The 28 fixed cases are all SHLANA, and no other results change. HarfBuzz 15.0.0 also passes 192. The MORT/MORX results are the same as master.

Tests

  • test/shaping.js: a new "shapes tai tham text" block with SHLANA-1/39, 2/11, 2/37, 6/3 and 7/8, plus two HarfBuzz cases: a sakot at the end of a syllable, and a lone vowel sign with a sakot, which still gets its dotted circle. Six of the seven fail on master. The output of all seven matches HarfBuzz glyph for glyph.
  • The test font is TestShapeLana.ttf from text-rendering-tests, added to test/data/fonttest/ under the Apache License 2.0 in test/data/fonttest/LICENSE.txt.
  • npm test: 710 passing. npm run format:check passes.

This is independent of #428, #429 and #430.

U+1A60 TAI THAM SIGN SAKOT was classified as a halant, which the USE
grammar only allows before vowel signs. In Tai Tham the sakot and its
consonant can also follow vowel signs and vowel modifiers, so words
like ᨩᩢ᩠ᨿ became broken clusters and got a dotted circle.

Split the sakot off of H into its own Sk category and allow (Sk B)*
after the vowel modifiers and a sakot-terminated cluster, as HarfBuzz
does.
@blikblum
blikblum merged commit f4c2243 into foliojs:master Oct 28, 2026
3 checks passed
@iliev-blnk
iliev-blnk deleted the tai-tham-sakot branch October 28, 2026 19:02
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.

2 participants