Summary: | konsole (and other QWidgets based applications) don't respect font hinting configuration | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Andrzej Rybczak <andrzej> |
Component: | font | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | CC: | kde, mglb, nate, postix, wbauer1 |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
See Also: | https://bugreports.qt.io/browse/QTBUG-80967 | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Demonstration of different rendering of Dejavu Sans Mono 10pt in konsole
hinting_comparison_among_apps.png |
@Nate Graham please elaborate on this new title. Font preview on the screenshot is monospace (because the font is). Looks like different hinting. So they are, my mistake, sorry. Indeed. I compared hintings and it looks like hintnone fontconfig setting (even though I'm using hintfull systemwide). I think that's not Konsole bug - it affects other Qt Widget apps. System settings uses QtQuick/Kirigami. Can you verify other QtQuick app? E.g. plasma discover (with main system font set to monospace one). Maybe system settings applies selected hinting for its own preview but for some reason does not apply it system-wide. Created attachment 125011 [details]
hinting_comparison_among_apps.png
I just rebooted my system after some updates, and now I too am seeing that Konsole no longer respects my hinting configuration for DejaVu Sans Mono.
I have hinting disabled system-wide except for small sizes of DejaVu Sans Mono.
Here is my ~/.config/fontconfig/fonts.conf:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<dir>~/.fonts</dir>
<match target="font">
<edit mode="assign" name="embeddedbitmap">
<bool>false</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hinting">
<bool>false</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintnone</const>
</edit>
</match>
<match target="font">
<test name="family">
<string>DejaVu Sans Mono</string>
</test>
<test compare="less_eq" name="weight">
<const>normal</const>
</test>
<test compare="less_eq" name="size">
<double>15</double>
</test>
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle">
<const>hintfull</const>
</edit>
</match>
</fontconfig>
Fontconfig definitely picks up my override:
$ fc-match -v 'Consolas' | fgrep -e hint -e file
hintstyle: 0(i)(w)
hinting: False(w)
autohint: False(s)
file: "/usr/local/share/fonts/win10/consola.ttf"(w)
$ fc-match -v 'Noto Sans Mono' | fgrep -e hint -e file
hintstyle: 0(i)(w)
hinting: False(w)
autohint: False(s)
file: "/usr/share/fonts/noto/NotoSansMono-Regular.ttf"(w)
$ fc-match -v 'DejaVu Sans Mono' | fgrep -e hint -e file
hintstyle: 3(i)(w)
hinting: True(w)
autohint: False(s)
file: "/usr/share/fonts/dejavu/DejaVuSansMono.ttf"(w)
But Konsole ignores my override and renders DejaVu Sans Mono without hinting.
Some other KDE applications, such as KCharSelect, do respect my hinting override, but others, such as Kate, do not. Chromium does. See my attached screen shot for comparisons.
These reports appear to regard the exact same issue: https://phabricator.kde.org/D26185 https://bugreports.qt.io/browse/QTBUG-80967 Adding the following to a script in ~/.config/plasma-workspace/env/ and restarting my KDE session makes my Konsole behave correctly again: # work around https://bugreports.qt.io/browse/QTBUG-80967 export QT_ENABLE_HIGHDPI_SCALING=0 The referenced Qt bug was fixed for Qt 5.14.1. Is there anything that needs to be done in Konsole? I haven't upgraded Qt yet, but my expectation is that this bug is no more. On my (non-HiDPI) system with Qt 5.14.1, the fonts in konsole now look exactly the same again regardless whether QT_AUTO_SCREEN_SCALE=0 (or QT_ENABLE_HIGHDPI_SCALING=0) is set or not, while there were noticable differences (i.e. distortions without QT_AUTO_SCREEN_SCALE=0) with Qt 5.14.0. So AFAICT, the problem is indeed fixed, and that probably also confirms that it really was an upstream problem in Qt... ;-) |
Created attachment 124973 [details] Demonstration of different rendering of Dejavu Sans Mono 10pt in konsole SUMMARY After a system update (a bunch of plasma apps were upgraded from 5.17.4 to 5.17.5) konsole (and kwrite btw) renders fonts differently than the rest of applications (see attached screenshot for details). STEPS TO REPRODUCE 1. Check out DejaVu Sans Mono font in system settings and in konsole settings. OBSERVED RESULT Fonts are rendered differently in konsole/kwrite than the rest of apps. EXPECTED RESULT Fonts are rendered the same way in konsole/kwrite as the rest of apps. SOFTWARE/OS VERSIONS Linux: Arch Linux, kernel 5.4.8-arch1-1 KDE Plasma Version: 5.17.5 KDE Frameworks Version: 5.65.0 Qt Version: 5.14.0