Bug 441037 - Wrong characters' horizontal spacing results in overlapping
Summary: Wrong characters' horizontal spacing results in overlapping
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: 21.08.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-16 10:54 UTC by Mikhail Zolotukhin
Modified: 2022-08-27 01:10 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Kitty text display (45.67 KB, image/png)
2021-08-16 10:54 UTC, Mikhail Zolotukhin
Details
Alacritty text display (413.99 KB, image/png)
2021-08-16 10:55 UTC, Mikhail Zolotukhin
Details
Konsole text display (529.20 KB, image/png)
2021-08-16 10:55 UTC, Mikhail Zolotukhin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Zolotukhin 2021-08-16 10:54:26 UTC
Created attachment 140765 [details]
Kitty text display

SUMMARY
Horizontal spacing between characters is uneven, and characters also overlap the following ones.

STEPS TO REPRODUCE
1. Paste this text into some Konsole view (e.g. using Neovim or other console editor):

      "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣶⣾⠿⠿⠟⠛⠛⠛⠛⠿⠿⣿⣷⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "  ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⡿⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠂⠉⠉⠉⠉⢩⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⢰⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠠⡀⠀⠀⢀⣾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⢀⣸⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡧⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠈⠁⠒⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⠀⠀⠉⠢⠤⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠈⠑⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠑⠒⠤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⡇⠀⠀⢀⣣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠒⠢⠤⠄⣀⣀⠀⠀⠀⢠⣿⡟⠀⠀⠀⣺⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
      "⠀⣿⠇⠀⠀⠀⠀⠀⣤⡄⠀⠀⢠⣤⡄⠀⢨⣭⣠⣤⣤⣤⡀⠀⠀⢀⣤⣤⣤⣤⡄⠀⠀⠀⣤⣄⣤⣤⣤⠀⠀⣿⣯⠉⠉⣿⡟⠀⠈⢩⣭⣤⣤⠀⠀⠀⠀⣠⣤⣤⣤⣄⣤⣤",
      "⢠⣿⠀⠀⠀⠀⠀⠀⣿⠃⠀⠀⣸⣿⠁⠀⣿⣿⠉⠀⠈⣿⡇⠀⠀⠛⠋⠀⠀⢹⣿⠀⠀⠀⣿⠏⠀⠸⠿⠃⠀⣿⣿⠀⣰⡟⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡟⢸⣿⡇⢀⣿",
      "⣸⡇⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⣿⡟⠀⢠⣿⡇⠀⠀⢰⣿⡇⠀⣰⣾⠟⠛⠛⣻⡇⠀⠀⢸⡿⠀⠀⠀⠀⠀⠀⢻⣿⢰⣿⠀⠀⠀⠀⠀⠀⣾⡇⠀⠀⠀⢸⣿⠇⢸⣿⠀⢸⡏",
      "⣿⣧⣤⣤⣤⡄⠀⠘⣿⣤⣤⡤⣿⠇⠀⢸⣿⠁⠀⠀⣼⣿⠀⠀⢿⣿⣤⣤⠔⣿⠃⠀⠀⣾⡇⠀⠀⠀⠀⠀⠀⢸⣿⣿⠋⠀⠀⠀⢠⣤⣤⣿⣥⣤⡄⠀⣼⣿⠀⣸⡏⠀⣿⠃",
      "⠉⠉⠉⠉⠉⠁⠀⠀⠈⠉⠉⠀⠉⠀⠀⠈⠉⠀⠀⠀⠉⠉⠀⠀⠀⠉⠉⠁⠈⠉⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠁⠀⠉⠁⠀⠉⠁⠀⠉⠀",


OBSERVED RESULT

Horizontal spacing between characters is irregular and the "m" letter is truncated. (See screenshot)


EXPECTED RESULT

The "m" is not truncated and spacing between dots are even. (See Kitty terminal emulator screenshot)


SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.10.56-1-lts (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 15,5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620

ADDITIONAL INFORMATION

I use fractional scaling (125%), which is respected by both Kitty and Konsole.
Comment 1 Mikhail Zolotukhin 2021-08-16 10:55:03 UTC
Created attachment 140766 [details]
Alacritty text display
Comment 2 Mikhail Zolotukhin 2021-08-16 10:55:27 UTC
Created attachment 140767 [details]
Konsole text display
Comment 3 Bug Janitor Service 2022-08-06 18:51:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/722
Comment 4 Kurt Hindenburg 2022-08-27 01:10:23 UTC
Git commit 76f879cd70fb494ab2334d2660b34679546f3d9d by Kurt Hindenburg, on behalf of Matan Ziv-Av.
Committed on 26/08/2022 at 19:24.
Pushed by hindenburg into branch 'master'.

Draw characters in exact positions

QT can't be made to draw monospaced text (if the font does not cooperate),
so avoid combining characters, using a QPainter::drawText() call for each
character.

For bidi text support this change requires konsole to reorder and reshape
the characters. This is done using the ICU library (which QT also uses).

This change allows for some improvements related to text rendering:

- More precise bidi reordering, which is no longer changed by characters'
  attributes and selection.
- underlines drawn separately from the text, allowing for differing
  underline modes (double, curly, dashed, dotted, colored).
- Overriding font for emoji characters.

This commit fixes a few bugs and addresses a lot more:

Feature requests: More standard conforming RTL and various underlines:
Related: bug 403729, bug 387811, bug 416508, bug 452087, bug 425973, bug 430822, bug 442742, bug 430822, bug 440070, bug 450017, bug 445846, bug 453086, bug 381593, bug 451716

Using non-monospace font:



Emoji:

Regression: devanagari rendering

M  +2    -0    CMakeLists.txt
M  +1    -0    src/CMakeLists.txt
M  +47   -25   src/FontDialog.cpp
M  +2    -1    src/FontDialog.h
M  +127  -23   src/Screen.cpp
M  +18   -5    src/Screen.h
M  +28   -13   src/Vt102Emulation.cpp
M  +0    -29   src/autotests/CharacterTest.cpp
M  +0    -1    src/autotests/CharacterTest.h
M  +1    -1    src/autotests/TerminalCharacterDecoderTest.cpp
M  +119  -29   src/characters/Character.h
M  +1    -1    src/characters/Hangul.cpp
M  +5    -4    src/decoders/HTMLDecoder.cpp
M  +1    -1    src/decoders/PlainTextDecoder.cpp
M  +3    -0    src/profile/Profile.cpp
M  +29   -0    src/profile/Profile.h
M  +101  -6    src/terminalDisplay/TerminalDisplay.cpp
M  +7    -0    src/terminalDisplay/TerminalDisplay.h
M  +42   -0    src/terminalDisplay/TerminalFonts.cpp
M  +12   -0    src/terminalDisplay/TerminalFonts.h
M  +542  -269  src/terminalDisplay/TerminalPainter.cpp
M  +40   -13   src/terminalDisplay/TerminalPainter.h
M  +2    -0    src/widgets/EditProfileAdvancedPage.ui
M  +113  -3    src/widgets/EditProfileAppearancePage.ui
M  +61   -3    src/widgets/EditProfileDialog.cpp
M  +6    -1    src/widgets/EditProfileDialog.h

https://invent.kde.org/utilities/konsole/commit/76f879cd70fb494ab2334d2660b34679546f3d9d