Bug 395233

Summary: Truncated display of combining characters (decomposed text)
Product: [Applications] konsole Reporter: Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: normal CC: mglb, ninjalj
Priority: NOR    
Version First Reported In: master   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In: v21.08.0
Sentry Crash Report:
Attachments: Script printing some combining characters
Display with Konsole 18.04
Display with Konsole master branch

Description Arfrever Frehtes Taifersar Arahesis 2018-06-11 06:02:19 UTC
Created attachment 113212 [details]
Script printing some combining characters

In Konsole 18.04.* (including last release 18.04.2), some combining characters are displayed in slightly wrong position, but they are not truncated, so they are still readable.

In Konsole master branch, some combining characters are truncated and unreadable.


This is regression from state after fix for bug #96536.


I attach a script which prints example text with combining characters.
Comment 1 Arfrever Frehtes Taifersar Arahesis 2018-06-11 06:07:48 UTC
Created attachment 113213 [details]
Display with Konsole 18.04

This image shows not truncated display with Konsole 18.04.

E.g. for U+0361 (COMBINING DOUBLE INVERTED BREVE), the fully correct display would be as above first "kp" in this image from Wikipedia:
https://en.wikipedia.org/wiki/File:Character_tie.svg
(See also https://en.wikipedia.org/wiki/Tie_(typography) article.)
Comment 2 Arfrever Frehtes Taifersar Arahesis 2018-06-11 06:09:11 UTC
Created attachment 113214 [details]
Display with Konsole master branch

This image shows truncated display with Konsole master branch.
Comment 3 Christoph Feck 2018-06-27 22:58:57 UTC
Regression probably caused by https://cgit.kde.org/konsole.git/commit/?id=a565bc97337a3bfc3a027f46aa2dec3e9a6f8618
Comment 4 Mariusz Glebocki 2018-06-28 02:15:35 UTC
(In reply to Christoph Feck from comment #3)
> Regression probably caused by
> https://cgit.kde.org/konsole.git/commit/
> ?id=a565bc97337a3bfc3a027f46aa2dec3e9a6f8618

Correct.

The code renders combining characters with a previous character (as it should be), but due to a Qt bug combining characters appear above next character.
I'll look if it is possible to do some workaround for shifted combining characters. If not, rendering character on the right with combining characters will fix the bug.
Comment 5 Mariusz Glebocki 2018-07-11 04:33:46 UTC
I've made a partial fix, but it turns out the Qt bug is worse than I thought. Some combining characters (e.g. 0x0332-0x0338) are treated as regular characters. This causes (without current functionality which cuts them off) wrong position detection and rendering problems.

If I'll not find anything better, I'll filter out those problematic combining characters.