Bug 291427 - Font hinting "hintslight" is wrong on KDE 4.8
Summary: Font hinting "hintslight" is wrong on KDE 4.8
Status: RESOLVED UPSTREAM
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-13 10:45 UTC by Xelis
Modified: 2013-05-14 01:15 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
comparison from QT and GTK applications font rendering (199.43 KB, image/jpeg)
2012-01-13 10:45 UTC, Xelis
Details
font settings to reproduce the bug (42.57 KB, image/jpeg)
2012-01-13 10:47 UTC, Xelis
Details
Attachment - Ubuntu_9_Regular (221.20 KB, image/png)
2012-02-19 11:54 UTC, pagoda
Details
hinting test with trebuchet font type (106.88 KB, image/jpeg)
2012-02-23 10:39 UTC, Xelis
Details
infinality patch applied (108.76 KB, image/png)
2012-02-24 14:50 UTC, Xelis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xelis 2012-01-13 10:45:54 UTC
Created attachment 67776 [details]
comparison from QT and GTK applications font rendering

Version:           unspecified (using Devel) 
OS:                Linux

Recently updated to ubuntu precise development branch which has KDE 4.8 rc2.

Font rendering is completely wrong, and subpixel hinting set to hintslight type appears like it was set to full, there is no difference between hintslight or full, the both of them appear the same and the fonts seem like bold.
It occurs on QT applications, not for GTK applications that still render font correctly.

See attached image for a comparison between QT and GTK font rendering: hintslight_subpixel.jpg

Reproducible: Always

Steps to Reproduce:
Opens System settings and set font like in the image attached: font_antialias_settings.jpg


Expected Results:  
The font should be rendered more slightly with subpixel type set to hintslight.
Instead they appear like "Bold" font.

I have an nvidia videocard GT 240 with recent Nvidia drivers (290.10), plugged to the monitor LCD with DVI cable.
Comment 1 Xelis 2012-01-13 10:47:40 UTC
Created attachment 67777 [details]
font settings to reproduce the bug

Steps to Reproduce:
Opens System settings and set font like in the image attached:
font_antialias_settings.jpg
Comment 3 pagoda 2012-02-19 11:54:07 UTC
Created attachment 68924 [details]
Attachment - Ubuntu_9_Regular
Comment 4 pagoda 2012-02-19 11:57:35 UTC
kdesu kdeglobal & kdeglobal files edited to match.
kdesu systemsettings & systemsettings also match.
Comment 5 Xelis 2012-02-21 10:10:47 UTC
@ Antonio,
it could definetely be a qt4.8 issue, but in your bug report I see different behaviour than in mine screenshots.

What "pagoda" showed in his attachments is exactly what's wrong with my test too, gtk applications are correctly using "hintslight", qt ones are not.
Comment 6 pagoda 2012-02-21 13:18:38 UTC
@Xelis
Thank you firstly for pursuing this.
I note your comment here https://bugreports.qt-project.org/browse/QTBUG-23372
referring to hintslight and quote, "it seems it uses bold font instead of normal ones". While I agree with your description I found when using the default Ubuntu font a couple peculiarities;
1. selecting either the medium or regular font weight made no apparent difference.
2. changing the hinting from none to full also made no difference.
3. changing to other Ubuntu font weights eg bold did change as you would expect. Hinting still appears wrong, but they did at least change.
Comment 7 Xelis 2012-02-23 10:39:12 UTC
Created attachment 69032 [details]
hinting test with trebuchet font type
Comment 8 Xelis 2012-02-23 10:40:32 UTC
Hi pagoda,
following your suggestions I did another test and, whit no little surprise, I discovered something that seems related to the ubuntu font family itself used in combination with the kde antialiasing system.

I simply switched to another font type, in my testcase trebuchet, and performed what you described in your latest post, tried all 4 different hinting type and the difference are quite noticeable switching from one to another as you can see in the attachment.

Changing back to ubuntu font, hintslight appears the be totally broken again...

Now, it would be good to hear opinion from one of the developers here.
Comment 9 Xelis 2012-02-23 10:42:41 UTC
Also, I've changed the title because it applies to final kde 4.8 release too
Comment 10 pagoda 2012-02-23 10:51:45 UTC
Xelis thank you once again.

FYI only
I don't know if you have noticed but here https://bbs.archlinux.org/viewtopic.php?id=132368 proposes a workaround or possible solution.
Comment 11 pagoda 2012-02-24 00:32:57 UTC
Xelis,
Just a question...
With Ubuntu's move to QT environment, is this likely to affect users of Unity also?
Comment 12 Xelis 2012-02-24 10:49:56 UTC
(In reply to comment #10)
> Xelis thank you once again.
> 
> FYI only
> I don't know if you have noticed but here
> https://bbs.archlinux.org/viewtopic.php?id=132368 proposes a workaround or
> possible solution.

Hi pagoda, yes I've read about that workaround posted by Antonio but it seems a difficult way to go, I mean recompile QT, X11 and so on against a patched version is not so simple for me on kubuntu, I think it should be fixed upstream but in the case it wouldn't happen I suspect I should try it sooner or later.

As for Unity I can't answer, really. I know qt unity porting was intended to be a fallback for unacceleratd video drivers but gtk is still the base for user with drivers/videocard well supported so don't really know how it will affect Unity users...
Comment 13 Antonio Orefice 2012-02-24 11:02:33 UTC
Hi, i agree it is a bug that needs to be fixed upstream, however you don't need to "re"compile anything but freetype to apply that workaround, probably there is a precompiled infinality package for kubuntu too.

The key is the infinality patched freetype that fools qt into thinking it is using an hintfull method, but produced an hintslight rendering instead.
New QT rendering methods seems just to kick in when hintslight is used, so the trick works.
Comment 14 pagoda 2012-02-24 11:28:02 UTC
I was concerned that this bug seems to affect so few users. Here there are only the 4 of us, the forums too seem to make little mention of dissatisfaction re: fonts either.
As a pre release version, 12.04 has already missed installing some Muon related files altogether here. I'm perhaps thinking a bad iso release? Are we all using the same build perhaps?
At any rate I am downloading daily build as of 24th for clean install regardless. 
Will report back pronto if I detect any differences...
Comment 15 Xelis 2012-02-24 14:46:52 UTC
@Antonio
thank you for your reply, I've managed to compile freetype libraries with infinality patch applied. I've also configured infinality-settings.sh as you described in the arch forum but results are far than optimal on my kubuntu, see attachment. Now gtk applications too have worse font rendering than before and qt ones don't seem so much better.

Yes, now hintslight is working and produce different render than full, but setted to full as you suggested isn't that good looking on my system.

@pagoda
I use 12.04 installed from alpha 2 image and daily updated, so far no differences from me since the initial setup.
Comment 16 Xelis 2012-02-24 14:50:00 UTC
Created attachment 69058 [details]
infinality patch applied
Comment 17 pagoda 2012-02-27 11:57:31 UTC
Another workaround found;

http://www.kubuntuforums.net/showthread.php?57052-KDE-Fat-fonts

This essentially "takes an axe" to the various Ubuntu font weights eliminating all but regular. All the usual settings of 96dpi and hintslight can again be used.

I still feel this bug should be rectified however, with fonts in KDE Kubuntu still behind those in Ubuntu.
Comment 18 Xelis 2012-03-02 15:04:29 UTC
Thank so much, pagoda! that's definetely a workaround, now font rendering seems identical to the one in gnome and the bold feeling is gone away.

This brings to mind two consideration

1 - it explains why trebuchet (as an example) isn't giving the same wrong behaviour than with ubuntu font family
2 - this should really be fixed the proper way, but it seems that no ones here is caring about it, I'd like at least to see the report changed from unconfirmed to something like "ok, we're aware of it".

Maybe it only needs time to let more people install and try the new kde 4.8...

Anyway, thanks again!
Comment 19 pagoda 2012-03-02 23:20:05 UTC
@Xelis
Glad this worked for you also!
Now, how to get this bug fixed so that people do NOT have to hack their Ubuntu font weights in KDE 4.8?
Comment 20 Xelis 2012-03-05 10:24:39 UTC
(In reply to comment #19)
> @Xelis
> Glad this worked for you also!

Yes, it worked for me too and now that bold fonts are definetely gone away I can clearly see what Antonio was referring to, bad subpixel positioning in QT 4.8.
I've tried to play a bit with infinality-settings.sh but I can't reproduce the QT 4.7 font rendering in Kubuntu with QT 4.8...

> Now, how to get this bug fixed so that people do NOT have to hack their
> Ubuntu font weights in KDE 4.8?

Good question, the main problem for Kubuntu users is QT not being able to handle properly the recently grown up ubuntu font family.
But even if they can fix this, QT 4.8 are unable to reproduce the exact font rendering hintslight we were used to until QT 4.7.

Again, it should be good to hear opinions from some of the developers here.
Comment 21 pagoda 2012-03-05 12:35:17 UTC
Xelis,
I'm sure that the QT 4.8 developers could put out a call for samples of font rendering of the Ubuntu font from users still on 11.04, or better still samples from Ubuntu 10.10 as I feel these fonts were the very best we have ever had. IMO Kubuntu has never rendered fonts quite as well as the gnome2 desktop did on Ubuntu. From memory, wasn't their some additional tweaking (a script?) that the Ubuntu dev's devised to achieve the quality fonts that were noticeably lacking in other distro's gnome d/e? If they wanted to the dev's could ask them how this was achieved I'm sure.
Comment 22 Christoph Feck 2012-03-18 21:19:43 UTC
To verify if this is a KDE or Qt problem, please try on KDE 4.8 with Qt 4.7.4.
Comment 23 Xelis 2012-04-11 09:31:10 UTC
(In reply to comment #22)
> To verify if this is a KDE or Qt problem, please try on KDE 4.8 with Qt
> 4.7.4.

Hi, sorry the long delay.
I just tried KDE 4.8.2 with QT 4.7.4 and I confirm there's no issue at all.
Font rendering is nice as usual, sub pixel hinting is rendered correctly with no fringes and even tha bold font bug is gone.
Comment 24 Richard Llom 2013-05-07 21:00:11 UTC
hi @all.
I think this one can be closed as fixed