Bug 421625 - UTF-8 unicode Yijing Hexagram Symbols
Summary: UTF-8 unicode Yijing Hexagram Symbols
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: 19.12.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-16 16:01 UTC by cmenser
Modified: 2024-04-02 19:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cmenser 2020-05-16 16:01:35 UTC
SUMMARY

Hexagram characters not only don't display correctly (they seem to be chopped in half), but they also seem to mess up the text entry direction (I think). 

This is not a which-font problem. It's more of a font rendering problem. I think for this particular group of unicode characters only. Other groups seem to render just fine.

STEPS TO REPRODUCE
1. in a konsole type touch 
2. copy any hexagram character from here:
http://www.alanwood.net/unicode/yijing_hexagram_symbols.html
3. paste to konsole
4. type ".txt" directly after the character (don't move cursor)
5. error reads:
touchtouch: command not found
 Lol wut?
ALTERNATIVE:
4. hit backspace a few times to delete the character and "touch" and then keep going
5. notice that you've deleted part of the prompt. 

OBSERVED RESULT

Improperly rendered iChing unicode characters, split in half vertically.

EXPECTED RESULT

full rendering of iChing symbol as valid character and no change to typing format? direction?

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION
Comment 1 Kurt Hindenburg 2024-03-24 21:25:42 UTC
I do see the issue of when highlighting the char is it cut in half horizontally.  I don't see your #4-5
Comment 2 Matan Ziv-Av 2024-03-25 12:58:44 UTC
(In reply to Kurt Hindenburg from comment #1)
> I do see the issue of when highlighting the char is it cut in half
> horizontally.  I don't see your #4-5

Those are troublesome characters. See https://www.unicode.org/L2/L2024/24059-eaw-yijing-symbols.pdf

Unicode defines their width as 1, and this is what we use. glibc  (and libreadline separately) overrides the width to 2.
It makes sense to use 2, but it will cause issues with programs that use other wcwidth implementations.
Comment 3 Bug Janitor Service 2024-03-28 19:18:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/977
Comment 4 Kurt Hindenburg 2024-04-02 19:30:33 UTC
Git commit c8b94b8780019dca7511efe1cf110f1b19bf7a7d by Kurt Hindenburg, on behalf of Matan Ziv-Av.
Committed on 02/04/2024 at 19:30.
Pushed by hindenburg into branch 'master'.

Override width of YiJing Hexagram Symbols Unicode characters (0x4dc0-0x4dff)

Their Unicode width is 1, but GNU libc's wcwidth and libreadline
override it to 2, so it makes sense to follow suit.

The profile option "ignore wcwidth" returns the width to 1, if
enabled, so it allows the old behavior if it desired. 

M  +2    -2    src/Screen.cpp
M  +13   -8    src/characters/Character.h
M  +11   -11   src/characters/CharacterWidth.cpp
M  +1    -0    tools/uni2characterwidth/overrides.txt

https://invent.kde.org/utilities/konsole/-/commit/c8b94b8780019dca7511efe1cf110f1b19bf7a7d