Skip to content

Add Virama conjunct for the Brahmic scripts#204

Merged
jquast merged 14 commits intomasterfrom
jq/conjuct-formation
Jan 31, 2026
Merged

Add Virama conjunct for the Brahmic scripts#204
jquast merged 14 commits intomasterfrom
jq/conjuct-formation

Conversation

@jquast
Copy link
Owner

@jquast jquast commented Jan 30, 2026

Brahmic script has conjuncts that "collapse" to cell width, Closes #155

(From specs.rst)

Virama Conjunct Formation

In Brahmic scripts, a Virama (Indic_Syllabic_Category=Virama in
IndicSyllabicCategory.txt) between two consonants triggers conjunct
formation: the font engine merges the consonants into a single ligature glyph.

  • A Consonant immediately following a Virama contributes 0 width.

  • The conjunct still occupies cells — the next visible advance settles it:

    • A following Mc (Spacing Combining Mark_, e.g. a vowel sign) counts as
      1 cell and closes the conjunct — no extra cell is added.
    • A following wide character (or end of string) adds 1 cell for the conjunct
      before counting its own width.
  • Chains work the same way: C + virama + C + virama + C collapses each
    virama+consonant pair.

  • Mn marks do not break conjunct context within the same aksara_.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 30, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing jq/conjuct-formation (f113ee7) with master (38d03a5)

Summary

✅ 60 untouched benchmarks
🆕 4 new benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 test_width_brahmic_bengali N/A 2.3 ms N/A
🆕 test_width_brahmic_devanagari N/A 2.8 ms N/A
🆕 test_wcswidth_brahmic_devanagari N/A 2.6 ms N/A
🆕 test_wcswidth_brahmic_bengali N/A 2.1 ms N/A

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (38d03a5) to head (f113ee7).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #204   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines          938       986   +48     
  Branches       239       247    +8     
=========================================
+ Hits           938       986   +48     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jquast jquast marked this pull request as ready for review January 30, 2026 02:41
@jquast
Copy link
Owner Author

jquast commented Jan 30, 2026

I wasn't certain and made some errors along the way, but I integrated with latest master branch of ghostty through ucs-detect, and, they now match 100% for all language tests in the next ucs-detect release with this branch. I can't read these languages to know whether it is legible, but I can tell you that this matches ghostty behavior exactly, and probably also kitty and others, to be tested soon

@jquast jquast merged commit 84a7248 into master Jan 31, 2026
43 checks passed
@jquast jquast deleted the jq/conjuct-formation branch January 31, 2026 03:31
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.

Should Combining characters of Category 'Mc' be width 1?

1 participant

Comments