Page 1 of 1

GTK fonts

PostPosted: Jun 3rd, '11, 08:07
by sumski
Hi all!
I'm having some problems with font hinting/antialiasing on GTK aplications (ie Mageia control center , firefox , etc...)
They don't follow the same instructions i gave, that KDE apps are following without problems.
What could be the problem?
.fonts.conf:
Code: Select all
<?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="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="lcdfilter">
   <const>lcddefault</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="autohint">
   <bool>true</bool>
  </edit>
 </match>
 <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="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
 <dir>~/.fonts</dir>
</fontconfig>


.Xresources:
Code: Select all
! Xft settings ---------------------------------------------------------------
Xft.dpi:        96
Xft.antialias:  true
Xft.rgba:       rgb
Xft.hinting:    true
Xft.hintstyle:  hintslight
Xft.lcdfilter: lcddefault

Re: GTK fonts

PostPosted: Jun 3rd, '11, 08:12
by roadrunner
Do you have the oxygen-gtk package installed.

.\\artin

Re: GTK fonts

PostPosted: Jun 3rd, '11, 09:16
by sumski
Yes, i have!
Here's a screenshot:
Image

Re: GTK fonts

PostPosted: Jun 3rd, '11, 18:55
by anshuljain
You're gonna have to compile libfreetype6 with subpixel hinting support. The stock Mageia one doesn't have subpixel hinting enabled...but has the BCI enabled. GTK apps respect rendering through cairo and to activate subpixel hinting through cairo one needs the libfreetype6 RPM. I compiled mine locally and added a small file in /etc/fonts/conf.avail called 10-lcd-filter.conf and added the following:-
Code: Select all
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Enable freetype's new subpixel filter. Currently, only a cairo
version containing the patches from freedesktop #10301 respects this
setting. -->
<match target="font">
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
</match>
</fontconfig>



Attached is a screenshot of Chromium and Libreoffice with the modifications:- http://www.imagebam.com/image/c6273b135062324

Re: GTK fonts

PostPosted: Jun 3rd, '11, 19:43
by sumski
Thanks anshuljain , i will try and post results. I must say the overall system inconsisteny is really annoying me! :(
Overall , i'm really happy with Mageia , except for this part. ;)

Re: GTK fonts

PostPosted: Jun 3rd, '11, 20:51
by ahmad
anshuljain is right. (Hello, anshuljain :)).

The plan is to offer a freetype2 build with sub-pixel rendering enabled in the Tainted repo (it was forgotten before release, what with the many other things that needed to be done and all); the package(s) should be available once the release freeze is over and the other admin tasks are done for Mageia 1 (the SVN is forked.. etc); so say 1-2 weeks maximum. :)

(The Tainted repos are added by not enabled by default, you can enable them from the Mageia control center -> S/W Management -> Configure media sources for install and update, ideally enable the "Tainted Release" and "Tainted Updates" repos; for a quick explanation of how the repos are split in Mageia have a look here).

FWIW, the lcdfilter settings won't affect Qt4/KDE apps in Mageia, even with freetype2 from the Tainted repo, Qt4 uses its internal font rendering code (which is derived from the old freetype2 code IIUC); which isn't bad, since you seem to like it already :).

Re: GTK fonts

PostPosted: Jun 4th, '11, 05:20
by anshuljain
Hello ahmad...glad to see you here :)

Regarding this GTK rendering issue, I've filed a bug report at :- https://bugs.mageia.org/show_bug.cgi?id=1570