[konsole] [Bug 401094] Malayalam rendering regression in Konsole 18.08

Rajeesh K V bugzilla_noreply at kde.org
Wed Dec 18 04:32:20 GMT 2019


https://bugs.kde.org/show_bug.cgi?id=401094

--- Comment #12 from Rajeesh K V <rajeeshknambiar at gmail.com> ---
(In reply to Mariusz Glebocki from comment #11)

> 
> I've attached a patch which renders provided example almost as intended.
> Each word is rendered separately and spacing is wrong, but it can be fixed
> later. Apply with `patch -p1 < malayalam-rendering-poc.patch` in top level
> Konsole directory.

Applied the patch over konsole-19.12.0 source and tested the rendering.
Comparing with rendering of 18.08, there is improvement (see attached
screenshot), but not fully fixed.

> 
> However, I'm not sure how to integrate it into Konsole. This is technically
> a hack. Terminal programs are unable to get the width of a conjunct, and
> they don't know which characters are part of a conjunct. This leads to text
> being shifted/glitched during selection, conjuncts being "broken" when a
> program (e.g. vim) places cursor on part of a conjunct, invalid line
> wrapping, etc. This behavior can't be enabled by default. Possible solutions:

Indeed, console programs such as vim (even gvim) do have difficulty with cursor
positioning since the beginning of epoch. A notable exception is Emacs, which
handles (shapes and edits) complex scripts (such as Indic scripts where
Malayalam belongs) very well. And Konsole ≤ 17.12 had very good support for
shaping & rendering Indic scripts (see attachment in comment #1).

> 
> * Add an option for enabling the feature. I'm against this. It will be
> broken eventually, because many developers won't test yet another rendering
> mode. Also: hack.

Not only Malayalam (the patch checks for Unicode range 0D00–0D7F) but all
complex scripts including dozens of Indic scripts, Sinhala, South/East Asian
scripts etc. all would need similar support.

> 
> * Rename "Bi-directional text rendering" option to something like "Support
> for complex scripts" and enable special rendering for complex scripts like
> Malayalam when it is enabled. RTL scripts already have the same problems, so
> users wouldn't be suprised. This solution has the same issues as previous
> one, but it's already there.

Agree, this would be a better option.


> 
> It also would be nice to improve it further, but help from people who
> actually use complex scripts is needed. Useful input would include:

Happy to help.

> * Are there some fixed-width fonts for the script?

There are no fixed-width fonts for Indic scripts, to my knowledge.

> * Is there another terminal which handles it well?

Historically, only Konsole ≤ 17.12 handled Indic scripts well. GNOME Terminal
and other terminals never properly rendered those. Also, Emacs shapes and
renders complex scripts very well, but to my knowledge it uses a different
library.

> * Is there some simplified/alternative way to display the script?

Not sure I understand the question, could you elaborate?
If you only want to check the shaping/rendering, the 'hb-view' tool from
harfbuzz would be the best option. You can test the shaping of a text using
following command:

$ hb-view --font-file=/path/to/font.ttf -o /path/to/test.png "text-to-shape" &&
xdg-open /tmp/test.png

You may download the font
https://smc.org.in/downloads/fonts/meera/Meera-Regular.ttf to test. This font
is also available in Fedora/Debian/Ubuntu.


> * Are there (console) programs which actually use the script? What are
> real-world use cases?

Just like Latin scripts, complex scripts are used by millions of people on a
daily basis.

> * Code! :)

I did try to go through the code and get me head around those, but the terminal
code is very complex. Will try to keep at it and seek your help to make
progress.

But, if already experienced konsole developers could compare with Konsole 17.12
and the current code, I hope it could save a lot of time.

Thanks for your efforts!

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list