Bug 468465

Summary: The commit "Draw characters in exact positions" regressed selection of japanese characters.
Product: [Applications] konsole Reporter: Thomas Lindroth <thomas.lindroth>
Component: fontAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: master   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Thomas Lindroth 2023-04-13 11:50:50 UTC
My distribution upgraded konsole from v22.08.3 to v22.12.3 recently and this introduced some regressions in font handling.

I use the Liberation Mono 9pt font but when displaying japanese characters it falls back to Arial Unicode MS 1.01 for those characters. This looked correct in v22.08.3 but when I try to select any japanese text in v22.12.3 only half the character is selected. This also impacts the new "select mode" (ctrl+shift+d). The cursor can be placed inside of japanese characters and you have to press the directional keys twice to move between those characters.

https://i.imgur.com/4ldFigD.png <- v22.08.3 showing the full 二 character selected
https://i.imgur.com/PoYtSCr.png <- v22.12.3 showing only half of the 二 character selected

The japanese characters are twice as wide as Liberation Mono characters on screen so if the screen is divided into a strict monospace grid the japanese characters gets chopped in half but v22.08.3 seem to handle that fine.

There is also a slight change in visual appearance. If konsole is displaying a mix of Liberation Mono and japanese text on different lines some of the pixels from the japanese text remains after the screen is cleared.

https://i.imgur.com/DD6CM3I.png <- displaying some mixed text on v22.12.3
https://i.imgur.com/v1tqx6R.png <- after running nano, which clears the screen, the top row of pixels from the japanese text remains

I've bisected both problems to the following commit:
76f879cd70fb494ab2334d2660b34679546f3d9d is the first bad commit
commit 76f879cd70fb494ab2334d2660b34679546f3d9d
Author: Matan Ziv-Av <matan@svgalib.org>
Date:   Sat Aug 6 19:15:42 2022 +0300

Draw characters in exact positions

The latest git version is also affected.
Comment 1 Bug Janitor Service 2023-04-14 11:14:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/839
Comment 2 Matan Ziv-Av 2023-04-14 20:35:44 UTC
Git commit 4a16ab981ed741fefac2d2eb491040a3ec6b4fff by Matan Ziv-Av.
Committed on 14/04/2023 at 18:41.
Pushed by hindenburg into branch 'master'.

Draw selected background for right half of double width char if selected

M  +6    -0    src/terminalDisplay/TerminalPainter.cpp

https://invent.kde.org/utilities/konsole/commit/4a16ab981ed741fefac2d2eb491040a3ec6b4fff