FS#64450 - [pango] Incorrect rendering of fonts
Attached to Project:
Arch Linux
Opened by Fedor Dostoyevskiy (bachtiar) - Monday, 11 November 2019, 03:05 GMT
Last edited by Balló György (City-busz) - Sunday, 18 June 2023, 09:33 GMT
Opened by Fedor Dostoyevskiy (bachtiar) - Monday, 11 November 2019, 03:05 GMT
Last edited by Balló György (City-busz) - Sunday, 18 June 2023, 09:33 GMT
|
Details
Since pango-1:1.44-1, font rendering is broken and results
in disfigured text.
See attached image for example. This was tested in xfce with following: Font: Tahoma TrueType font from Windows ttf-fonts, size 8 Enable anti-aliasing: off Hinting: Full Sub-pixel order: None There were no other changes to the system except pango version. Reverting to pango-1:1.43.0-2 solves the problem (this was the last working version released in Arch). |
This task depends upon
Closed by Balló György (City-busz)
Sunday, 18 June 2023, 09:33 GMT
Reason for closing: No response
Additional comments about closing: old report, probably upstream
Sunday, 18 June 2023, 09:33 GMT
Reason for closing: No response
Additional comments about closing: old report, probably upstream
Is it still valid for you?
Did you try with the exact settings above (specifically antialias off etc.)?
I've done some more research and it seems that font rendering is very sensitive to display DPI setting. For reference, all my tests are at 96dpi (default). My impression is that there is some floating point rounding error - like certain values are being rounded in the wrong direction in the new version. The problem is emphasized when antialiasing is off, because it becomes obvious if it's not pixel-exact. The old version was pixel-exact at 96dpi. With the new version, if you change the DPI to 94 or 98, some of the artifacts disappear, but new ones start appearing. It's impossible to get it right. It also seems as if cairo and pango issues are somehow related.
If I can be of any more help, please let me know how. If you want, I can also send you the ttf-windows package to save you time.
and I cannot reproduce the issue.
I can also reliably reproduce the problem with
$ pango-view --font "Tahoma 8" --text "Accessibility"
The telltale sign is that letters A and C touch each other - this means that the bug is present. See attached PNG.
My fonts:
$ fc-list Tahoma
/usr/share/fonts/TTF/tahoma.ttf: Tahoma:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,thường,Arrunta
/usr/share/fonts/TTF/tahomabd.ttf: Tahoma:style=Bold,Negreta,tučné,fed,Fett,Έντονα,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kalın,Krepko,đậm,Lodia
$ sha1sum /usr/share/fonts/TTF/tahoma*.ttf
bc34f23d506dc2886878d1af5bfd2f0ddcf2726a /usr/share/fonts/TTF/tahomabd.ttf
f43d7bf79be8b787d53f7b06a2d5136865aff169 /usr/share/fonts/TTF/tahoma.ttf
but I used Tahoma ttf s from the AUR package [https://aur.archlinux.org/packages/ttf-tahoma/].
Please, can you try with this one?
Then I ran again 'pango-view --font "Tahoma 8" --text "Ac"'.
The pixels of "A" and "c" still touch each other, whereas there should be 1 pixel space in between.
So the issue is still there.
As far as I can see, text using Tahoma from WINE looks identical to text using Tahoma from ttf-win7-fonts, despite TTF files having a vastly different size (143884 vs. 698368 bytes).
Then I installed GNOME - same result. I noticed that GNOME manages fonts differently than XFCE - up to 12pt, antialiasing is off, at 13pt or more antialiasing is switched on automatically. I didn't find any setting for this, and neither for DPI nor hinting as in XFCE. However, pango-view with size 8pt, antialiasing is off and result looks exactly the same as in XFCE - fused "A" and "c".
Then I tried without any desktop, just with X:
$ echo 'pango-view --font "Tahoma 8" --text "Ac"' > ~/.xinitrc
$ rm -rf ~/.config ~/.local ~/.cache
$ startx
Same result. The problem seems 100% reproducible on my side. I'm baffled.
Note: my system is fully up-to-date as of now (2020-04-13), I'm running it in a QEMU/KVM with QXL video it matters anyhow.
Take a look there and/or "reset" those configuration file and restore default.
If it isn't an XFCE issue, then it (some strange mis-configuration file) could be the reason why I cannot reproduce it.
PS: I do not know if a virtual machine could affect a such kind of issue...
Installed everything from scratch and I am able to confirm the issue.
Steps to reproduce:
$ pacstrap ...
$ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
$ locale-gen
$ echo "LANG=en_US.UTF-8" > /etc/locale.conf
$ curl https://source.winehq.org/git/wine.git/blob/refs/heads/master:/fonts/tahoma.ttf > /usr/share/fonts/TTF/tahoma.ttf
$ fc-cache
$ echo 'pango-view --font "Tahoma 8" --text "fil"' > ~/.xinitrc
$ startx
Result: the letters f, i and l are touching.
Expected result: there should be 1 pixel of space between each two letters.
Running in VM is not relevant, I've verified the issue also on a non-VM installation.