[PR #756] [CLOSED] fix(utf8): correct Devanagari conjunct width from 2 to 1 #1540

Closed
opened 2026-03-14 09:42:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/756
Author: @simonklee
Created: 2/28/2026
Status: Closed

Base: mainHead: fix-devanagari-ligatures


📝 Commits (3)

  • cda25bc fix(utf8): correct Devanagari conjunct width from 2 to 1
  • 4a64c27 Merge branch 'main' into fix-devanagari-ligatures
  • a205a3c Merge branch 'main' into fix-devanagari-ligatures

📊 Changes

5 files changed (+127 additions, -49 deletions)

View changed files

📝 packages/core/src/zig/tests/edit-buffer_test.zig (+7 -4)
📝 packages/core/src/zig/tests/utf8_no_zwj_test.zig (+5 -5)
📝 packages/core/src/zig/tests/utf8_test.zig (+102 -19)
📝 packages/core/src/zig/text-buffer-iterators.zig (+5 -1)
📝 packages/core/src/zig/utf8.zig (+8 -20)

📄 Description

Devanagari conjuncts (e.g. क्त, ज्ञ) were reporting width 2 because Devanagari-specific code that added the second consonant's width after a virama. Terminals with font support render these as single-width ligatures.

The fix removes the Devanagari-specific width addition entirely. The existing "first base codepoint width wins" logic already does the right thing: the first consonant sets width=1, the virama contributes 0, and the second consonant (grouped into the same cluster by GB9c) is ignored because has_width is already true.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/756 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 2/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-devanagari-ligatures` --- ### 📝 Commits (3) - [`cda25bc`](https://github.com/anomalyco/opentui/commit/cda25bc9eeb986f245749ff7d2c13e53a27df40e) fix(utf8): correct Devanagari conjunct width from 2 to 1 - [`4a64c27`](https://github.com/anomalyco/opentui/commit/4a64c27feadab0f3e7baa1fdf0621cb7b420d129) Merge branch 'main' into fix-devanagari-ligatures - [`a205a3c`](https://github.com/anomalyco/opentui/commit/a205a3c650fe758b0ea6678bc73da15d63d82af1) Merge branch 'main' into fix-devanagari-ligatures ### 📊 Changes **5 files changed** (+127 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/zig/tests/edit-buffer_test.zig` (+7 -4) 📝 `packages/core/src/zig/tests/utf8_no_zwj_test.zig` (+5 -5) 📝 `packages/core/src/zig/tests/utf8_test.zig` (+102 -19) 📝 `packages/core/src/zig/text-buffer-iterators.zig` (+5 -1) 📝 `packages/core/src/zig/utf8.zig` (+8 -20) </details> ### 📄 Description Devanagari conjuncts (e.g. क्त, ज्ञ) were reporting width 2 because Devanagari-specific code that added the second consonant's width after a virama. Terminals with font support render these as single-width ligatures. The fix removes the Devanagari-specific width addition entirely. The existing "first base codepoint width wins" logic already does the right thing: the first consonant sets width=1, the virama contributes 0, and the second consonant (grouped into the same cluster by GB9c) is ignored because has_width is already true. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:42:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1540
No description provided.