Bug 439937

Summary: Debian 11 - Opentype bitmap fonts are displayed with surrounding whitespace when display scaling is enabled
Product: [I don't know] kde Reporter: Tim Small <tim>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal CC: nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: KDE font selection dialogue showing excess spacing around font preview for Terminus Bold.

Description Tim Small 2021-07-16 08:37:55 UTC
Created attachment 140109 [details]
KDE font selection dialogue showing excess spacing around font preview for Terminus Bold.

SUMMARY

When a bitmap font is selected, and display scaling is also enabled (KDE
-> System Settings -> Display Configuration -> Global scale != 100%),
then the fonts are rendered at their unscaled size (this is expected for
bitmap fonts), but instead each character is rendered with large amounts
of surrounding space.

T h e   e f f e c t   i s   a   b i t   l i k e   t h i s ,  a n d   i s

n o t   u s a b l e .


STEPS TO REPRODUCE
1. Install Debian 11
2. Install the fonts-terminus-otb
3. System Settings -> Display and Monitor -> Display Configuration -> Global Scale = 175%
4. Konsole -> Settings -> Edit Current Profile -> Appearance -> Font -> Choose -> Terminus Bold

OBSERVED RESULT

S p a c e d   o u t   t e x t .

EXPECTED RESULT

Not spaced out text.

Gnome terminal behaves as I would expect in this case - instead it choses a different point size (e.g. if user has chosen 10 point, it will select nearest available font to ("chosen font * global scale factor") = 18 point.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Debian 11
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION

Debian bug 989831 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=989831

See also KDE bug #439936

I've found I can workaround this issue by disabling scaling in konsole
by launching it with this wrapper:

#!/bin/sh
export SAVE_QT_SCREEN_SCALE_FACTORS="$QT_SCREEN_SCALE_FACTORS"
export SAVE_QT_SCALE_FACTOR="$QT_SCALE_FACTOR"
unset QT_SCREEN_SCALE_FACTORS
export QT_SCALE_FACTOR=1
exec /usr/bin/konsole

...and then restoring the SAVE variables in the shell rc so that they
are not inherited by commands which are launched from within konsole.
Comment 1 Nate Graham 2021-08-04 22:17:12 UTC
This is controlled by your fontconfig files and the Qt font rendering code; not any KDE code. You'll have to look elsewhere for a fix, I'm afraid. Not sure whether the problem is in Qt or your fontconfig files though, sorry.