You are not logged in.

#1 2011-12-23 17:35:17

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

[SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.

Hi, since the upgrade to qt 4.8, font rendering of qt applications seems very bad to me.
Before the upgrade, firefox and konqueror looked the same, here is now,
I tried in graphicssystem native and raster:

http://ompldr.org/vYnZ2Mw/firefox1.png
http://ompldr.org/vYnZ2NQ/konqueror_native1.png
--
http://ompldr.org/vYnZ2NA/firefox2.png
http://ompldr.org/vYnZ2Nw/konqueror_raster.png
http://ompldr.org/vYnZ2Ng/konqueror_native2.png

I tried autohinter too, but gtk apps (cairo) seems always better, what happened?


My .fonts.conf:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
    <edit name="autohint" mode="assign">
      <bool>false</bool>
    </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="lcdfilter">
   <const>lcddefault</const>
  </edit>
 </match>
 <match target="font">
  <test name="family">
   <string>Segoe UI</string>
  </test>
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>                                                                           
  </edit>                                                                                              
 </match>                                                                                              
 <match target="font">                                                                                 
  <edit mode="assign" name="antialias">                                                                
   <bool>true</bool>                                                                                   
  </edit>                                                                                              
 </match>
</fontconfig>

Last edited by kokoko3k (2011-12-30 14:16:23)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#2 2011-12-23 17:44:10

Lothium
Member
Registered: 2009-10-10
Posts: 192

Re: [SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.

I have the same problem with rekonq. It looks very ugly now.

Offline

#3 2011-12-23 18:28:59

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: [SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2011-12-23 19:29:55

infinality
Member
Registered: 2011-12-23
Posts: 6

Re: [SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.

Some people have had to recompile Qt with the infinality-patched freetype in order to get things looking normal:
http://www.infinality.net/forum/viewtopic.php?f=2&t=159

Offline

#5 2011-12-23 19:39:10

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: [SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.

Thanks,
but it seems they're talking about qt 4.7.4 (i've seen the links to precompiled qt packages in the thread you posted).
I'm fine with how fonts looked with qt 4.7.4, but now something seems to be broken, and i don't know if it depends on a bug/feature introduced by qt devs or by some configure option used by arch package.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#6 2011-12-24 04:51:17

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.

Someone reported this bug:

https://bugs.archlinux.org/task/27674

Offline

#7 2011-12-24 15:00:14

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: [SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.

Nope i don't think it is related.
There is something bad happening here, things more or less seems fine with graphicssystem raster, but new qt 4.8 subpixel positioning doesn't play good at all with native graphicssystem.
for subpixel positioning to work either no hinting preference has to be done or one has to choose hintslight, which is imho the best.
try by yourself by:

QT_GRAPHICSSYSTEM=native kdialog --getopenfilename "/tmp"

then, in the name field, write 0123456789, move the cursor to the beginning and keep space pressed, you'll see the number dancing and the space between numbers to become larger and smaller continuosly.

I repeat, this does not happens with other hint styles or with graphicssystem raster, do they forgot to apply changes to native subsystem?

The reason because i complain is that native graphicssystem, even if slower, provides subpixel RGBA hinting over transparent windows too (plasma-desktop, konsole...), while raster falls back to gray.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#8 2011-12-28 17:37:29

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: [SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.

I downgraded qt, kde-libs and some other deps.

Here's the bug report:
https://bugreports.qt.nokia.com/browse/QTBUG-23372


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#9 2011-12-29 12:45:03

einhard
Member
From: Poland
Registered: 2010-01-05
Posts: 89

Re: [SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.

Do you have fontconfig-infinality pcakage installed?

I don't have this issue and in my case only SET_XFT_SETTINGS=false in /etc/profile.d/infinality-settings.sh is different from the default configuration.

Offline

#10 2011-12-29 16:21:42

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: [SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.

I tried infinality, but i still prefer the plain freetype with hintslight.

The reason because infinality works is (just a case) because you specify hintfull as style and QT in raster backend uses subpixel positioning only when using hintslight.

So, yes, is a workaround that may be or not in your taste, but imho is something that needs to be addressed upstream.

Thanks.

--EDIT--
I gave infinality another try, this time i intentionally didn't installed fontconfig-infinality and explicitely disabled any tweak in infinality-settings.sh  to mimic the default freetype2 behaviour as much as possible.
The results are now acceptable to me, i still miss some extra roundness and smoothing up and down, but i will get used to it.

Last edited by kokoko3k (2011-12-29 18:15:47)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#11 2011-12-30 14:16:09

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: [SOLVED] Qt 4.7 -> 4.8 and bad fonts hinting.

I casually managed to solve this issue by playing with fontconfig settings.
I'm really not sure if this is the correct way, but now i've the same font rendering i've had before qt 4.8 with hintstyle=hintslight.
My Steps are:

yaourt -S freetype2-infinality

* do not install fontconfig-infinality
edit ~/.fonts.conf as follows

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="autohint">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintfull</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="lcdfilter">
   <const>lcddefault</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
</fontconfig>

the trick seems:hinting+autohint+hintfull=hintslight (!?)

edit /etc/profile.d/infinality-settings.sh and add/replace with those values:

SET_XFT_SETTINGS=true
/../
XFT_SETTINGS="
Xft.antialias:  1
Xft.autohint:   1
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.lcdfilter:  lcddefault
Xft.rgba:       rgb
"
/../

export INFINALITY_FT_AUTOFIT_FORCE_SLIGHT_HINTING=true
export INFINALITY_FT_FILTER_PARAMS="06 25 44 25 06"
export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
export INFINALITY_FT_GAMMA_CORRECTION="0 100"
export INFINALITY_FT_BRIGHTNESS="0"
export INFINALITY_FT_CONTRAST="0"
export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=0
export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=0
export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=0
export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
export INFINALITY_FT_STEM_FITTING_STRENGTH=0
export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=false
export INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE=0
export INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE=0
export INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE=0
export INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE=0

Now logout/login.
Starting from there, you can further tweak infinality
Ah, openoffice also looks good out of the box, no need to install extra '*uglyfix*' packages

...and chromium still sucks like nothing happened.

-EDIT-
Remember to not change the hintstyle, leave it to hintfull.

Last edited by kokoko3k (2011-12-30 14:19:40)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB