Created attachment 176842 [details] FontForge source for a TTF test font with byte code hinting instructions to clearly test hinting SUMMARY When I select full hinting from the Fonts panel in System Settings, KDE applications do not actually appear to use full hints, or at least not to use the hints in the byte code within TTF fonts. STEPS TO REPRODUCE 1. Use the System Settings to set hinting to full 1a. Verify that /etc/fonts/conf.d is set to full hinting 1b. Verify that ~/.config/fontconfig has nothing that overrides this 2. Run KDE Plasma on Wayland 3. Set Konsole, Kwrite, or other to KDE app to use a TTF font that includes byte code instructions for hinting (e.g., attached) OBSERVED RESULT The KDE app does not display text with hinting according to the byte code within the font. Strongly-hinted fonts still appear blurry. EXPECTED RESULT KDE apps display text with hinting using the byte code within the font. SOFTWARE/OS VERSIONS Operating System: Fedora Linux 41 KDE Plasma Version: 6.2.4 KDE Frameworks Version: 6.9.0 Qt Version: 6.8.1 Kernel Version: 6.12.5-200.fc41.x86_64 (64-bit) Graphics Platform: Wayland Processors: 32 ร AMD Ryzen 9 7950X 16-Core Processor Memory: 62.5 GiB of RAM Graphics Processor: NVIDIA GeForce RTX 4090/PCIe/SSE2 ADDITIONAL INFORMATION I first noticed this when I realized that Konsole, when set to my own coding font, was not using the hinting instructions that I had laboriously programmed in. This was despite hinting being set to Full in the System Setting, /etc/fonts/conf.d/ being set to full hinting, ~/.Xresources being set to Xft.hintstyle: hintfull, and everything else that I could think of. Graphical Emacs, built against GTK3 and using XWayland, correctly renders the full hinting. The FreeType tool, ftview, also correctly displays fonts with byte code hinting, so this does not seem to be at the level of FreeType. Since the effect of font hinting can be subtle, I have created the attached test font to clearly verify whether byte code hinting is working or not. It has two glyphs: - The `x` glyph has a glyph outline that displays an N (for not hinting), but uses byte code instructions to reposition the diagonal to a horizontal stem, making an H to demonstrate that byte code hinting is working. - The `o` glyph displays three nested squares. If byte code hinting is working, each square and the spaces between them should be exactly one pixel in thickness, regardless of font size. (There may be some variation here horizontally depending on sub-pixel alignment settings, but certainly they should be aligned vertically to the pixel grid.) Otherwise, if the squares are significantly thicker than a pixel at larger sizes, byte code hinting is not working.
Created attachment 176843 [details] Compiled TTF test font with byte code hinting instructions to clearly test hinting
Created attachment 176844 [details] FTView showing the attached test font when hinting is disabled
Created attachment 176845 [details] FTView showing the attached test font when hinting is enabled
Created attachment 176846 [details] Emacs (using GTK3 and XWayland) demonstrating working hinting
Created attachment 176847 [details] Konsole with the test font at size at 10pt not showing hinting
Created attachment 176848 [details] Konsole with the test font at size at 24pt not showing hinting
Created attachment 176849 [details] Konsole with the test font at size at 25pt partly showing hinting
Additional note: weirdly, the behavior seems to change between 24pt and 25pt. At 25pt and above, the `x` glyph changes from an N to an H, demonstrating that it is now interpreting the byte code. And at 25pt and above, the `o` glyph collapses (despite showing just fine at very large sizes in FTView).
Thanks for the detailed bug report. To my knowledge, we don't do our own font rendering in KDE; this is done below us, in Qt level. Can you see if the same issues manifest on your system in a Qt app not built with any KDE frameworks? e.g. QBitTorrent. If they do, then it's a Qt issue, and the place to raise this will be https://bugreports.qt.io Thanks a lot!
๐๐งน โ ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME. For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging. Thank you for helping us make KDE software even better for everyone!
Created attachment 177920 [details] PySide6 script to test hinting with pure Qt
Created attachment 177921 [details] PySide6 script to test hinting with pure Qt (result)
Thanks, Nate. Now that I have some free time again, I rolled a quick PySide6 script to display my test font with pure Qt. It looks like you were correct: it shows the same behavior as the KDE apps (script and screenshot attached), so it appears that I'll need to re-raise this with the Qt folks. I had originally thought this might be a KDE issue since KDE does have configuration settings for fonts and font hinting and I'd thought maybe there was something in the way that it stored those settings and interacted with Qt (given that the Qt API allows for things like setting the hinting preference).
Happy to help! With all the information you're able to provide, I have no doubt that the Qt bug report you'll file will be actionable by the Qt devs.
Followup: Interestingly, searching their bug tracker to try to avoid a dupe, I came across https://bugreports.qt.io/browse/QTBUG-128874, which led me back to the related Bug 492918 here (which I see you'd responded to as well). I gave it a shot changing my display scaling from 200% (integer scaling) to 100%, and the result was the hinting working perfectly on my pure Qt test. I also noticed right away that Konsole was now clearly showing my coding font's hinting at the new tiny size. I tested other scaling factors as well, and all showed broken hinting except for 100%. (Also, I'm only using a single screen, so this shouldn't be a mixed scaling issue.) So it looks like this is likely related to that one, and I'll make an account and post there later. I'm hopeful that providing an easy-to-see test case will help.
Definitely sounds like an example of https://bugreports.qt.io/browse/QTBUG-128874!