19 lines
2.2 KiB
Org Mode
19 lines
2.2 KiB
Org Mode
---
|
|
title: Indic ligatures in terminal emulators
|
|
author: natto
|
|
tags: terminals, indic
|
|
---
|
|
* Preface
|
|
I have been using the [[https://st.suckless.org/][simple terminal]], or =st=, by [[suckless.org]], for almost two years now, and it has been great. Unfortunately it has fixed width unicode support and hence hindi ligatures cannot be rendered properly. There is a [[https://st.suckless.org/patches/ligatures/][ligatures patch]] available but all it does it combine fixed width LTR ligatures. So I spent the last 8 hours or so looking for a way to implement it. Here is what I learnt.
|
|
|
|
* The problem
|
|
The only problem with rendering indic fonts on terminal is that they cannot be monospace and has have variable widths, which are much harder to implement than one realises. The ligature combining stuff can be done using =harfbuzz=, =pango=, =fribidi= / =ubidi(ICU)= or their combination without any problem. The problem is the varying widths and how the terminal is supposed to be a grid of rows and =$COLUMNS=. Also I need perfect input for indic languages with =fcitx4= (I use m17n methods just for the context). These problems have haunted me for months now, and I finally decided to confront them.
|
|
|
|
* The candidates
|
|
- [[https://github.com/arakiken/mlterm][mlterm]] promises to solve these issues but its primary focus is arabic languages from what I understand, and Indic languages are not rendered correctly.
|
|
- [[https://github.com/KDE/konsole][konsole]] by =KDE= solves the rendering stuff beautifully, however it has problem with inputting =halant= and the following character. Another problem it has is incorrect cursor rendering position when inputting. However it is good enough for displaying Indic text in terminal.
|
|
- [[https://github.com/emacs-mirror/emacs/][Emacs eshell]] is perfect when it comes to rendering, inputting and navigating the text with not just indic languages but many other languages as well, however it requires =GNU Emacs= as its elisp interpreter whose primary function is not a terminal emulator.
|
|
|
|
* The compromise
|
|
I wil use Emacs for any Indic language related stuff and st for everything else, but I guess that is fine since English is the lingua franca when it comes to computers.
|