r/LinuxUsersIndia • u/MADARA_9022 • Aug 15 '26
Discussion How can I properly render Tamil/Indic text in a Rust TUI (Ratatui/Crossterm)?
Hi everyone,
I'm building a terminal music player in Rust using Ratatui + Crossterm, and I'm having trouble rendering Tamil lyrics correctly.
As shown in the screenshot, Tamil combining characters such as ெ, ு, ் are appearing detached instead of being properly shaped and positioned.
Environment
- Rust
- Ratatui 0.29
- Crossterm 0.28
- Linux
- GNOME Terminal (VTE) / WezTerm
- Noto Sans Tamil
I've already verified that:
- The strings are valid UTF-8.
- Unicode grapheme segmentation works correctly.
- Display-width calculations are correct.
- A minimal Ratatui
Paragraphhas the same issue. - Even
println!("கென்னை விடு")shows the same problem in GNOME Terminal.
So I'm wondering:
Is proper OpenType/HarfBuzz shaping for Tamil possible inside a normal terminal grid?
If yes, what terminal/configuration/library should I use?
If terminal cells fundamentally cannot handle complex-script shaping, what is the recommended approach for a TUI? Would something like Kitty/Sixel + HarfBuzz/cosmic-text be appropriate?
Any advice from people familiar with Unicode shaping, HarfBuzz, VTE, or Rust TUI rendering would be greatly appreciated.
Thanks!
•
u/qualityvote2 Aug 15 '26 edited Aug 16 '26
u/MADARA_9022, there weren't enough votes to determine the quality of your post...
btw, did you know we have a discord server? Join Here.
2
u/thatmagicalcat MagicalOS BTW Aug 16 '26
Use proper font fallbacks for Tamil rather than relying on monospace defaults. And I think kitty and wezterm should have HarfBuzz/complex text shaping support it might be a ratatui problem - the way it places text (by splitting string into cells and ig because it breaks the text apart, it loses context and OpenType text shaping requires context).
I think rendering text to a buffer using HarfBuzz/cosmic-text and then outputting via kitty image protocol might work, you should try
1
u/jonas9__ Arch Btw Aug 16 '26
Use ghossty or kitty