Bug 1052389 - Bad font rendering
Summary: Bad font rendering
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: qt5-qtbase
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1072126
TreeView+ depends on / blocked
 
Reported: 2014-01-13 18:27 UTC by Sandro Mani
Modified: 2014-11-11 22:50 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-10 14:07:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Changes (17.97 KB, patch)
2014-11-10 16:16 UTC, Sandro Mani
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Qt Bug Tracker QTBUG-27106 0 None None None Never
Qt Bug Tracker QTBUG-32254 0 None None None Never
Qt Bug Tracker QTBUG-40971 0 None None None Never
Qt Bug Tracker QTBUG-41590 0 None None None Never

Description Sandro Mani 2014-01-13 18:27:06 UTC
Description of problem:
Font rendering looks bad compared to qt4. See i.e. [1]. Upstream tracker has to issue which seem relevant, see [2] and [3]. There is a proposed patch [4], I'm currently building a patched qt5-qtbase to see whether it helps.


[1] http://smani.fedorapeople.org/qt4vsqt5.png
[2] https://bugreports.qt-project.org/browse/QTBUG-32254
[3] https://bugreports.qt-project.org/browse/QTBUG-27106
[4] https://bugreports.qt-project.org/secure/attachment/37325/qt5-fonts.diff

Version-Release number of selected component (if applicable):
qt5-qtbase-5.2.0-2.fc21

How reproducible:
Always

Comment 1 Rex Dieter 2014-01-13 18:30:21 UTC
I think we wanted this against the main qt5-qtbase pkg, reassigning...

Comment 2 Sandro Mani 2014-01-13 18:32:03 UTC
Whoops, yes definitely.

Comment 3 Sandro Mani 2014-01-14 00:10:28 UTC
Unfortunately the patch does not seem to make any difference.

Comment 4 Rex Dieter 2014-01-14 14:30:32 UTC
Try using the bundled (non-system) harfbuzz?  (not sure if that is relevant or not here)

Comment 5 Sandro Mani 2014-01-14 15:57:34 UTC
No difference unfortunately.

Comment 6 Sandro Mani 2014-01-18 22:24:44 UTC
I just tested under gnome and, oddly, things look normal there. (OTOH, also on a fresh KDE installation font rendering is wrong). Is there a way to dump the active Xft settings to compare the values?

Comment 7 Rex Dieter 2014-01-28 20:40:26 UTC
Mind testing qt5-qtbase-5.2.0-7+ builds from koji if they make any difference? 

5.2.0-8 is building now.

I backported a patch we use in qt(4) builds that unconditionally enables freetype lcdfilter support.  I don't anticipate it making any difference for folks who do not have freetype-freeworld installed, but you never know.

Comment 8 Rex Dieter 2014-01-28 20:44:59 UTC
Lacking that, comment #6 implies this may have something to do with default font preferences, one of more of these XSettings:

Xft/Antialias
Xft/Hinting
Xft/HintStyle
Xft/RGBA

KDE uses fontconfig defaults (and ~/.config/fontconfig/fonts.conf overrides).  Perhaps gnome (aka gnome-settings-daemon) overrides these fontconfig defaults?

Comment 9 Rex Dieter 2014-01-28 20:50:45 UTC
Oh, and to answer Sandro's question, this may help:
xrdb -query | grep Xft

On my f19/f20 boxes in kde, I get:

$ xrdb -query | grep Xft
Xft.antialias:  1
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintmedium
Xft.rgba:       rgb

(though I can't promise that I didn't customize this somewhere)

Comment 10 Sandro Mani 2014-01-28 22:34:56 UTC
Unfortunately, no difference.

On both KDE and Gnome I get

$ xrdb -query | grep Xft
Xft.antialias:  1
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.lcdfilter:  lcddefault
Xft.rgba:       rgb

Both have freetype-freeworld installed, with

$ cat ~/.Xresources 
Xft.lcdfilter: lcddefault

Also, both have qt5-qtbase-5.2.0-8.fc21.x86_64.

See screenshot at http://smani.fedorapeople.org/qtcreator.png

I should note that starting qtcreator on kde like
$ qtcreator -style gtk+
and setting the gtk style to Adwaita in kcm_gtk results fonts in the shell elements (i.e. menus, buttons, dialogs) being correctly rendered, the editor font however still looks too "light".

Comment 11 Sandro Mani 2014-01-29 13:48:57 UTC
Some more insight: apparently, font-rendering breaks as soon as there exists $HOME/.config/fontconfig/fonts.conf. On Gnome, such a file does not exist (even after tweaking the font settings with gnome-tweak-tool).

Comment 12 Sandro Mani 2014-02-08 16:04:43 UTC
Seems like the "rgba" property in the fontconfig file is what causes the fonts to appear "thin", i.e. the portion

 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>


(regardless of which value is assigned to rgba). Removing it gives "thick" fonts again (though maybe somewhat less "smooth"?)

Comment 13 Ahmad Samir 2014-08-22 12:22:18 UTC
Hello. In https://bugreports.qt-project.org/browse/QTBUG-32254 a patch is reported to fix the issue, can it be included in the Fedora package?

Thanks in advance.

Comment 14 Rex Dieter 2014-08-22 12:54:20 UTC
I was initially just waiting for 5.4 to be released, is there some urgency?

Comment 15 Ahmad Samir 2014-08-22 13:39:37 UTC
It can wait for 5.4.

(Also, I tested with a local build, fonts still look thin in qt5 apps with that patch).

Thanks.

Comment 16 Ahmad Samir 2014-08-28 05:43:26 UTC
I found this upstream bug: https://bugreports.qt-project.org/browse/QTBUG-40971

I think it's the exact issue I see on my box and in the screen shot in #c0.

Comment 17 Rex Dieter 2014-11-10 14:02:40 UTC
Looking at applying the latest patch in QTBUG-41590 on 5.4.0, that should help resolve all/most issues raised in this report.

Comment 18 Rex Dieter 2014-11-10 14:07:56 UTC
%changelog
* Mon Nov 10 2014 Rex Dieter <rdieter> 5.4.0-0.4.beta
- Bad font rendering (#1052389,QTBUG-41590)

Comment 19 Sandro Mani 2014-11-10 15:42:38 UTC
With 5.4.0-0.4.beta I get a cursor blinking like crazy, and in qt-creator double-clicking files from the project-tree fails to open them in the editor. These things did not happen with 5.4.0-0.3.beta. Haven't had a chance to debug further yet.

Comment 20 Rex Dieter 2014-11-10 15:48:16 UTC
Odd, I find it hard to believe simply changing default gamma correction could cause that.

Comment 21 Sandro Mani 2014-11-10 16:16:54 UTC
Created attachment 955870 [details]
Changes

Patch between 0.3 and 0.4 is somewhat larger, see attachment.

Comment 22 Rex Dieter 2014-11-10 16:21:20 UTC
Indeed, that *is* a lot bigger than what was actually committed:

http://pkgs.fedoraproject.org/cgit/qt5-qtbase.git/commit/?id=0a278efc524ea95890cf128a06aff35893db565d

Comment 23 Sandro Mani 2014-11-11 22:50:18 UTC
yay, nice fonts again with qt5-qtbase-5.4.0-0.5.beta.fc22, thanks! :)


Note You need to log in before you can comment on or make changes to this bug.