I use cutycapt to make screenshots of web pages. When I switched from Kubuntu 16.04 to Kubuntu 20.04 I noticed that font rendering quality degraded significantly. I made several screenshots of the same page and enlarged the same fragment on both screenshots for comparison. Command which was used:
cutycapt --out=screenshot.png --url=http://www.debianadmin.com/how-to-disable-ipv6-in-debian.html
Here's the one made in Kubuntu 16.04 (cutycapt version 0.0~svn6-3.1, depends on libqtwebkit4 version 2.3.2-0ubuntu11):
My system is set to full hinting. Letter stems on this screenshot are sharp and their hinting is obviously set to "full".
Now the screenshot made in Kubuntu 20.04 (cutycapt version 0.0~svn10-0.1build1, depends on libqt5webkit5 version 5.212.0~alpha4-1ubuntu2):
All letters are surrounded by gray fringe. Take a look at the word "comment" — all stems in letter "m" have different thickness. It looks like "slight" hinting to me or even no hinting at all.
I'm quite confident that both systems are properly configured to use full hinting (in
System Settings > Fonts and in
/etc/fonts/conf.d/) and all other fonts obey these settings.
I tried adding
.config/fontconfig/fonts.conf with contents:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <match target="font"> <edit name="antialias" mode="assign"><bool>true</bool></edit> <edit name="hinting" mode="assign"><bool>true</bool></edit> <edit name="hintstyle" mode="assign"><const>hintfull</const></edit> <edit name="rgba" mode="assign"><const>rgb</const></edit> <edit name="autohint" mode="assign"><bool>false</bool></edit> <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit> </match> </fontconfig>
But these settings were ignored.
As far as I know cutycapt uses QtWebKit library. I don't know whether these rendering settings are controlled by Qt or WebKit engine directly. I also tried PhantomJS and wkhtmltoimage to capture screenshots in 20.04 but they produce the same blurred text. Any advices regarding tuning hinting or alternative software are welcome.
P.S. If someone knows how I can also enable subpixel antialiasing on these screenshots it would be nice.