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

            Bug ID: 528434
           Summary: Runs of identical ASCII characters ("-----") are drawn
                    narrower/wider than the cell grid with Wayland
                    fractional scaling
    Classification: Applications
           Product: konsole
      Version First 26.08.2
       Reported In:
          Platform: CachyOS
                OS: Linux
            Status: REPORTED
          Severity: minor
          Priority: NOR
         Component: font
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 198136
  --> https://bugs.kde.org/attachment.cgi?id=198136&action=edit
Shows the disalignment of the "-" chars

SUMMARY
With fractional scaling on Wayland, a long run of identical ASCII characters
(e.g.
"+------...------+") is drawn with a different width than the character grid
used for the
rest of the line. A line made of "|" followed by spaces and a closing "|" ends
at a different
x position than the "+-----+" line above it, although both have exactly the
same number of
columns. Box-drawing characters (U+2500 block) drawn by Konsole itself line up
correctly.

This breaks ASCII-art tables (for example the output of CLI table tools using
"+---+" borders).

STEPS TO REPRODUCE
1. Wayland session, output scale fractional (2.25 and 1.5 here).
2. Open Konsole, maximise or use a wide window (>= 100 columns).
3. Run:
     python3 -c "import shutil; w=shutil.get_terminal_size().columns;
print('+'+'-'*(w-2)+'+'); print('|'+' '*(w-2)+'|'); print('┌'+'─'*(w-2)+'┐');
print('│'+' '*(w-2)+'│')"

OBSERVED
- The "-" line ends before (or after, depending on font size) the "|" line.
Measured on a
  screenshot: about 4 % shorter at 12 pt, about 2 % shorter on the other
monitor.
- The "┌───┐" / "│   │" pair is aligned.
- Happens with and without tmux, so it is not a multiplexer/REP issue (checked:
tmux sends the
  dashes literally, no CSI b).
- Happens without colours (--color never equivalent), so it is not an SGR width
problem.
- The font ligature variant makes no difference as far as tested.

EXPECTED
Every line with the same number of columns has the same pixel width.

COMPARISON (same machine, same session, same test script)
- Alacritty: aligned.
- Kitty: aligned.
- Kwi (nightly Flatpak, org.kde.kwi, same Plasma session): aligned. The
"+-----+" line ends in
  the same column as the "|" lines, and the box-drawing pair is aligned too.

ENVIRONMENT
- Konsole 26.08.2 (konsole 26.08.2-1.1), Plasma 6.8.2, KWin 6.8.2, Qt 6.12.0,
Wayland
- Outputs: HDMI-A-1 3840x2160 scale 2.25, eDP-1 2560x1600 scale 1.5
- Font: JetBrainsMono Nerd Font Mono 12 pt, "Use font's line characters"
disabled
- Distro: CachyOS (Arch), kernel 7.3.1

POSSIBLY RELATED (not identical)
- Bug 373232 - Horizontal lines with fractional HiDPI scaling
- Bug 491562 - konsole leaves artifacts among text with fractional scaling
- Bug 441037 - Wrong characters' horizontal spacing results in overlapping

NOTE
Screenshots of the Konsole / Alacritty / Kitty comparison should be attached.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to