# [HOWTO]Freetype subpixel font rendering - lcd monitors Pt 2

## mwhitlock

Continued from Part 1

 *justinkb wrote:*   

> ah right sorry I see now how that could be a confusing post and image. I mean the fonts near the icons in *TOOLBARS* are not as I like them. Compare in the image above the two 'Back' words. One in the dropdown menu and the one of firefox's toolbar. The last one is heavier and less pretty. aMule uses that less-pretty font through its entire interface (maybe more applications do).

 

The "Back" in the toolbar looks like it's been painted over a few times without erasing the background, thus compounding the anti-aliasing, darkening the edges, and generally muddying the appearance.  That would be an issue in the application, not the font rendering stack.

----------

## justinkb

so, all GTK+/Gnome applications use this wrong/broken way to render their toolbars? shouldn't i see this problem on everyone's screenshots then? but i don't, so i don't think that is it.

----------

## aronparsons

http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/cairo/ChangeLog?view=markup

 *Quote:*   

> 30 Dec 2008; Doug Goldstein <cardoe@gentoo.org>
> 
>   +files/cairo-1.2.4-lcd-cleartype-like.diff, metadata.xml,
> 
>   cairo-1.8.6.ebuild:
> ...

 

----------

## devsk

 *aronparsons wrote:*   

> http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/cairo/ChangeLog?view=markup
> 
>  *Quote:*   30 Dec 2008; Doug Goldstein <cardoe@gentoo.org>
> 
>   +files/cairo-1.2.4-lcd-cleartype-like.diff, metadata.xml,
> ...

 Is this patch already in devnull overlay? Or is this what newspr does already?

----------

## devsk

Does anybody else notice that apps consume more memory over a period of time while using newspr and full hinting? My firefox is at 450MB at this time. Grew from 250MB to start with.

Similar trend with thunderbird and konqueror. Is this because of newspr or is it because of subpixel full hinting or is subpixel full hinting triggering some bug in nvidia driver? I have always used medium hinting without subpixel hinting and never faced this issue before.

----------

## PaulBredbury

Arch Linux's cairo doesn't currently apply any patches. Look at the pkgbuild for any sign of "patch" - none  :Wink: 

Click on "View SVN Entries", for those who can't see where to click. This is for version 1.8.6, as the current version.

----------

## devsk

```
*freetype-2.3.7-r1

  01 Jan 2009; Peter Alfredsen <loki_val@gentoo.org>

  +files/freetype-2.3.7-b.g.o-247104.patch,

  +files/freetype-2.3.7-b.g.o-253029.patch,

  +files/freetype-2.3.7-fix-incorrect-scaling.patch,

  +files/freetype-2.3.7-no-segfault-on-load_mac_face.patch,

  +freetype-2.3.7-r1.ebuild:

  Fix bug 247104, segfault in cffparse.c:361, bug 253029, missing letters in

  certain fonts, thanks to Andreas Turriff for the patch-pointer. Also

  import patches for alien bugs: http://bugs.debian.org/487101, segfault

  when building certain fonts and

  http://savannah.nongnu.org/bugs/index.php?23973 , incorrect scaling of

  certain fonts.

```

Are these patches applied in the devnull overlay?

PS: Happy New Year, folks!

----------

## yabbadabbadont

From looking at the ebuild, it doesn't look like it.  I didn't bother to compare the contents of the various patch files though, so it may be that they are getting applied.

What is strange to me though, is that after syncing portage and the overlay today, I see the update, but the ubuntu USE flag is being filtered out somehow...  at least that is how I'm interpreting the emerge output.

```
[ebuild     U ] media-libs/freetype-2.3.7-r1 [2.3.7] USE="X -bindist -debug -doc -utils (-ubuntu%*)" 0 kB [1=>0]

Total: 1 package (1 upgrade), Size of downloads: 0 kB

Portage tree and overlays:

 [0] /usr/portage

 [1] /usr/portage/local/layman/devnull

```

Edit: I think I need to re-read the portage docs...  I think this is telling me that portage is going to replace the overlay version with the one in the main tree.  Time to check the keywords on everything I think.

Edit2: DOH!  Duh...  2.3.7-r1 isn't in the overlay yet.  /me slinks away in shame.

----------

## F0RR

Guys, need help. All bold capital O and Q and bold 0 look kinda ot the way they should (Verdana font).

Like this:

http://img34.picoodle.com/img/img34/3/1/2/f_12308415516m_1c721af.png

It makes me crazy, 'cause everything else is ideal  :Laughing:  Anybody?

/etc/fonts/local.conf:

```
<?xml version="1.0"?>

<fontconfig>

   <match target="font">

      <edit name="autohint" mode="assign"><bool>false</bool></edit>

   </match>

   

    <match target="font">

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

    </match>

   

   <match target="font">

      <edit name="antialias" mode="assign"><bool>true</bool></edit>

   </match>

   

   <match target="font">

      <edit name="hinting" mode="assign"><bool>true</bool></edit>

      <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>

   </match>

   

    <match target="font">

      <test name="weight" compare="more_eq"><const>demibold</const></test>

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

      <edit name="antialias" mode="assign"><bool>true</bool></edit>

      <edit name="autohint" mode="assign"><bool>false</bool></edit>

      <edit name="hinting" mode="assign"><bool>true</bool></edit>

      <edit name="hintstyle" mode="assign"><const>hintmedium</const></edit>

    </match>

   

      <match target="pattern" name="family">

      <test name="family" qual="any"><string>Courier</string></test>

      <edit name="family" mode="assign">

         <string>Bitstream Vera Sans Mono</string>

      </edit>

   </match>

</fontconfig>
```

eselect fontconfig list:

```
  [1]   10-antialias.conf *

  [2]   10-autohint.conf

  [3]   10-hinting.conf *

  [4]   10-hinting-full.conf *

  [5]   10-hinting-medium.conf

  [6]   10-hinting-slight.conf

  [7]   10-no-sub-pixel.conf

  [8]   10-sub-pixel-bgr.conf

  [9]   10-sub-pixel-rgb.conf *

  [10]  10-sub-pixel-vbgr.conf

  [11]  10-sub-pixel-vrgb.conf

  [12]  10-unhinted.conf *

  [13]  11-lcd-filter-lcddefault.conf *

  [14]  20-fix-globaladvance.conf *

  [15]  20-unhint-small-vera.conf

  [16]  25-unhint-nonlatin.conf

  [17]  30-metric-aliases.conf *

  [18]  30-replace-bitmap-fonts.conf

  [19]  30-urw-aliases.conf *

  [20]  40-nonlatin.conf *

  [21]  45-latin.conf *

  [22]  49-sansserif.conf *

  [23]  50-user.conf *

  [24]  51-local.conf *

  [25]  52-languageselector.conf *

  [26]  53-monospace-lcd-filter.conf *

  [27]  59-dejavu.conf *

  [28]  60-latin.conf *

  [29]  60-liberation.conf *

  [30]  65-fonts-persian.conf *

  [31]  65-khmer.conf

  [32]  65-nonlatin.conf *

  [33]  69-odofonts.conf

  [34]  69-unifont.conf *

  [35]  70-no-bitmaps.conf

  [36]  70-yes-bitmaps.conf *

  [37]  80-delicious.conf *

  [38]  80-odofonts-original.conf

  [39]  80-odofonts-simulate-MS-simplified-chinese.conf

  [40]  80-odofonts-simulate-MS-triditional-chinese.conf

  [41]  90-synthetic.conf *

```

Thanks

----------

## mwhitlock

 *F0RR wrote:*   

> Guys, need help. All bold capital O and Q and bold 0 look kinda ot the way they should (Verdana font).
> 
> It makes me crazy, 'cause everything else is ideal  Anybody?

 

Are you using the autohinter or the BCI hinter?  Your font glyphs will look much closer to their intended shapes if you turn off hinting entirely.

----------

## devsk

 *F0RR wrote:*   

> 
> 
> eselect fontconfig list:
> 
> ```
> ...

 both of those are reverse of what you want if you want to use hinting.

----------

## F0RR

mwhitlock

BCI hinter. Without hinting bold fonts look too blurry. 

devsk

Both are overridden by /etc/fonts/local.conf. At least it seems so, because disabling 12 doesn't change anything. Everything looks wonderful, Os and 0s look ugly. Meh.

----------

## Evilguru

The new version of Cairo in portage seems to have fixed the problems which I was having earlier. Great news!

However, in both GNOME and KDE OpenOffice.org and Evince/Okular do not make use of sub pixel rendering. For Openoffice.org it is the entire interface that is affected, with not even the GTK-style menus making use of it. For Evince/Okular it is just the PDF rendering. Does anyone know if there is a patch available for poppler/OpenOffice.org to correct this?

Regards, Freddie.

----------

## ocin

devnull overlay is updated

There is a difference with cairo:

The "old" (that one with newspr) cairo is still in the overlay under x11-libs/cairo-1.8.6

The "new" (that one with clearype) is named x11-libs/cairo-1.8.6-r1

The "new" one does not apply cairo-04_lcd_filter.patch and cairo-respect-fontconfig.patch, it is using cairo-1.2.4-lcd-cleartype-like.diff instead.

Note: "cleartype", "newspr" and "ubuntu" useflags are enabled by default - you don't need to add them to package.use or use.conf

Please report any problems.

----------

## devsk

How does newspr differ from cleartype?

Is cleartype good enough replacement for newspr?

----------

## ocin

 *devsk wrote:*   

> How does newspr differ from cleartype?
> 
> Is cleartype good enough replacement for newspr?

 

I have to admit that I have not tested it yet.  :Twisted Evil: 

----------

## devsk

Since the overlay cairo has both, how do we know whether newspr is being used or cleartype? How do we switch?

It looks like my fonts have gone for the worse after the upgrade. Man, I spent so much time to set it a certain way and I have to do it all over again.

----------

## yabbadabbadont

 *devsk wrote:*   

> Since the overlay cairo has both, how do we know whether newspr is being used or cleartype? How do we switch?
> 
> It looks like my fonts have gone for the worse after the upgrade. Man, I spent so much time to set it a certain way and I have to do it all over again.

 

Simply downgrade to the previous version until such time as it all gets worked out.

----------

## ocin

As I have posted..

If you don't want the cleartype patch but the other ones, simply mask cairo-1.8.6-r1

tbh I can't see any difference, my fonts are as nice as before :)

----------

## AaronPPC

 *devsk wrote:*   

> How does newspr differ from cleartype?
> 
> Is cleartype good enough replacement for newspr?

 

I just upgraded and I approve.  Text, especially normal text, look even sharper and have a little more weight.  Anti-aliasing is also excellent.

I thought newspr was going to be as good as it got, but I'm sold on cleartype.

----------

## mwhitlock

You guys, we really shouldn't be calling this "ClearType."  The newspr patch was already controversial enough.  The very reason it's not integrated into the mainline is due to fears over patent infringement.  And now you want to call something "ClearType" straight out?  That's suicidal.

----------

## ocin

 *mwhitlock wrote:*   

> You guys, we really shouldn't be calling this "ClearType."  The newspr patch was already controversial enough.  The very reason it's not integrated into the mainline is due to fears over patent infringement.  And now you want to call something "ClearType" straight out?  That's suicidal.

 

Actually the patch is reads"cleartype-like". The useflag is called "cleartype" and thats how the gentoo guys named it.

----------

## mwhitlock

 *ocin wrote:*   

> Actually the patch is reads"cleartype-like". The useflag is called "cleartype" and thats how the gentoo guys named it.

 

I don't even think the word "ClearType" should be mentioned.  It just invites scrutiny.  But it's not my patch, so it's not my decision.  I just don't want to lose it, because I love it!

----------

## devsk

 *AaronPPC wrote:*   

>  *devsk wrote:*   How does newspr differ from cleartype?
> 
> Is cleartype good enough replacement for newspr? 
> 
> I just upgraded and I approve.  Text, especially normal text, look even sharper and have a little more weight.  Anti-aliasing is also excellent.
> ...

 which one do we get when both newspr and cleartype USE are defined?

Do we need to recompile libXft without newspr?

----------

## yabbadabbadont

The new cleartype patches seem to handle hinted bold fonts very well, while I had to disable it for bold fonts with newspr.

Edit: After browsing around the web for a while, I'm liking the new patches a lot better than the old ones.  Everything is very sharp and clear now.  (no pun intended)

----------

## devsk

Ok. found my issue. For some reason, I had 50-user.conf enabled and it has some weird stuff that the new patches don't like. I did 'eselect fontconfig disable 50-user.conf' and my fonts are looking good now.

Strangely, firefox and thunderbird were behaving differently. Firefox had weird fonts with 50-user.conf but thunderbird was fine with it. Now, both of them are fine. But its strange that there is something that makes them behave differently.

----------

## yabbadabbadont

```
/home/daffy $ cat /etc/fonts/conf.d/50-user.conf 

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

        <!-- Load per-user customization file -->

        <include ignore_missing="yes">~/.fonts.conf</include>

</fontconfig>

```

50-user.conf does nothing but include your personal configuration...  so the problem lies there.   :Wink: 

----------

## devsk

 *yabbadabbadont wrote:*   

> 
> 
> ```
> /home/daffy $ cat /etc/fonts/conf.d/50-user.conf 
> 
> ...

 Yeah, I know. I meant my ~/.fonts.conf has something that the new patches don't like. That file gets created every time I touch KDE font settings and it looks like a bug with KDE that file is not in sync with global settings although I select the same things like full hinting with RGB. So, I changed KDE to use system settings and got rid of that file.

----------

## F0RR

Thanks for new patch. Now everything is even better. But I still have problems with 0s and Os   :Crying or Very sad: 

Like this: http://img19.picoodle.com/img/img19/3/1/5/f_Screenshot5m_bd75d11.png

Help, please!  :Very Happy: 

----------

## ocin

 *F0RR wrote:*   

> Thanks for new patch. Now everything is even better. But I still have problems with 0s and Os  :cry: 
> 
> Like this: http://img19.picoodle.com/img/img19/3/1/5/f_Screenshot5m_bd75d11.png
> 
> Help, please! :D

 

Dunno bout O and 0 but you better disable lcd filtering for monospaced/fixed fonts (there is a config, user eselect fontconfig) so the quoted text will look fine too.

----------

## treellama

For me, USE=cleartype looks worse (lower contrast) than USE=newspr. This is probably because I don't use hinting. With hinting on, USE=cleartype looks a little better to me.

----------

## ocin

it highly depends on your settings, for me with cleartype, autohint, hintfull and lcdfilter my fonts are awesome and I don't have any problems with O or 0.

----------

## pezed

Does anyone have a list of things to mask off the top of their head to get fonts back to how they were say, last week with the devnull overlay?  After this last update of world my fonts look horrible, especially in kde apps.  no settings were changed with eselect.

*Edit*

heres a link to what i'm talking about, the I's and 1s especially look bad.  Fonts seem too thin overall.  has the previous freetype been completly removed from the overlay?

http://www.pezed.net/junk/bad_fonts.png

Another edit:  After much experimenting i got most of my fonts looking good again, but Segoe UI still has the problem with I's that it didn't have before.  Is there some patch that used to be included with the devnull freetype that isn't included now?

----------

## pezed

OK!  After a couple hours of experimentation i finally got things back looking good again.  KDE and GTK are displaying fonts the same way again, and the rendering is good.  In case anyone is wondering what i did:

add mask >=x11-libs/cairo-1.8.6-r1

re-emerge freetype, cairo, libXft, and fontconfig

use the following eselect fontconfig settings:

```
  [1]   10-antialias.conf *

  [2]   10-autohint.conf *

  [3]   10-hinting-full.conf

  [4]   10-hinting-medium.conf

  [5]   10-hinting-slight.conf *

  [6]   10-hinting.conf *

  [7]   10-no-sub-pixel.conf

  [8]   10-sub-pixel-bgr.conf

  [9]   10-sub-pixel-rgb.conf *

  [10]  10-sub-pixel-vbgr.conf

  [11]  10-sub-pixel-vrgb.conf

  [12]  10-unhinted.conf

  [13]  11-lcd-filter-lcddefault.conf *

  [14]  20-fix-globaladvance.conf *

  [15]  20-unhint-small-vera.conf *

  [16]  25-unhint-nonlatin.conf

  [17]  30-metric-aliases.conf *

  [18]  30-replace-bitmap-fonts.conf *

  [19]  30-urw-aliases.conf *

  [20]  40-nonlatin.conf *

  [21]  45-latin.conf *

  [22]  49-sansserif.conf *

  [23]  50-user.conf

  [24]  51-local.conf

  [25]  52-languageselector.conf *

  [26]  53-monospace-lcd-filter.conf *

  [27]  60-latin.conf *

  [28]  60-liberation.conf

  [29]  65-fonts-persian.conf *

  [30]  65-khmer.conf

  [31]  65-nonlatin.conf *

  [32]  69-unifont.conf *

  [33]  70-no-bitmaps.conf

  [34]  70-yes-bitmaps.conf

  [35]  80-delicious.conf *

  [36]  90-synthetic.conf *

```

I was about to lose my mind, especially after looking at my kubuntu laptop that still had nice fonts!

----------

## mwhitlock

 *pezed wrote:*   

> OK!  After a couple hours of experimentation i finally got things back looking good again.  KDE and GTK are displaying fonts the same way again, and the rendering is good.  In case anyone is wondering what i did:
> 
> add mask >=x11-libs/cairo-1.8.6-r1

 

So in other words, don't use the cleartype-like patchset but rather newspr.

----------

## pezed

 *mwhitlock wrote:*   

>  *pezed wrote:*   OK!  After a couple hours of experimentation i finally got things back looking good again.  KDE and GTK are displaying fonts the same way again, and the rendering is good.  In case anyone is wondering what i did:
> 
> add mask >=x11-libs/cairo-1.8.6-r1 
> 
> So in other words, don't use the cleartype-like patchset but rather newspr.

 

yes for sure.  with the cleartype patched version, fonts in gtk apps looked too blurry as compared to kde apps, on my screen at least.

----------

## mwhitlock

 *pezed wrote:*   

> yes for sure.  with the cleartype patched version, fonts in gtk apps looked too blurry as compared to kde apps, on my screen at least.

 

KDE doesn't use Cairo for its font rasterization, so that would explain the difference.

Frankly, I don't know what all the confusion is about.  As I understand it, upstream FreeType now supports rasterizing font glyphs using subpixel filtering.  Shouldn't libXft, cairo, and qt4 all simply be using the pixmaps directly from FreeType without altering them?  It seems like everyone is trying to do their own tweaks, and we wind up with a "too many cooks spoil the broth" situation.  Am I missing something?

----------

## pezed

 *mwhitlock wrote:*   

>  *pezed wrote:*   yes for sure.  with the cleartype patched version, fonts in gtk apps looked too blurry as compared to kde apps, on my screen at least. 
> 
> KDE doesn't use Cairo for its font rasterization, so that would explain the difference.
> 
> Frankly, I don't know what all the confusion is about.  As I understand it, upstream FreeType now supports rasterizing font glyphs using subpixel filtering.  Shouldn't libXft, cairo, and qt4 all simply be using the pixmaps directly from FreeType without altering them?  It seems like everyone is trying to do their own tweaks, and we wind up with a "too many cooks spoil the broth" situation.  Am I missing something?

 

I highly agree with that statement.  Relying upon one lib such as freetype for the entire system makes everything more consistant.  I think the problem currently maybe some issues with copyright infringement on the code freetype uses.  

I just know that with newspr enabled and properly configured, my systems fonts look amazing, better than I've seen on any other OS (including MacOSX/Vista).  Very sharp and easy on the eyes.  It would be nice if this font rendering could somehow become the default in gentoo.  Looking at gentoo screenshots on this forum, its "clear" that many users would benefit from better fonts!   :Laughing: 

----------

## F0RR

pezed, could you post your font configs here?

----------

## pezed

 *F0RR wrote:*   

> pezed, could you post your font configs here?

 

a couple of posts up i showed my eselect fontconfig list

i haven't changed any other configs.

----------

## Phlogiston

Is this tar+http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2 still updated?

----------

## bi3l

 *Phlogiston wrote:*   

> Is this tar+http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2 still updated?

 

It will be as soon as I can find some time to work on it..

----------

## devsk

Does anyone else see a memory leak in firefox because of subpixel full hinting?

```
18777 ilame   20   0 1459m 976m  18m S    5 24.7 190:37.09 firefox
```

Thats a gig of my RAM....  :Shocked: 

I don't get such a leak if I don't use subpixel hinting at full.

----------

## Phlogiston

 *bi3l wrote:*   

>  *Phlogiston wrote:*   Is this tar+http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2 still updated? 
> 
> It will be as soon as I can find some time to work on it..

 

No problem, or is a newer version somewhere in an overlay? Anyway what about this new cleartype? Can someone please sum the changes up?

----------

## yabbadabbadont

Just as a test, I removed the overlay and tried just using the keyword masked versions in the main portage tree.  The difference is so slight (for me at least), that I am just sticking with the packages in the main tree for now.

Edit: Here are the versions and USE flags I'm using.  I would be interested to hear if anyone else has the same experience.

```
$ emerge -pv libXft freetype fontconfig cairo

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] media-libs/freetype-2.3.7-r1  USE="X -bindist -debug -doc -utils" 0 kB

[ebuild   R   ] media-libs/fontconfig-2.6.0-r2  USE="-doc" 0 kB

[ebuild   R   ] x11-libs/libXft-2.1.13  USE="-debug" 0 kB

[ebuild   R   ] x11-libs/cairo-1.8.6  USE="X cleartype opengl svg -debug -directfb -doc -glitz -xcb" 0 kB

Total: 4 packages (4 reinstalls), Size of downloads: 0 kB

```

Last edited by yabbadabbadont on Wed Jan 07, 2009 8:26 pm; edited 1 time in total

----------

## Phlogiston

 *yabbadabbadont wrote:*   

> Just as a test, I removed the overlay and tried just using the keyword masked versions in the main portage tree.  The difference is so slight (for me at least), that I am just sticking with the packages in the main tree for now.

 

interesting, what versions and useflag do you use? cleartype?

----------

## yabbadabbadont

I guess I was editing my original post with the information you requested, as you were requesting it...   :Very Happy: 

----------

## devsk

 *yabbadabbadont wrote:*   

> Just as a test, I removed the overlay and tried just using the keyword masked versions in the main portage tree.  The difference is so slight (for me at least), that I am just sticking with the packages in the main tree for now.
> 
> Edit: Here are the versions and USE flags I'm using.  I would be interested to hear if anyone else has the same experience.
> 
> ```
> ...

 

I thought you will need at least the latest pixman apart from these. pixman in portage is older than the one in devnull. When I started out with this, until I upgraded my pixman, I had horrible fonts.

----------

## yabbadabbadont

 *devsk wrote:*   

> I thought you will need at least the latest pixman apart from these. pixman in portage is older than the one in devnull. When I started out with this, until I upgraded my pixman, I had horrible fonts.

 

pixman-0.12.0 is in the portage tree, just keyword masked.

----------

## bi3l

I've updated the tarball:

- freetype to 2.3.7-r1 (latest ubuntu, archlinux and portage patches)

- cairo to 1.8.6 (latest ubuntu and archlinux patches)

- libXft to 2.1.13 (latest archlinux patches)

I've also added pixman 0.13.2 (shamelessly stolen from devnull   :Wink:  )

----------

## yabbadabbadont

 *bi3l wrote:*   

> I've updated the tarball:
> 
> - freetype to 2.3.7-r1 (latest ubuntu, archlinux and portage patches)
> 
> - cairo to 1.8.6 (latest ubuntu and archlinux patches)
> ...

 

Once again, thank you for your efforts.  (even if I don't make use of them now  :Very Happy: )

----------

## ocin

 *bi3l wrote:*   

> I've updated the tarball:
> 
> - freetype to 2.3.7-r1 (latest ubuntu, archlinux and portage patches)
> 
> - cairo to 1.8.6 (latest ubuntu and archlinux patches)
> ...

 

No probem, I stole some stuff from you too :p

----------

## Phlogiston

What do you recommend now? Cleartype or those other patches? Or all of them? I'm still confused   :Cool: 

----------

## ocin

 *Phlogiston wrote:*   

> What do you recommend now? Cleartype or those other patches? Or all of them? I'm still confused  8)

 

cleartype. newspr is dead in devnull (and gentoo-lcdfiltering)

I have updated the devnull overlay, we are now in sync with gentoo-lcd-filtering.tar.bz2.

bi3l: if you want access to the overlay for doing this font stuff pm me so we don't have to do double work (our ebuilds were nearly the same anyway)

devnull users: please rebuild cairo libXft and freetype, then revise your fontconfig settings and post here if you have any problems with the cleartype stuff.

edit: http://nico.core.ws/tmp/cleartype.png here is a screenshot so you can see what it looks like with this settings* - different but nice.

* different monitors render differently so it may be possible that you get other results. also you can't screenshot subpixel rendering.

----------

## Cyberstudio

 *ocin wrote:*   

>  *Phlogiston wrote:*   What do you recommend now? Cleartype or those other patches? Or all of them? I'm still confused   
> 
> cleartype. newspr is dead in devnull (and gentoo-lcdfiltering)
> 
> I have updated the devnull overlay, we are now in sync with gentoo-lcd-filtering.tar.bz2.
> ...

 

Im new to all of this stuff, just whant to know... if i unmask cairo and build it with cleartype and restart X, i will get pretty font rendering? or also i need to configure something?

----------

## ocin

You need to add devnull overlay, and install fontconfig freetype libXft and cairo from there, after that make sure you have the fontconfig module for eselect (eselect-fontconfig) and then adjust your settings with it. My configuration looks like: http://nico.core.ws/tmp/eselect_fontconfig_list You can play around with it until you are statisfied (like trying different hinting styles, autohint y/n, subpixel etc.)

----------

## din_vl

 *ocin wrote:*   

> You need to add devnull overlay, and install fontconfig freetype libXft and cairo from there, after that make sure you have the fontconfig module for eselect (eselect-fontconfig) and then adjust your settings with it. My configuration looks like: http://nico.core.ws/tmp/eselect_fontconfig_list You can play around with it until you are statisfied (like trying different hinting styles, autohint y/n, subpixel etc.)

 

Hi. I am new to gentoo.

I installed devnull overlay.

When i try to install fontconfig i get : 

"Please rebuild freetype-2 with ubuntu enabled."

i can't find freetype-2 with emerge. 

anyone can help?

----------

## ocin

 *din_vl wrote:*   

>  *ocin wrote:*   You need to add devnull overlay, and install fontconfig freetype libXft and cairo from there, after that make sure you have the fontconfig module for eselect (eselect-fontconfig) and then adjust your settings with it. My configuration looks like: http://nico.core.ws/tmp/eselect_fontconfig_list You can play around with it until you are statisfied (like trying different hinting styles, autohint y/n, subpixel etc.) 
> 
> Hi. I am new to gentoo.
> 
> I installed devnull overlay.
> ...

 

if you get this error you are not using freetype from devnull overlay. after adding devnull overlay, "emerge -auvDN @world" should do it.

----------

## din_vl

 *ocin wrote:*   

>  *din_vl wrote:*    *ocin wrote:*   You need to add devnull overlay, and install fontconfig freetype libXft and cairo from there, after that make sure you have the fontconfig module for eselect (eselect-fontconfig) and then adjust your settings with it. My configuration looks like: http://nico.core.ws/tmp/eselect_fontconfig_list You can play around with it until you are statisfied (like trying different hinting styles, autohint y/n, subpixel etc.) 
> 
> Hi. I am new to gentoo.
> 
> I installed devnull overlay.
> ...

 

Thanks. Got it.

But, whats better upgrade only freetype (only what i need) or better upgrade all world?

Is it save to upgrade world?   :Rolling Eyes: 

----------

## Hell-Razor

Is there a new link to the how-to? I have dug through about 20 ish pages with no luck...

----------

## Cyberstudio

I found this howto.

Will try to follow it and see what i can get.

http://linuxtidbits.wordpress.com/2008/11/25/better-lcd-font-rendering/

----------

## ocin

 *din_vl wrote:*   

>  *ocin wrote:*    *din_vl wrote:*    *ocin wrote:*   You need to add devnull overlay, and install fontconfig freetype libXft and cairo from there, after that make sure you have the fontconfig module for eselect (eselect-fontconfig) and then adjust your settings with it. My configuration looks like: http://nico.core.ws/tmp/eselect_fontconfig_list You can play around with it until you are statisfied (like trying different hinting styles, autohint y/n, subpixel etc.) 
> 
> Hi. I am new to gentoo.
> 
> I installed devnull overlay.
> ...

 

sure it's safe to update world. the newest packages are in world waiting for update after sync, however if you only want to rebuild or update one package which already is installed use "emerge -1 packagename"

@Cyberstudio: The howto you have posted is still valid.

----------

## mwhitlock

Since no one has posted a comparison, I'm stepping up.

http://home.mattwhitlock.com/~mattw/newspr_vs_cleartype-like.html

The two are very similar, but there are tiny differences.  Personally, I like the newspr better (it looks a little sharper), but it's not a big enough difference for me to complain in the face of forward progress.

----------

## zigver

 *mwhitlock wrote:*   

> Personally, I like the newspr better (it looks a little sharper), but it's not a big enough difference for me to complain in the face of forward progress.

 

I've compared with and without cleartype-like on my system and concluded the same.

----------

## ocin

yeah, newspr is imho a bit better than cleartype too (btw: the screenshot does not exactly reflevt how it looks on the monitor) but since gentoo is using the cleartype patches it's easier to use that. Also nice to see how the font rendering is getting better and better with every update of the packages and or patches :)

----------

## Hell-Razor

WELL I dont see any how-tos to make my shitti font any better...

----------

## pezed

I've switched to the gentoo portage freetype and cairo and its just not as good as the newspr was.  Spacing seems wrong and i'm seeing red fringing on letters.  Hopefully it will improve though.  Is there some reason why the "newspr" can't continue to be included on the devnull overlay?

----------

## ocin

 *pezed wrote:*   

> I've switched to the gentoo portage freetype and cairo and its just not as good as the newspr was.  Spacing seems wrong and i'm seeing red fringing on letters.  Hopefully it will improve though.  Is there some reason why the "newspr" can't continue to be included on the devnull overlay?

 

laziness + portage compability.Last edited by ocin on Mon Jan 12, 2009 1:17 pm; edited 1 time in total

----------

## swimmer

ROFL   :Cool: 

----------

## Phlogiston

You always use ff to compare the fonts. But do other apps pickup your font settings? For example opera does not here. Neiter some native qt apps.

Any hint?

/edit: Not sure why, but it works now  :Smile: 

----------

## mwhitlock

 *Phlogiston wrote:*   

> You always use ff to compare the fonts. But do other apps pickup your font settings? For example opera does not here. Neiter some native qt apps. Any hint?

 

Qt doesn't use Cairo.  And Qt4 doesn't even use libXft.

----------

## bi3l

I've updated the tarball with freetype 2.3.8 (gentoo-lcd-filtering.tar.bz2).

----------

## Abraxas

Personally I think cleartype is much worse, at least with light text on a dark background.  I am using a dark theme and the light text looks multicolored instead of off-white.  Text is much clearer when I turn cleartype off.

----------

## IvanMajhen

This is how my fonts looks like:

Firefox:

http://www.shrani.si/f/1w/yZ/4zb7mX5x/snapshot12.png

Openoffice:

http://www.shrani.si/f/1f/CW/32Tq4tft/snapshot17.png

KDE 3.5.

http://www.shrani.si/f/1f/vD/4r07KWla/1/snapshot14.png

VLC (QT4)

http://www.shrani.si/f/1v/bY/4B8jsqwz/snapshot16.png

Opera (QT4)

http://www.shrani.si/f/3Q/Fz/DGuj1cL/snapshot18.png

Don't know why qt4 fonts are little lighter....

----------

## yabbadabbadont

 *IvanMajhen wrote:*   

> Don't know why qt4 fonts are little lighter....

 

Probably because QT doesn't use the libraries these patches change to render fonts.  At least that is what has been said (many times) earlier in this thread.   :Smile: 

(and do you think it wise to advertise to the world that you are watching a pirated movie?   :Wink: )

----------

## IvanMajhen

It is trailer.  :Razz: 

Which other libraries? Freetype, libxft and fontconfig are the same. Cairo is not used in qt.

----------

## mwhitlock

 *IvanMajhen wrote:*   

> It is trailer. 
> 
> Which other libraries? Freetype, libxft and fontconfig are the same. Cairo is not used in qt.

 

I believe this should answer your question (and all other related questions) once and for all:

http://labs.trolltech.com/blogs/2008/09/01/subpixel-antialiasing-on-x11/

----------

## PinguinoLoco

Hi. I'm new too gentoo and after following these font threads I'm not 100% satisfied with my fonts (although they have improved greatly). I have quite a few doubts:

1) I have freetype compiled to include the BCI code but I'm not sure on how it works...

Does the -bindist use flag generate code for both autohint and BCI hinting methods?

Does the autohint option in fontconfig select the hinting method (on=autohint, off=BCI)?

Do free fonts include information for the BCI hinter? If they don't, would they render worse than with autohint?

Would it be possible to select the hinting method between autohint and BCI for each font or font directory?

If using BCI hinting, does the selectiong of hinting type (slight, medium, full) have any effect?

2) I'm using devnull overlay with cleartype enabled and enabling the lcd filter does not seem to make any difference (11-lcd-filter-lcddefault.conf). Also, setting it on and changind the filer mode (lcdslight, lcddefault, lcdlegacy) doesn't show a difference. I suspect I may have something wrong and it is not being applied.

Does the filter depend on other settings to be applied?

Is the lcd-filter compatible with the antialias setting in fontconfig or do we have to choose one?

3) KDE 4.2 fonts look great for me. They are sharp and thin. Fonts for GTK and KDE 3.5 apps look good, but they are heavier (someone also mentioned this issue earlier). I know QT4, QT3, Cairo and GTK render differently, but is it possible to set all fonts to look as light as on KDE 4.2?

4) Okular does not use subpixel hinting for me. I've read a comment from another user stating the same issue. I guess it is a okular/poppler issue. Can something be done via font configuration?

Thanks in advance for your support.Last edited by PinguinoLoco on Thu Feb 05, 2009 11:46 am; edited 2 times in total

----------

## natros

I think I like the cleartype but the cleartype patch for libXft is not as good the the one for the cairo. There's a small difference between gtk aplications and non gtk applications. I'm looking forward to see  an improved patch for libXft.

----------

## ssmaxss

I am having problems with font renderigns on some websites using some font sizes. For example on http://blogs.msdn.com/tims/archive/2009/01/12/the-bumper-list-of-windows-7-secrets.aspx

http://img14.imageshack.us/img14/7002/35842846.png

If I increase size of webpage all text becomes good-looking: http://img5.imageshack.us/img5/9536/81911550.png

```
  [1]   10-autohint.conf *

  [2]   10-no-sub-pixel.conf

  [3]   10-sub-pixel-bgr.conf

  [4]   10-sub-pixel-rgb.conf *

  [5]   10-sub-pixel-vbgr.conf

  [6]   10-sub-pixel-vrgb.conf

  [7]   10-unhinted.conf

  [8]   20-fix-globaladvance.conf *

  [9]   20-unhint-small-vera.conf *

  [10]  25-unhint-nonlatin.conf

  [11]  30-metric-aliases.conf *

  [12]  30-urw-aliases.conf *

  [13]  40-nonlatin.conf *

  [14]  45-latin.conf *

  [15]  49-sansserif.conf *

  [16]  50-user.conf

  [17]  51-local.conf

  [18]  59-dejavu.conf *

  [19]  60-latin.conf *

  [20]  65-fonts-persian.conf *

  [21]  65-khmer.conf

  [22]  65-nonlatin.conf *

  [23]  69-unifont.conf *

  [24]  70-no-bitmaps.conf *

  [25]  70-yes-bitmaps.conf

  [26]  80-delicious.conf *

  [27]  90-synthetic.conf *

```

I am using latest packages from devnull overlay.

----------

## Evilguru

I am using the lcd-filtering overlay (-ubuntu, +cleartype) and while GTK applications (including Firefox) look fantastic, Qt (4.5.0-rc1, ~AMD64) for some reason using grayscale AA as opposed to subpixel hinting. Furthermore, OpenOffice.org (3.0.1, GTK) also only uses grayscale AA.

Here is my fontconfig stuff:

```

iodine freddie # eselect fontconfig list

Available fontconfig .conf files ( * is enabled ):

  [1]   10-autohint.conf *

  [2]   10-no-sub-pixel.conf

  [3]   10-sub-pixel-bgr.conf

  [4]   10-sub-pixel-rgb.conf *

  [5]   10-sub-pixel-vbgr.conf

  [6]   10-sub-pixel-vrgb.conf

  [7]   10-unhinted.conf

  [8]   20-fix-globaladvance.conf *

  [9]   20-unhint-small-vera.conf *

  [10]  25-unhint-nonlatin.conf

  [11]  30-metric-aliases.conf *

  [12]  30-urw-aliases.conf *

  [13]  40-nonlatin.conf *

  [14]  45-latin.conf *

  [15]  49-sansserif.conf *

  [16]  50-user.conf *

  [17]  51-local.conf *

  [18]  60-latin.conf *

  [19]  65-fonts-persian.conf *

  [20]  65-khmer.conf

  [21]  65-nonlatin.conf *

  [22]  69-unifont.conf *

  [23]  70-no-bitmaps.conf *

  [24]  70-yes-bitmaps.conf

  [25]  80-delicious.conf *

  [26]  90-synthetic.conf *

```

Qt stuff:

```

iodine freddie # emerge -av qt-gui

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] x11-libs/qt-gui-4.5.0_rc1-r1  USE="accessibility cups dbus glib gtkstyle pch raster -custom-cxxflags -debug -mng -nas -nis -qt3support -tiff -xinerama" 0 kB

```

Font stuff:

```

iodine freddie # emerge -av freetype fontconfig cairo libXft

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] media-libs/freetype-2.3.8  USE="X cleartype -bindist -debug -doc -fontforge -ubuntu -utils" 0 kB [1]

[ebuild   R   ] media-libs/fontconfig-2.6.0-r2  USE="-doc -ubuntu" 0 kB [1]

[ebuild   R   ] x11-libs/libXft-2.1.13  USE="cleartype -debug -ubuntu" 0 kB [1]

[ebuild   R   ] x11-libs/cairo-1.8.6  USE="X cleartype glitz opengl svg xcb -debug -directfb -doc -ubuntu" 0 kB [1]

Total: 4 packages (4 reinstalls), Size of downloads: 0 kB

Portage tree and overlays:

 [0] /usr/portage

 [1] /usr/local/portage/layman/lcd-filtering

```

Can anyone help me. Qt applications really are starting to stand out as quite ugly beasts. (Qt4 apps, I have no Qt3 applications on the system.)

Regards, Freddie.

----------

## ssmaxss

Evilguru

Try to disable

  [16]  50-user.conf *

  [17]  51-local.conf *

----------

## Evilguru

 *ssmaxss wrote:*   

> Evilguru
> 
> Try to disable
> 
>   [16]  50-user.conf *
> ...

 

No effect.

```

freddie@iodine ~ $ eselect fontconfig list

Available fontconfig .conf files ( * is enabled ):

  [1]   10-autohint.conf *

  [2]   10-no-sub-pixel.conf

  [3]   10-sub-pixel-bgr.conf

  [4]   10-sub-pixel-rgb.conf *

  [5]   10-sub-pixel-vbgr.conf

  [6]   10-sub-pixel-vrgb.conf

  [7]   10-unhinted.conf

  [8]   20-fix-globaladvance.conf *

  [9]   20-unhint-small-vera.conf *

  [10]  25-unhint-nonlatin.conf

  [11]  30-metric-aliases.conf *

  [12]  30-urw-aliases.conf *

  [13]  40-nonlatin.conf *

  [14]  45-latin.conf *

  [15]  49-sansserif.conf *

  [16]  50-user.conf

  [17]  51-local.conf

  [18]  60-latin.conf *

  [19]  65-fonts-persian.conf *

  [20]  65-khmer.conf

  [21]  65-nonlatin.conf *

  [22]  69-unifont.conf *

  [23]  70-no-bitmaps.conf *

  [24]  70-yes-bitmaps.conf

  [25]  80-delicious.conf *

  [26]  90-synthetic.conf *

```

.

Qt4 applications (and OpenOffice, but that is more of an outcast) do not use subpixel hinting.

Regards, Freddie.

----------

## ssmaxss

That several hourse of my use of qt 4.5 I haven't noticed any problems with fonts. I was using devnull overlay though. Maybe you should try it?

----------

## ocin

I have improved the freetype[cleartype] ebuild a litte. We only have libXft and freetype in devnull overlay now, which is enough for cleartype+lcdfilter.

We are also working on a set of ebuilds which is gonna support cleartype and ubuntu patches. However there are issues with the ubuntu patches, they don't really work yet. We hope we can fix this soon, until then you have to use cleartype with lcdfilter (which does look great too, the only disadvantage is wrong spacing with tiny fonty like the very last line in the footer of this page, but isn't a problem for me :)

Btw: I get great results with: cleartype: autohint + hinting + hintfull and subpixel rendering turned on in fontconfig.

Also I have opened a bug to get freetype and libXft with cleartype useflag into portage, you can vote for it if you want.Last edited by ocin on Tue Feb 24, 2009 2:23 pm; edited 2 times in total

----------

## bi3l

 *ocin wrote:*   

> I am also working

 

WE ARE also working...

----------

## ocin

 *bi3l wrote:*   

>  *ocin wrote:*   I am also working 
> 
> WE ARE also working...

 

Sorry  :Embarassed: 

Also thank you for the ebuilds with the ubuntu patches  :Smile: 

----------

## yabbadabbadont

 *bi3l wrote:*   

>  *ocin wrote:*   I am also working 
> 
> WE ARE also working...

 

Is that the Royal plural?   :Wink: 

----------

## ssmaxss

 *ocin wrote:*   

> 
> 
> Btw: I get great results with: cleartype: autohint + hinting + hintfull + lcdfilter-lcddefault and subpixel rendering turned on in fontconfig.
> 
> 

 

Which package provides hintfull.conf, lcdfilter.conf? fontconfig from portage doesn't have them, devnull overlay lacks fontconfig package.

BTW: media-libs/freetype's manifest in devnull has hashes for removed patches.

----------

## Evilguru

I have switched to the devnull overlay and (re-)emerge fontconfig libXft and cairo. (Freetype would not emerge due to a dodgy manifest file.)

In short: no change. GTK+ applications still look great, Qt applications are still not using subpixel rendering.

```

freddie@iodine ~/Music/Eagles/The Best Of Eagles $ eselect fontconfig list

Available fontconfig .conf files ( * is enabled ):

  [1]   10-autohint.conf *

  [2]   10-no-sub-pixel.conf

  [3]   10-sub-pixel-bgr.conf

  [4]   10-sub-pixel-rgb.conf *

  [5]   10-sub-pixel-vbgr.conf

  [6]   10-sub-pixel-vrgb.conf

  [7]   10-unhinted.conf

  [8]   20-fix-globaladvance.conf *

  [9]   20-unhint-small-vera.conf *

  [10]  25-unhint-nonlatin.conf

  [11]  30-metric-aliases.conf *

  [12]  30-urw-aliases.conf *

  [13]  40-nonlatin.conf *

  [14]  45-latin.conf *

  [15]  49-sansserif.conf *

  [16]  50-user.conf *

  [17]  51-local.conf *

  [18]  60-latin.conf *

  [19]  65-fonts-persian.conf *

  [20]  65-khmer.conf

  [21]  65-nonlatin.conf *

  [22]  69-unifont.conf *

  [23]  70-no-bitmaps.conf *

  [24]  70-yes-bitmaps.conf

  [25]  80-delicious.conf *

  [26]  90-synthetic.conf *

```

Regards, Freddie.

----------

## ssmaxss

To emerge freetype you can go to /usr/local/layman/devnull/media-libs/freetype and do 

```
ebuild freetype-...-.ebuild digest
```

 to recreate broken manifest.

----------

## ssmaxss

Are you using KDE? What are your settings for fonts in systemsettings->Appearence?

----------

## Evilguru

 *ssmaxss wrote:*   

> Are you using KDE? What are your settings for fonts in systemsettings->Appearence?

 

I am using GNOME. (Portage ~AMD64.)

Regards, Freddie.

----------

## ocin

Digestes are fixed.

You will miss most 10-* (aa+hinting) configs, I'm looking into that.Last edited by ocin on Tue Feb 24, 2009 2:26 pm; edited 2 times in total

----------

## paladin-zero

 *Evilguru wrote:*   

> 
> 
> Qt4 applications (and OpenOffice, but that is more of an outcast) do not use subpixel hinting.
> 
> 

 

Try running qtconfig. Select the "Fonts" tab, change "Family" from the generic "Sans Serif" (or whatever you have listed there) to something like DejaVu Sans or Bitstream Vera Sans, and make sure you have "Style" set to "Normal".

----------

## ocin

Changes:

- re-added fontconfig with ubuntu-05_add_hinting_and_antialiasing_confs.patch

- removed IUSE defaults (just enable the cleartype useflag globally)

----------

## ssmaxss

Fontconfig won't install 

```
emerge: there are no ebuilds built with USE flags to satisfy ">=media-libs/freetype-2.2.1[-ubuntu]".

```

Because there is no ubuntu flag at all in freetype from devnull.

Couldn't it be tested somehow? I heard about tool called repoman. Could it detect such errors?

BTW: there is no USE flag called ubuntu in fontconfig from devnull. So expressions like 

```
RDEPEND="ubuntu? ( >=media-libs/freetype-2.2.1[ubuntu,-cleartype] )

    !ubuntu? ( >=media-libs/freetype-2.2.1[-ubuntu] )

```

 seems wrong.

----------

## ocin

duuuuuuh forgot to change that, fixed.

----------

## ssmaxss

Thanks!

----------

## swimmer

```
>>> Verifying ebuild manifests

!!! A file listed in the Manifest could not be found: /usr/portage/local/layman/devnull/media-libs/freetype/files/331-hmtx-no-shorts.diff
```

 :Wink: 

----------

## ssmaxss

Update your overlay and it will go away.

----------

## swimmer

I updated it right before I posted the error message  :Wink: 

But anyway - it's easy to fix. I just wanted to inform the overlay maintainers ...

Greetz

swimmer

----------

## ssmaxss

Is it about lcd-filtering overlay? In devnull overlay there is no such file and line in manifest, so evertithing is ok

----------

## Evilguru

I have now fully switched to the newest version of the devnull overlay:

```

freddie@iodine ~ $ eselect fontconfig list

Available fontconfig .conf files ( * is enabled ):

  [1]   10-antialias.conf *

  [2]   10-autohint.conf *

  [3]   10-hinting.conf *

  [4]   10-hinting-full.conf

  [5]   10-hinting-medium.conf

  [6]   10-hinting-slight.conf *

  [7]   10-no-sub-pixel.conf

  [8]   10-sub-pixel-bgr.conf

  [9]   10-sub-pixel-rgb.conf *

  [10]  10-sub-pixel-vbgr.conf

  [11]  10-sub-pixel-vrgb.conf

  [12]  10-unhinted.conf

  [13]  20-fix-globaladvance.conf *

  [14]  20-unhint-small-vera.conf *

  [15]  25-unhint-nonlatin.conf

  [16]  30-metric-aliases.conf *

  [17]  30-urw-aliases.conf *

  [18]  40-nonlatin.conf *

  [19]  45-latin.conf *

  [20]  49-sansserif.conf *

  [21]  50-user.conf

  [22]  51-local.conf

  [23]  60-latin.conf *

  [24]  65-fonts-persian.conf *

  [25]  65-khmer.conf

  [26]  65-nonlatin.conf *

  [27]  69-unifont.conf *

  [28]  70-no-bitmaps.conf *

  [29]  70-yes-bitmaps.conf

  [30]  80-delicious.conf *

  [31]  90-synthetic.conf *

```

and

```

iodine freddie # emerge -av fontconfig libXft freetype cairo

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] media-libs/freetype-2.3.8  USE="X cleartype -bindist -debug -doc -fontforge -utils" 0 kB [1]

[ebuild   R   ] media-libs/fontconfig-2.6.0-r2  USE="cleartype -doc" 0 kB [1]

[ebuild   R   ] x11-libs/libXft-2.1.13  USE="cleartype -debug" 0 kB [1]

[ebuild   R   ] x11-libs/cairo-1.8.6-r1  USE="X cleartype glitz opengl svg xcb -debug -directfb -doc" 0 kB [0]

Total: 4 packages (4 reinstalls), Size of downloads: 0 kB

Portage tree and overlays:

 [0] /usr/portage

 [1] /usr/local/portage/layman/devnull

```

Qt4 applications still do not use subpixel rendering. Fail. How can I debug this?

Regards, Freddie.

----------

## ssmaxss

It could be problems in some user-specific configs. Try creating new user with empty home directory and see if font rendering will improve

----------

## paladin-zero

 *Evilguru wrote:*   

> I have now fully switched to the newest version of the devnull overlay:
> 
> [...]
> 
> Qt4 applications still do not use subpixel rendering. Fail. How can I debug this?
> ...

 

I responded to you on page 4 of this thread with a suggestion. Did you try it?

----------

## paladin-zero

 *ssmaxss wrote:*   

> Try creating new user with empty home directory and see if font rendering will improve

 

I dont think this will help. For some reason, Qt does not use subpixel rendering when the font family in qtconfig is set to the default, generic "sans serif". Changing to DejaVu Sans or Bitstream Vera Sans should solve the problem.

----------

## bi3l

Moreover, 50-user.conf is not enabled.

----------

## Evilguru

 *paladin-zero wrote:*   

>  *Evilguru wrote:*   I have now fully switched to the newest version of the devnull overlay:
> 
> [...]
> 
> Qt4 applications still do not use subpixel rendering. Fail. How can I debug this?
> ...

 

I did. I set it to Bitstream Vera Sans. Saved it, quit Qt config. However, when I restart Qt config it went back to "Sans Serif". This happened irrespective of what font I selected as the default font. This I believe is because I use the GTK+ style. However, it is inconsequential, as if I change my theme to Plastique and change the font (which does 'stick') there is still no subpixel rendering.

Therefore the choice of font does not seem to have an effect, neither does the chosen style. Furthermore enabling 50-user.conf has no visible effect.

Edit: A screenshot: http://freddie.witherden.org/drop/fonts.png Notice the the GNOME terminal is well rendered, but qtconfig is not. 

Regards, Freddie.

----------

## paladin-zero

 *Evilguru wrote:*   

>  *paladin-zero wrote:*    *Evilguru wrote:*   I have now fully switched to the newest version of the devnull overlay:
> 
> [...]
> 
> Qt4 applications still do not use subpixel rendering. Fail. How can I debug this?
> ...

 

Do you have a default font set in .Xresources or something like that? Thats a wild guess. I have no idea why qtconfig would not respect your changes (unless you didnt save them but thought you did).

----------

## Evilguru

 *paladin-zero wrote:*   

>  *Evilguru wrote:*    *paladin-zero wrote:*    *Evilguru wrote:*   I have now fully switched to the newest version of the devnull overlay:
> 
> [...]
> 
> Qt4 applications still do not use subpixel rendering. Fail. How can I debug this?
> ...

 

I suspect this is because I use the GTK+ style (so uses some freedesktop voodoo to get the GNOME font, which is probably sans serif -- I'll check). However, since it still refuses to use subpixel rendering when another style is used (where setting/changing the font does work as expected) I suspect there is another issue at play here.

Edit: Yes the Qt font is linked to that chosen in GNOME when using the GTK+ style. As expected, changing it in GNOME to bitstream vera sans has no effect. (Although qtconfig does show that instead of sans for the font.)

Regards, Freddie.

----------

## PinguinoLoco

Hi again. Can anyone else comment if okular is doing subpixel hinting for him/her? It does grayscale hinting here and it gives me a headache. I installed Acrobat Reader and it renders fonts with subpixel hinting, but I'd preferto use okular if possible (I'm running 64 bits).

I tried evince too and can't get subpixel hinting either. All other apps I'm running (except wine) render good fonts.

----------

## ssmaxss

For me okular from kde 4.2.0 from portage looks as good as all other apps.

----------

## PinguinoLoco

Thanks for answering ssmaxss. It must be a configuration problem on my side then. Just to clarify, I get subpixel hinting in the interface but not in the render of the PDF.

----------

## ssmaxss

These are my screenshots of text pdf at different sizes. Looks quite odd on smaller though:

http://img17.imageshack.us/img17/5570/74196637jw3.png

http://img10.imageshack.us/img10/6959/82537988gu8.png

----------

## PinguinoLoco

ssmaxss, the PDF content of those screenshots doesn't have subpixel hinting. Same problem as mine. If you open the same PDF with Acrobat Reader (with the antialiasing option enabled in its preferences) you'ĺl see the difference.

Maybe it's intentional. Subpixel hinting alters the shape of the letters a bit, so maybe they don't use it to have WYSIWYG, but it's very hard to read for me.

----------

## mwhitlock

Rendering a PDF is more similar to rendering an SVG than rendering text.  The PDF contains vector drawing instructions (it's essentially a PostScript file), so the only way you'd get subpixel rendering would be if Okular's vector rasterizer supported it.  In other words, this has nothing to do with FreeType or libXft; it's not even really font rendering, but more like shape painting.

----------

## ssmaxss

It looks good enough for me anyway  :Smile: 

PinguinoLoco, sorry for wrong information.

----------

## Evilguru

It is a known 'bug' in Poppler (the rendering library used by evince and Okular). More information can be found here: https://bugs.freedesktop.org/show_bug.cgi?id=3307

When producing a PDF file the norm is to embed a subset of the font in question (as opposed to converting it to an outline/path). The reason for this is that the font often contains useful hinting information which can be used to produce a sharper rendering than would otherwise be possible. A side effect of this is that it is usually completely possible to get subpixel text rendering for PDF file. (Acrobat and Preview.app both do this.)

Sadly no major vector graphics libraries (Cairo and Qt) provide support for subpixel rendered primitives. However, there has been some discussion about adding them to Cairo (they are in the API for anti-aliasing). Might happen in the future (and would be *very* nice). Poke around the Cairo mailing list and you'll see there is quite a lot of discussion about where the LCD hinting code belongs -- Cairo of Freetype -- but I digress.

Other 'bad citizens' on Linux include: OpenOffice.org (it uses its own font rendering code) and Java (Swing applications) which take it upon themselves to AA/subpixel render fonts. Ugly stuff.

Regards, Freddie.

----------

## Evilguru

Well that is interesting. It appears as eselect fontconfig enable/disable has no effect at all, on either Qt or GNOME applications. GNOME applications seem to instead use the GNOME appearance dialogue -- which does have an effect (i.e., there is a different between hint slight and hint full). However, it does not effect Qt applications.

Ideas?

Regards, Freddie.

----------

## bi3l

Perhaps we should re-add cairo-respect-fontconfig.patch

----------

## Evilguru

 *bi3l wrote:*   

> Perhaps we should re-add cairo-respect-fontconfig.patch

 

Worth a shot.

It also might be worth providing a patched version of poppler with a cleartype USE flag so that people, if they so desire, can toy with subpixel rendered PDF files. (There are some patches on the freedesktop bug report.)

Regards, Freddie.

----------

## bi3l

 *Evilguru wrote:*   

>  *bi3l wrote:*   Perhaps we should re-add cairo-respect-fontconfig.patch 
> 
> Worth a shot.

 

Done in the lcd-filtering overlay.

 *Evilguru wrote:*   

> It also might be worth providing a patched version of poppler with a cleartype USE flag so that people, if they so desire, can toy with subpixel rendered PDF files. (There are some patches on the freedesktop bug report.)

 

I'll see what I can do.

----------

## Evilguru

Switching back to lcd-filtering.

With the cairo respect fontconfig patch: The GNOME appearance dialogue has very little effect on font rendering (good). The eselect fontconfig (as root) affects the hinting of GNOME and Qt apps. Qt apps still have no subpixel rendering, GNOME ones do.

Regards, Freddie.

----------

## ssmaxss

 *bi3l wrote:*   

> 
> 
> Done in the lcd-filtering overlay.

 

What's the point in supporting two similar overlays? AFAIR you were offered commit access to devnull overlay. Maybe you should join efforts with devnull overlay?

----------

## bi3l

I've already joined the devnull team. All the ebuild of the lcd-filtering overlay are in devnull testing.

----------

## ssmaxss

But there is no cairo-respect-fontconfig.patch in devnull. And in fact no cairo ebuild at all.

----------

## bi3l

I didn't say they are in devnull, I said they are devnull testing.

----------

## ssmaxss

Thanks for clarification! And how can I add devnull testing overlay?

----------

## ocin

No need for. I have updated the devnull overlay.

We do now have all font ebuilds with cleartype AND ubuntu patches/useflags.

No useflag is defaulted. Both useflags can't be active the same time.

Thanks to bi3l for his great work. Enjoy :)

----------

## octoploid

 *ocin wrote:*   

> No need for. I have updated the devnull overlay.
> 
> We do now have all font ebuilds with cleartype AND ubuntu patches/useflags.
> 
> No useflag is defaulted. Both useflags can't be active the same time.
> ...

 

That's great. Many thanks.   :Very Happy: 

BTW: The first part of this patch causes a huge improvement in pdf rendering here (I'm using the »cleartype« useflag) . 

( I've changed  »cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_SLIGHT);«  to

 »cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);« because it looks better to me).

----------

## bi3l

 *octoploid wrote:*   

> BTW: The first part of this patch causes a huge improvement in pdf rendering here (I'm using the »cleartype« useflag) . 
> 
> ( I've changed  »cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_SLIGHT);«  to
> 
>  »cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);« because it looks better to me).

 

I've tried this patch but don't see any improvement. Can you mail me (billl at users.sourceforge.net) a pdf which is better rendered with the patch ?

----------

## octoploid

 *bi3l wrote:*   

>  *octoploid wrote:*   BTW: The first part of this patch causes a huge improvement in pdf rendering here (I'm using the »cleartype« useflag) . 
> 
> ( I've changed  »cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_SLIGHT);«  to
> 
>  »cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);« because it looks better to me). 
> ...

 

Every pdf I've tested is rendered better with this patch...  :Wink: 

It's the difference between grayscale- (the default in evince) and subpixel- rendering,

which this patch enables.

(Try these for example: http://arxiv.org/list/gr-qc/new )

BTW I get color fringes when I use this patch with the "ubuntu" USE flag. No problems with "cleartype".

----------

## ssmaxss

Could you briefly explain technical differences of ubuntu and cleartype?

----------

## octoploid

 *ssmaxss wrote:*   

> Could you briefly explain technical differences of ubuntu and cleartype?

 

Upper left: cleartype. Lower right: ubuntu.

http://www.mypicx.com/uploadimg/1318101625_02282009_1.png

As you'll see, ubuntu has a little bit more contrast.

----------

## GoofyX

Cleartype works fine for me.   :Smile: 

----------

## ssmaxss

 *octoploid wrote:*   

> 
> 
> Upper left: cleartype. Lower right: ubuntu.

 

Thanks! But why cleartype was chosen for portage (cairo in portage has cleartype patches and USE flag)?

----------

## mwhitlock

 *ssmaxss wrote:*   

> What's the point in supporting two similar overlays? AFAIR you were offered commit access to devnull overlay. Maybe you should join efforts with devnull overlay?

 

I personally appreciate having the lcd-filter overlay, so I don't have the huge number of overridden packages that devnull would contribute.  Portage really needs an ability to mask and unmask packages based on which overlay they're coming from.

----------

## ocin

 *mwhitlock wrote:*   

>  *ssmaxss wrote:*   What's the point in supporting two similar overlays? AFAIR you were offered commit access to devnull overlay. Maybe you should join efforts with devnull overlay? 
> 
> I personally appreciate having the lcd-filter overlay, so I don't have the huge number of overridden packages that devnull would contribute.  Portage really needs an ability to mask and unmask packages based on which overlay they're coming from.

 

If you are afraid about the -9999 ebuilds, they're all hardmasked ;)

----------

## Evilguru

I get colour fringes in general with "ubuntu". But then again, I use the 'slight' hinting option, "ubuntu" is designed for well hinted fonts. Poppler disables font hinting totally -- hence why you'll get colour fringes with it. "cleartype" handles non/slight hinting a *lot* better.

Regards, Freddie.

----------

## Evilguru

Hi all,

I have been poking around the Qt bug tracker: http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&id=242644

Since Qt was compiled with the raster backend (and because 4.5.0 is not yet in portage) I was not getting any subpixel hinting.

Alls well ends well.

Regards, Freddie.

----------

## tallica

Hello,

I have a HP LP2275W LCD monitor. I use fontconfig/cairo/freetype/libXft with cleartype flag and RGB subpixel enabled. Almost everything looks great, but in some apps black font on white background looks too green. For example in gedit font looks OK, but same font rendered in gnome-terminal looks strange (http://images40.fotosik.pl/71/1f7a26d325440b56.png).

----------

## ahmedre

thanks for the great work - my fonts look great!

just one question, however - is there a resolution for the problem of fonts being too bold (facebook's home page, yahoo mail, etc)?  i tried doing this:

```

<?xml version='1.0'?>

<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>

<fontconfig>

 <!-- Disable hinting for bold fonts -->

 <match target="font" >

  <test compare="more" name="weight" >

   <const>medium</const>

  </test>

  <edit mode="assign" name="autohint" >

   <bool>false</bool>

  </edit>

 </match>

</fontconfig>

```

and enabling user config, but it doesn't make much of a difference.  bold fonts look awesome throughout, it's just a handful of webpages (facebook isn't too bad even, it's just yahoo mail not being able to know what messages are new versus which are read).

thanks!

----------

## justinkb

i have it set up so it doesn't autohint bold fonts, as follows. instead of definining it locally make it global by making a new file in /etc/fonts/conf.avail/

```

paul@s021765 ~ $ cat /etc/fonts/conf.avail/99-disable-hinting-on-bold-fonts.conf 

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

<!-- Disable hinting for bold fonts -->

<match target="font">

    <test name="weight" compare="more">

        <const>medium</const>

    </test>

    <edit name="autohint" mode="assign">

        <bool>false</bool>

    </edit>

</match>

</fontconfig>

```

now all you have to do is (as root), eselect fontconfig enable ... with whatever number the file has.

i don't quite get why your version won't work (the xml file seems identical) but this should definitely.

----------

## Evilguru

Any news on the poppler patches for either the devnull overlay or lcd-filtering. Be interesting to toy with them.

Regards, Freddie.

----------

## mwhitlock

media-libs/freetype-2.3.9 appears to compile with the cleartype patches with just a simple rename of the 2.3.8 ebuild.

----------

## ocin

 *mwhitlock wrote:*   

> media-libs/freetype-2.3.9 appears to compile with the cleartype patches with just a simple rename of the 2.3.8 ebuild.

 

Anyone has tested the ubuntu useflag?

----------

## bi3l

Yup. It compiles cleanly but I haven't restarted X yet.

----------

## ocin

 *bi3l wrote:*   

> Yup. It compiles cleanly but I haven't restarted X yet.

 

Okay, tell me wheter it works and if it does, I'll add it to devnull (or you can do it if you want).

----------

## cybersol

First of all, a shout of thanks goes out to both ocin and bi3l for their efforts. I have been using this patchset lineage since xeffects and newspr, but was manually updating it after xeffects left. I have now started using the devnull overlay.

I now have things working the way I want. I found that cleartype was softer with less color fringing with my setup, so I am using it instead of ubuntu. Here is my full config in case it will help anyone:

Added devnull overlay

```
layman -a devnull

```

Added cleartype use flag to /etc/make.conf

Masked the new freetype in portage until it lands in devnull

/etc/portage/package.mask

```
>=media-libs/freetype-2.3.9

```

Enable byte-code interpreter and disable sse2 in pixman because I use the stable gcc 4.1.x

/etc/portage/package.use

```
media-libs/freetype -bindist

x11-libs/pixman -sse2

```

Unmask the testing versions of the packages

/etc/portage/package.keywords

```
x11-libs/cairo

x11-libs/libXft

media-libs/fontconfig

media-libs/freetype

x11-libs/pixman

```

eselect fontconfig list

```
Available fontconfig .conf files ( * is enabled ):

  [1]   10-antialias.conf *

  [2]   10-autohint.conf

  [3]   10-hinting-full.conf *

  [4]   10-hinting-medium.conf

  [5]   10-hinting-slight.conf

  [6]   10-hinting.conf *

  [7]   10-no-sub-pixel.conf

  [8]   10-sub-pixel-bgr.conf

  [9]   10-sub-pixel-rgb.conf *

  [10]  10-sub-pixel-vbgr.conf

  [11]  10-sub-pixel-vrgb.conf

  [12]  10-unhinted.conf

  [13]  20-fix-globaladvance.conf *

  [14]  20-unhint-small-vera.conf *

  [15]  25-unhint-nonlatin.conf

  [16]  30-metric-aliases.conf *

  [17]  30-urw-aliases.conf *

  [18]  40-nonlatin.conf *

  [19]  45-latin.conf *

  [20]  49-sansserif.conf *

  [21]  50-user.conf *

  [22]  51-local.conf *

  [23]  60-latin.conf *

  [24]  65-fonts-persian.conf *

  [25]  65-khmer.conf

  [26]  65-nonlatin.conf *

  [27]  69-unifont.conf *

  [28]  70-no-bitmaps.conf *

  [29]  70-yes-bitmaps.conf

  [30]  80-delicious.conf *

  [31]  90-synthetic.conf *

```

Set DPI for my monitor and ensure autohinting is off 

/etc/fonts/local.conf

```
<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<!-- /etc/fonts/local.conf file for local customizations -->

<fontconfig>

    <match target="font">

        <!-- Turn off Autohinter to use Byte Code Interpreter -->

        <edit name="autohint" mode="assign"><bool>false</bool></edit>

    </match>

    <!-- Set dpi -->

    <match target="pattern">

        <edit name="dpi" mode="assign"><double>85</double></edit>

    </match>

</fontconfig>

```

And my matching Xresources

~/.Xresources

```
Xft.autohint: false

Xft.hintstyle:  hintfull

Xft.hinting: true

Xft.antialias: true

Xft.rgba:  rgb

Xft.dpi: 85

```

I restarted X here, and it looks beautiful again. You can check that the Xresource changes are working with 

```
xrdb -query | grep -i xft
```

Cheers,

cybersol

----------

## pezed

Just wanted to say thanks for keeping the ubuntu patches alive.  In my opinion they are far superior to the cleartype setup.   Keep up the good work!! (Please!!)   :Very Happy: 

----------

## unK

If someone is using KDE and has problems with qt4 and openoffice not respecting fontconfig settings, here's the solution: go to Control Center -> Appereance & Themes -> Colors and disable option "Apply colors to non-KDE applications". That resolved the issue for me.

----------

## ocin

just wanted to say that freetype-2.3.9 is in ::devnull now :)

----------

## manwe_

Need a little help with configuration. Two things are looking ugly:

1. Courier font i Opera's [10alpha, shared qt3, amd64] <pre> : http://img11.imageshack.us/img11/4793/screenshot2009032414351.png

2. Java applications, JDownloader on screenshot: http://img10.imageshack.us/img10/3636/screenshot2009032414353.png . Looks the same with sun-jdk and icedtea6-bin.

```
$ eselect fontconfig list

Available fontconfig .conf files ( * is enabled ):

  [1]   10-antialias.conf *

  [2]   10-autohint.conf

  [3]   10-hinting.conf *

  [4]   10-hinting-full.conf *

  [5]   10-hinting-medium.conf *

  [6]   10-hinting-slight.conf

  [7]   10-no-sub-pixel.conf *

  [8]   10-sub-pixel-bgr.conf

  [9]   10-sub-pixel-rgb.conf *

  [10]  10-sub-pixel-vbgr.conf

  [11]  10-sub-pixel-vrgb.conf

  [12]  10-unhinted.conf

  [13]  20-fix-globaladvance.conf *

  [14]  20-unhint-small-dejavu-sans.conf

  [15]  20-unhint-small-dejavu-sans-mono.conf

  [16]  20-unhint-small-dejavu-serif.conf

  [17]  20-unhint-small-vera.conf

  [18]  25-unhint-nonlatin.conf

  [19]  30-metric-aliases.conf *

  [20]  30-urw-aliases.conf *

  [21]  40-nonlatin.conf *

  [22]  45-latin.conf *

  [23]  49-sansserif.conf *

  [24]  50-user.conf *

  [25]  51-local.conf *

  [26]  57-dejavu-sans.conf

  [27]  57-dejavu-sans-mono.conf

  [28]  57-dejavu-serif.conf

  [29]  60-liberation.conf *

  [30]  65-fonts-persian.conf *

  [31]  65-khmer.conf

  [32]  65-nonlatin.conf

  [33]  69-unifont.conf *

  [34]  70-no-bitmaps.conf *

  [35]  70-yes-bitmaps.conf

  [36]  80-delicious.conf *

  [37]  90-synthetic.conf *

$ cat /etc/fonts/local.conf

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

        <include ignore_missing="yes">/home/manwe/.fonts/vistafonts.conf</include>

        <match target="font">

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

        </match>

        <match target="font">

                <edit name="antialias" mode="assign"><bool>true</bool></edit>

        </match>

        <match target="font">

                <edit name="autohint" mode="assign"><bool>false</bool></edit>

        </match>

        <match target="font">

                <edit name="hinting" mode="assign"><bool>true</bool></edit>

        </match>

        <match target="font">

                <edit name="hintstyle" mode="assign"><const>hintslight</const></edit>

        </match>

        <match target="font">

                <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>

        </match>

        <selectfont>

                <rejectfont><pattern><patelt name="fontformat"><string>Type 1</string></patelt></pattern></rejectfont>

        </selectfont>

</fontconfig>

```

All programs in newest versions with cleartype enabled: cairo-1.8.6-r1, fontconfig-2.6.0-r2, freetype-2.3.9, libXft-2.1.13. In Opera Courier in <pre> is forced by forums' css, it should be replaced to Liberation Mono by 60-liberation.conf, but somehow isn't.

----------

## mwhitlock

 *manwe_ wrote:*   

> Java applications

 

The JFC (a.k.a. "Swing") does not use the native system's font rasterization facilities.  This is why it looks horrible on both Windows and Linux.  However, Java on Mac OS X uses OS X's typography support and looks great, but that's because it's Apple's implementation of Swing, not Sun's.  For what it's worth, you can get some rather crappy subpixel rendering of fonts in Swing by upgrading to Java 6.

----------

## manwe_

I do have sun-jdk-1.6.0, and it didn't look that crappy before. I wasn't using jdownloader for a while, but kept system up to date. Than few days ago runned it again and saw this. Something in the system has changed in those previous weeks, but few weeks is a hell lot of emerges so finding cause without any clues is impossible.

-- update:

Wine looks the same: http://img528.imageshack.us/img528/1672/screenshot2009032415444.png and also throws:

```
Fontconfig warning: "local.conf", line 27: invalid constant used : lcddefault
```

----------

## Evilguru

There is a command line flag you can pass to Java to change the text AA methods. I can't remember it off hand, although it doesn't improve the rendering quality much.

Sun seem to care very little about platform integration when it comes to Swing -- which is why after 6 years it still looks poor. One day, however, they might start to use the system settings for AA and hinting, one day...

Regards, Freddie.

----------

## manwe_

OK, the hell with java and wine (for now), but what with Opera? It used to be fine, something has changed and now Courier font looks like this: http://img11.imageshack.us/img11/4793/screenshot2009032414351.png . It's not present in the system (/usr/share/fonts/, gtk-chtheme, qtconfig, openoffice writer) but somehow is available in Opera's font list as "Courier [bitstream]" and used when specified in CSS.

```
$ opera -debugfont

...

Core X font family added: Charter [Bitstream]

Core X font family added: Courier [Bitstream]

Core X font family added: Terminus [Xos4]

...
```

-- update:

xfontsel also shows -bitstream-courier-*.

----------

## swimmer

Do you have 70-no-bitmaps.conf enabled & 70-yes-bitmaps.conf disabled?

----------

## manwe_

```
  [34]  70-no-bitmaps.conf * 

  [35]  70-yes-bitmaps.conf
```

-- update:

Fixed  :Smile:  Have no idea why, I was just playing with configs, checking if everything is ok and today -bitstream-* fonts vanished. Java & wine are still ugly, but at least Opera is ok.

----------

## Hell-Razor

Hey guys, I have been looking through all these threads and have not been able to find a how-to to get this working. Could somebody please re-post it? looking through 37 pages of forums is kind of difficult.

----------

## ocin

http://linuxtidbits.wordpress.com/2008/11/25/better-lcd-font-rendering/

use this howto - but in addition note that you can choose between ubuntu and cleartype rendering.

----------

## ssmaxss

there is freetype-2.3.9-r1 in portage that is newer than freetype-2.3.9 from devnull overlay, so it wants to install. Maybe someone would bump overlay version to 2.3.9-r1 too (afaik it should include some security fix)

----------

## ocin

 *ssmaxss wrote:*   

> there is freetype-2.3.9-r1 in portage that is newer than freetype-2.3.9 from devnull overlay, so it wants to install. Maybe someone would bump overlay version to 2.3.9-r1 too (afaik it should include some security fix)

 

done.

----------

## ssmaxss

Thanks!

----------

## overkll

Didn't this start out with the lcd-filtering overley?  Has lcd-filtering merged into the devnull overlay?  Or are there now two overlays for fonts?

I ask since the lcd-filtering overley DOESN'T contain the new freetype-2.3.9-r1.

----------

## iamboredr

wow thanks alot it helps alot

----------

## bi3l

 *overkll wrote:*   

> Didn't this start out with the lcd-filtering overley?  Has lcd-filtering merged into the devnull overlay?  Or are there now two overlays for fonts?
> 
> I ask since the lcd-filtering overley DOESN'T contain the new freetype-2.3.9-r1.

 

The lcd-filtering overlay still exists because I use it myself, but the "official" overlay for fonts in devnull.

----------

## overkll

Thanks bi3l, or should I say merci beaucoup?

I just synced the lcd-filtering overlay and freetype-2.3.9-r1 has been added.

----------

## PinguinoLoco

There is a post in the KDE forums of a person who has written patches to enable subpixel hinting in Okular. My experience in patching is limited and I can't get them to apply. Maybe some of the experts here could take a look at it. The screenshot the author of the patches provides looks great, I wish I could read PDF files like that!Last edited by PinguinoLoco on Fri Jun 19, 2009 2:25 pm; edited 1 time in total

----------

## bi3l

There have been such patches for a while but they are all quite ugly because they don't respect any of the user settings: they hardcode slight subpixel hinting and rgb order.

----------

## bi3l

I've added an ebuild for poppler-glib in the ldc-filtering overlay. With the hinting flag, it should provide hinting to the cairo backend according to your settings. PDF readers using poppler-glib (such as evince) should then have hinting enabled.

Please, let me know if it works.

----------

## PinguinoLoco

Thanks bi3l, it worked fine for me. There is subpixel hinting in evince and changing the hinting style in .fonts.conf did change the appearance of the PDF. Works OK for me with slight hinting (letters are a bit heavier than with Adobe Reader, but I like them) and for other hinting styles there are artifacts in the rendering (wrong size of some letters).

Would it be very difficult to have a similar patch for poppler-qt4 and okular?

----------

## bi3l

 *PinguinoLoco wrote:*   

> Would it be very difficult to have a similar patch for poppler-qt4 and okular?

 

It would be very easy if okular used the cairo backend. But I don't think it does.

----------

## PinguinoLoco

The patch in the KDE forums I posted above is supposed to do that, make okular use the cairo backend and hardcode slight hinting, but sadly I wasn't able to apply it.

----------

## ocin

There is a new cairo in portage.

bi3l, can you bump it on devnull please with the patches? Also whats different in the lcd filtering overlay?

----------

## bi3l

 *ocin wrote:*   

> bi3l, can you bump it on devnull please with the patches?

 

I'll do that this week-end.

 *ocin wrote:*   

> Also whats different in the lcd filtering overlay?

 

I've tried to sync the patchset with ubuntu's and failed and tried again a week or so later with more success. I then tried to commit them to devnull but couldn't connect. And finally, I added an ebuild for poppler-glib that enables antialiasing.

In short, there are up to date ebuilds and patches. I'll try to commit them again this week-end.

----------

## mwhitlock

 *bi3l wrote:*   

> In short, there are up to date ebuilds and patches. I'll try to commit them again this week-end.

 

Bi3l, you are a hero.

Will you be putting Cairo 1.8.8 in lcd-filtering?  (I still have layman set up to fetch lcd-filtering from SourceForge, and thus far I haven't needed the devnull overlay.)

----------

## bi3l

 *mwhitlock wrote:*   

> Will you be putting Cairo 1.8.8 in lcd-filtering?

 

lcd-filtering is my development overlay, so yes, I will put cairo 1.8.8 in it.

----------

## ocin

When everything works you can sync devnull with your lcd-overlay :)

----------

## bi3l

 *ocin wrote:*   

> When everything works you can sync devnull with your lcd-overlay 

 

Of course !

----------

## bi3l

```
billl@desktop ~/devel/devnull $ hg push

remote: ssh: connect to host core.ws port 22: Connection refused

abort: no suitable response from remote hg!
```

What's the problem ?

----------

## ocin

Oh, I forgot to tell you the new host/port, check your PMs.

----------

## bi3l

Commited. Do you want me to add the ebuild for poppler-glib ?

----------

## ocin

 *bi3l wrote:*   

> Commited. Do you want me to add the ebuild for poppler-glib ?

 

yup, you can add all font related ebuilds too. also thanks.

and btw, paludis givies me some warnings, can you look into them please? maybe some dep fail -> http://dpaste.com/60461/

----------

## bi3l

 *ocin wrote:*   

> yup, you can add all font related ebuilds too. also thanks.

 

Done.

 *ocin wrote:*   

> and btw, paludis givies me some warnings, can you look into them please? maybe some dep fail -> http://dpaste.com/60461/

 

They are all related to versions of the ebuilds that do not have the ubuntu useflag.

----------

## megaflow

mmm

poppler-glib wont build with the 'hinting' flag on 

build log -- >> http://users.skynet.be/fa094603/build.log

----------

## bi3l

Can you try again with libtool from ~x86 ?

----------

## megaflow

 *bi3l wrote:*   

> Can you try again with libtool from ~x86 ?

 

TNX het working with "sys-devel/libtool-2.2.6a" 

must y rebuild my system when upgrading libtool ?

----------

## bi3l

 *megaflow wrote:*   

> TNX het working with "sys-devel/libtool-2.2.6a"

 

The fix is commited.

 *megaflow wrote:*   

> must y rebuild my system when upgrading libtool ?

 

I don't think so.

----------

## manwe_

Thanks for working on new version, but you shouldn't remove older one so quickly. Give people time for testing. New cairo [1.8.8] renders font Candara [default in my system] worse than 1.8.6 and now I can't even go back, because there's no 1.8.6 in devnull. I've tried reemerging some basic packages, but it didn't help with 1.8.8.

----------

## pezed

Fonts look like crap again.

----------

## mwhitlock

My fonts in Cairo look the same as always.  I'm using the "ClearType" patch set, not "Ubuntu," and I have hinting disabled.

----------

## manwe_

Difference between nice cairo-1.8.6-r1: http://img16.imageshack.us/img16/7823/screenshot2009070301433.png and ugly 1.8.8: http://img30.imageshack.us/img30/6315/screenshot2009070301421.png . Look for example on that "g" moved to the left or squeezed "m". Same config, same USE="X cleartype directfb glitz opengl svg -debug -doc -ubuntu -xcb". 

Now I'm back with 1.8.6-r1 , downloaded from http://hg.core.ws/devnull/archive/6de39283cf40.tar.bz2  :Smile: 

----------

## pezed

Thanks for the archive link.  I downgraded back to the older cairo and now fonts are back to normal in firefox.

 *manwe_ wrote:*   

> Difference between nice cairo-1.8.6-r1: http://img16.imageshack.us/img16/7823/screenshot2009070301433.png and ugly 1.8.8: http://img30.imageshack.us/img30/6315/screenshot2009070301421.png . Look for example on that "g" moved to the left or squeezed "m". Same config, same USE="X cleartype directfb glitz opengl svg -debug -doc -ubuntu -xcb". 
> 
> Now I'm back with 1.8.6-r1 , downloaded from http://hg.core.ws/devnull/archive/6de39283cf40.tar.bz2 

 

----------

## ocin

cairo-1.8.6-r1 is re-added to ::devnull.

----------

## PinguinoLoco

One question about Opera fonts...

I installed Opera 10 beta from portage, the 64 bits and qt4 version, and fonts are very ugly. They are thick and with a lot of color fringing. Opera fonts change aspect when changing font settings from KDE4 System Settings panel, but they never look as good as the rest of the QT4 apps (Konqueror, for example).

Does anyone know if this can be fixed?

----------

## nordic bro

 *ocin wrote:*   

> cairo-1.8.6-r1 is re-added to ::devnull.

 

I just started messing with this (installing the overlay) and notice the cairo 1.8.6-r1 ebuild references a couple patches with "-" in the names but the patch files themselves use "_" fyi (*no_private* and one or two others).

----------

## ocin

a new fontconfig version is in portage, but I hardly have time to bump it. bi3l maybe?

----------

## bi3l

 *ocin wrote:*   

> a new fontconfig version is in portage, but I hardly have time to bump it. bi3l maybe?

 

No patchset yet, we'll have to wait.

----------

## ocin

Okay. I have started with the ebuild for freetype 2.7.0 in ::devnull-testing, you just need to change the patches when they are out, bi3l.Last edited by ocin on Mon Jul 20, 2009 1:42 am; edited 1 time in total

----------

## bi3l

I've ported the patchset from fontconfig 2.6.0. Commited in devnull-testing and lcd-filtering.

----------

## mwhitlock

 *bi3l wrote:*   

> I've ported the patchset from fontconfig 2.6.0. Commited in devnull-testing and lcd-filtering.

 

2.7.0 is working fine for me.  Konqueror was crashing when starting after I merged 2.7.0, but after restarting my X session, all is well.  Thanks again for all your great work, Bi3l!

----------

## ocin

Thanks, committed to ::devnull

----------

## Optimus22Prime

 *ocin wrote:*   

> Thanks, committed to ::devnull

 

```

emerge -puD --newuse world

These are the packages that would be merged, in order:

Calculating dependencies - * Digest verification failed:

 * /usr/local/portage/layman/devnull/media-libs/fontconfig/fontconfig-2.7.0.ebuild

 * Reason: Filesize does not match recorded size

 * Got: 4394

 * Expected: 4925

... done!

```

And what wrong with cairo-1.8.8 and cleartype? Firefox 3.5 hard depend on it, fonts look ugly for me. So I mask it and use old FF and cairo-1.8.6-r1.

----------

## PaulBredbury

 *Optimus22Prime wrote:*   

> Firefox 3.5 hard depend on it, fonts look ugly for me.

 

Maybe you have this font bug weirdness.

----------

## bi3l

 *Optimus22Prime wrote:*   

> Calculating dependencies - * Digest verification failed

 

Fixed

----------

## Optimus22Prime

 *PaulBredbury wrote:*   

>  *Optimus22Prime wrote:*   Firefox 3.5 hard depend on it, fonts look ugly for me. 
> 
> Maybe you have this font bug weirdness.

 

Thank you. It helped me.

----------

## xiber

Going from 2.6.0 to 2.7.0, what happened to:

10-antialias.conf

10-hinting.conf

10-hinting-full.conf

10-hinting-medium.conf

10-hinting-slight.conf

with the cleartype use flag? Fonts now look horrible.

----------

## Optimus22Prime

I could achieve identical looking fonts in qt3 qt4 and gtk2 apps only with this settings

```

eselect fontconfig list

Available fontconfig .conf files  ( * is enabled ):

  [1]   10-autohint.conf

  [2]   10-no-sub-pixel.conf

  [3]   10-sub-pixel-bgr.conf

  [4]   10-sub-pixel-rgb.conf *

  [5]   10-sub-pixel-vbgr.conf

  [6]   10-sub-pixel-vrgb.conf

  [7]   10-unhinted.conf

  [8]   20-fix-globaladvance.conf *

  [9]   20-unhint-small-vera.conf *

  [10]  25-ttf-arphic-ukai-render.conf *

  [11]  25-ttf-arphic-uming-bitmaps.conf *

  [12]  25-ttf-arphic-uming-render.conf *

  [13]  25-unhint-nonlatin.conf *

  [14]  30-metric-aliases.conf *

  [15]  30-urw-aliases.conf *

  [16]  35-ttf-arphic-ukai-aliases.conf *

  [17]  35-ttf-arphic-uming-aliases.conf *

  [18]  40-nonlatin.conf *

  [19]  41-ttf-arphic-ukai.conf *

  [20]  41-ttf-arphic-uming.conf *

  [21]  45-latin.conf *

  [22]  49-sansserif.conf *

  [23]  50-user.conf *

  [24]  51-local.conf *

  [25]  60-latin.conf *

  [26]  64-ttf-arphic-uming.conf *

  [27]  65-fonts-persian.conf *

  [28]  65-khmer.conf *

  [29]  65-nonlatin.conf *

  [30]  69-unifont.conf *

  [31]  70-no-bitmaps.conf

  [32]  70-yes-bitmaps.conf *

  [33]  75-ttf-arphic-ukai-select.conf

  [34]  80-delicious.conf *

  [35]  90-synthetic.conf *

  [36]  90-ttf-arphic-ukai-embolden.conf *

  [37]  90-ttf-arphic-uming-embolden.conf *

```

and

```

cat .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 mode="assign" name="hintstyle" >

   <const>hintfull</const>

  </edit>

 </match>

 <match target="font" >

  <edit mode="assign" name="antialias" >

   <bool>true</bool>

  </edit>

 </match>

</fontconfig>

```

Maybe that help somebody

----------

## xiber

Ok so with fontconfig 2.6.0-r2 +cleartype from devnull I had:

```
  [1]   10-antialias.conf *

  [2]   10-autohint.conf *

  [3]   10-hinting.conf *

  [4]   10-hinting-full.conf

  [5]   10-hinting-medium.conf *

  [6]   10-hinting-slight.conf

  [7]   10-no-sub-pixel.conf

  [8]   10-sub-pixel-bgr.conf

  [9]   10-sub-pixel-rgb.conf *

  [10]  10-sub-pixel-vbgr.conf

  [11]  10-sub-pixel-vrgb.conf

  [12]  10-unhinted.conf

  [13]  20-fix-globaladvance.conf *

  [14]  20-unhint-small-dejavu-sans.conf

  [15]  20-unhint-small-dejavu-sans-mono.conf

  [16]  20-unhint-small-dejavu-serif.conf

  [17]  20-unhint-small-vera.conf *

  [18]  25-unhint-nonlatin.conf

  [19]  30-metric-aliases.conf *

  [20]  30-urw-aliases.conf *

  [21]  40-nonlatin.conf *

  [22]  45-latin.conf *

  [23]  49-sansserif.conf *

  [24]  50-user.conf

  [25]  51-local.conf *

  [26]  57-dejavu-sans.conf

  [27]  57-dejavu-sans-mono.conf

  [28]  57-dejavu-serif.conf

  [29]  60-latin.conf *

  [30]  65-fonts-persian.conf *

  [31]  65-khmer.conf

  [32]  65-nonlatin.conf *

  [33]  69-unifont.conf *

  [34]  70-no-bitmaps.conf

  [35]  70-yes-bitmaps.conf

  [36]  80-delicious.conf *

  [37]  90-synthetic.conf *
```

And I everything looks great (at least to me),

with fontconfig 2.7.0 +cleartype I have:

```
  [1]   10-autohint.conf *

  [2]   10-no-sub-pixel.conf

  [3]   10-sub-pixel-bgr.conf

  [4]   10-sub-pixel-rgb.conf *

  [5]   10-sub-pixel-vbgr.conf

  [6]   10-sub-pixel-vrgb.conf

  [7]   10-unhinted.conf

  [8]   20-fix-globaladvance.conf *

  [9]   20-unhint-small-dejavu-sans.conf

  [10]  20-unhint-small-dejavu-sans-mono.conf

  [11]  20-unhint-small-dejavu-serif.conf

  [12]  20-unhint-small-vera.conf *

  [13]  25-unhint-nonlatin.conf

  [14]  30-metric-aliases.conf *

  [15]  30-urw-aliases.conf *

  [16]  40-nonlatin.conf *

  [17]  45-latin.conf *

  [18]  49-sansserif.conf *

  [19]  50-user.conf

  [20]  51-local.conf *

  [21]  57-dejavu-sans.conf

  [22]  57-dejavu-sans-mono.conf

  [23]  57-dejavu-serif.conf

  [24]  60-latin.conf *

  [25]  65-fonts-persian.conf *

  [26]  65-khmer.conf

  [27]  65-nonlatin.conf *

  [28]  69-unifont.conf *

  [29]  70-no-bitmaps.conf

  [30]  70-yes-bitmaps.conf

  [31]  80-delicious.conf *

  [32]  90-synthetic.conf *
```

plus local.conf:

```
    <match target="font" >

        <edit name="antialias" mode="assign">

            <bool>true</bool>

        </edit>

    </match>

    <match target="font">

        <edit name="hinting" mode="assign">

            <bool>true</bool>

        </edit>

    </match>

    <match target="font">

        <edit name="hintstyle" mode="assign">

            <const>hintmedium</const>

        </edit>

    </match>
```

Which essentially ends up being the same config but the results with 2.7.0 are pretty bad compared to 2.6.0.

OK, just looked at the devnull ebuild. With the cleartype use flag enabled, fontconfig-2.7.0 is essentially the same as the stock portage ebuild. Was there a cleartype patch for 2.6.0? Should I try the ubuntu flag? Going back to 2.6.0-r2 for the moment.

----------

## CkoTuHa

I can't get font rendering working like in Windows XP. In firefox 3.5 the google.com start page never look like on windows : the "W" in the Web is always aliased ? or sth.

The characters are never like in XP. I have my fonts from my windows that came with laptop, but seems to me like it is issue with font rendering. Overall, I can't make my gentoo look "professional". It looks like cheap cartoon  :Sad: 

----------

## Optimus22Prime

 *CkoTuHa wrote:*   

> I can't get font rendering working like in Windows XP. In firefox 3.5 the google.com start page never look like on windows : the "W" in the Web is always aliased ? or sth.
> 
> The characters are never like in XP. I have my fonts from my windows that came with laptop, but seems to me like it is issue with font rendering. Overall, I can't make my gentoo look "professional". It looks like cheap cartoon 

 

http://i076.radikal.ru/0907/e7/87223445dde7.png

Left - linux, hintlight. Right - Windows XP. Fonts - Times New Roman, Verdana, Courier New. Linux look more clever for me. Now I have only one trouble. With hintlight fonts in qt4 apps look ugly and fat. With hintmedium fonts in qt3, qt4 and gtk2 apps looks consistent.

----------

## CkoTuHa

 *Optimus22Prime wrote:*   

>  *CkoTuHa wrote:*   I can't get font rendering working like in Windows XP. In firefox 3.5 the google.com start page never look like on windows : the "W" in the Web is always aliased ? or sth.
> 
> The characters are never like in XP. I have my fonts from my windows that came with laptop, but seems to me like it is issue with font rendering. Overall, I can't make my gentoo look "professional". It looks like cheap cartoon  
> 
> http://i076.radikal.ru/0907/e7/87223445dde7.png
> ...

 

on the screenshot, the xml qutation : </match> on XP look better to me. I want to get this kind of rendering from my gentoo environment. Как бы это так сделать  :Smile:  ?

----------

## Optimus22Prime

 *CkoTuHa wrote:*   

> 
> 
> on the screenshot, the xml qutation : </match> on XP look better to me.
> 
> Как бы это так сделать  ?

 

Windows disable hinting for this font size. Ok, </match> look better for you in Windows, so you can manually disable hinting in kde or gnome and tune .fonts.conf manually after that.

----------

## CkoTuHa

is there any way at all make fonts look the same as on XP ? or it is impossible, but it is possible to make them similar ?

----------

## Optimus22Prime

 *CkoTuHa wrote:*   

> is there any way at all make fonts look the same as on XP ? or it is impossible, but it is possible to make them similar ?

 

I think it is impossible, because Windows use closed source bytecode interpretator, and because some faces (with dirty hints inside) look wrong in Windows. With manual tune hinting for some faces it possible make them similar. I presume that font rendering in Windows not ideal, and fine tuned Linux with good fonts (yes, Microsoft fonts too, Verdana have very good manual designed hints) may look better.

----------

## CkoTuHa

 *Optimus22Prime wrote:*   

>  *CkoTuHa wrote:*   is there any way at all make fonts look the same as on XP ? or it is impossible, but it is possible to make them similar ? 
> 
> I think it is impossible, because Windows use closed source bytecode interpretator, and because some faces (with dirty hints inside) look wrong in Windows. With manual tune hinting for some faces it possible make them similar. I presume that font rendering in Windows not ideal, and fine tuned Linux with good fonts (yes, Microsoft fonts too, Verdana have very good manual designed hints) may look better.

 

if there is way to make my font rendering look like here on opensuse on kde then I would be 2xtimes happier person.

http://en.opensuse.org/Image:Perfect_font_rendering_on_KDE.png

now I am like   :Crying or Very sad: 

----------

## ocin

"Perfect" is always subjective. The font rendering on that screenshot looks like the one on Win XP w/o cleartype.

----------

## CkoTuHa

Ocin, yes, it looks like Windows XP without MS' "Clear Type". Really that is what I want. The question I have is how to make it on gentoo ? What combination of hinting, AA, and fonts should I really try.

For me there is this information asymmetry where I don't even suspect how to manage this font thing.

if anyone has an idea how to get such rendering, welcome.

PS : that "perfect" shot is not mine, I got it here http://en.opensuse.org/Optimal_Use_of_MS_TrueType_Core_Fonts_for_a_KDE_Desktop_on_SuSE

----------

## bi3l

We are not you, hence we can't give you the perfect settings for you. Just use eselect fontconfig list/enable/disable and play with the 10-* and 11-* config files until you find your perfect settings.

----------

## natros

There's a problem with x11-libs/cairo-1.8.6-r1 from devnull

```
>>> Emerging (1 of 1) x11-libs/cairo-1.8.6-r1 from devnull

 * cairo-1.8.6.tar.gz RMD160 SHA1 SHA256 size ;-) ...                                                                [ ok ]

 * checking ebuild checksums ;-) ...                                                                                 [ ok ]

 * checking auxfile checksums ;-) ...                                                                                [ ok ]

 * checking miscfile checksums ;-) ...                                                                               [ ok ]

>>> Unpacking source...

>>> Unpacking cairo-1.8.6.tar.gz to /var/tmp/portage/x11-libs/cairo-1.8.6-r1/work

 * Applying cairo-respect-fontconfig.patch ...                                                                        [ ok ]

 * Applying cairo-1.8.6-status-return-fix.patch ...                                                                   [ ok ]

 * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:

 *

 *   /usr/local/portage/layman/devnull/x11-libs/cairo/files/cairo-ubuntu-02_no-private-symbol-export.patch

 *   ( cairo-ubuntu-02_no-private-symbol-export.patch )

 *

 * ERROR: x11-libs/cairo-1.8.6-r1 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_unpack

 *             environment, line 2875:  Called epatch '/usr/local/portage/layman/devnull/x11-libs/cairo/files/cairo-ubuntu-02_no-private-symbol-export.patch'

 *             environment, line 1453:  Called die

 * The specific snippet of code:

 *                   die "Cannot find \$EPATCH_SOURCE!";

 *  The die message:

 *   Cannot find $EPATCH_SOURCE!

 *

 * If you need support, post the topmost build error, and the call stack if relevant.

 * A complete build log is located at '/var/tmp/portage/x11-libs/cairo-1.8.6-r1/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/x11-libs/cairo-1.8.6-r1/temp/environment'.

 * This ebuild is from an overlay named 'devnull': '/usr/local/portage/layman/devnull/'

 *

```

You just needs to make theses changes:

```
--- cairo-1.8.6-r1.ebuild.orig   2009-08-04 13:44:54.029451994 +0100

+++ cairo-1.8.6-r1.ebuild   2009-08-04 13:47:52.009326448 +0100

@@ -83,10 +83,10 @@

       # ClearType-like patches applied by ArchLinux

       epatch "${FILESDIR}"/${PN}-1.2.4-lcd-cleartype-like.diff

    elif use ubuntu; then

-      epatch "${FILESDIR}"/${PN}-ubuntu-02_no-private-symbol-export.patch

+      epatch "${FILESDIR}"/${PN}-ubuntu-02_no_private_symbol_export.patch

       epatch "${FILESDIR}"/${PN}-ubuntu-03_only_destroy_FT_Faces_created_by_cairo.patch

       epatch "${FILESDIR}"/${PN}-ubuntu-04_lcd_filter.patch

-      epatch "${FILESDIR}"/${PN}-ubuntu-06_Xlib-Xcb-Hand-off-EXTEND_PAD-to-XRender.patch

+      epatch "${FILESDIR}"/${PN}-ubuntu-06_Xlib_Xcb_Hand_off_EXTEND_PAD_to_XRender.patch

    fi

 

    # We need to run elibtoolize to ensure correct so versioning on FreeBSD

```

Thank you for your good work.

----------

## ocin

Thanks, fixed: http://hg.core.ws/devnull/rev/e763710213f1

----------

## pmp11y

devnull don't work

```
* Failed to sync overlay "devnull".

* Error was: Syncing overlay "devnull" returned status 65280!

```

----------

## ocin

Edit: The server is back online!

Sorry for the circumstances.

----------

## ocin

bi3l, fontconfig-2.7.1 is available in portage, can you bump it in the overlays please? :)

----------

## Andy Crook

Seems like I have problems when using devnull's ebulds with USE flags "-cleartype ubuntu"

I'm unable to merge some packages, i.e. mozilla-thunderbird, seamonkey

emerge fails complaining about undefined references:

```

i686-pc-linux-gnu-g++ -DGENTOO_NSPLUGINS_DIR=\"/usr/lib/nsplugins\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\"/usr/lib/nsbrowser/plugins\"  -fno-rtti -fno-handle-exceptions  -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -march=pentium4 -pipe -Wno-return-type -w -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -ffunction-sections -O2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2   -fPIC -shared -Wl,-z,defs -Wl,-rpath,'$ORIGIN:$ORIGIN/..' -Wl,-h,libgfxps.so -o libgfxps.so  nsDeviceContextPS.o nsFontMetricsPS.o nsEPSObjectPS.o nsRenderingContextPS.o nsPostScriptObj.o nsAFMObject.o nsGfxFactoryPS.o nsTempfilePS.o nsPrintJobPS.o nsPrintJobFactoryPS.o nsType1.o    -Wl,-O1  -Wl,-rpath,'$ORIGIN:$ORIGIN/..'  -L../../../dist/bin -L../../../dist/lib -lgfxshared_s -lgfxpsshar -lmozutil_s -lgkgfx -L../../../dist/bin -lxpcom -lxpcom_core  -L../../../dist/bin -Wl,-R/usr/lib/nspr -L/usr/lib/nspr -lplds4 -lplc4 -lnspr4 -lpthread -ldl ../../../dist/lib/libunicharutil_s.a  -lXft   -lfreetype -lz  -Wl,--version-script -Wl,../../../build/unix/gnu-ld-scripts/components-version-script -Wl,-Bsymbolic -ldl -lm    

nsFontMetricsPS.o: In function `nsXftEntry::nsXftEntry(_FcPattern*)':

nsFontMetricsPS.cpp:(.text._ZN10nsXftEntryC1EP10_FcPattern+0x90): undefined reference to `FcPatternGetString'

nsFontMetricsPS.cpp:(.text._ZN10nsXftEntryC1EP10_FcPattern+0xb9): undefined reference to `FcPatternGetString'

nsFontMetricsPS.cpp:(.text._ZN10nsXftEntryC1EP10_FcPattern+0xe2): undefined reference to `FcPatternGetString'

nsFontMetricsPS.cpp:(.text._ZN10nsXftEntryC1EP10_FcPattern+0x10a): undefined reference to `FcPatternGetInteger'

nsFontMetricsPS.o: In function `nsXftEntry::nsXftEntry(_FcPattern*)':

nsFontMetricsPS.cpp:(.text._ZN10nsXftEntryC2EP10_FcPattern+0x90): undefined reference to `FcPatternGetString'

nsFontMetricsPS.cpp:(.text._ZN10nsXftEntryC2EP10_FcPattern+0xb9): undefined reference to `FcPatternGetString'

nsFontMetricsPS.cpp:(.text._ZN10nsXftEntryC2EP10_FcPattern+0xe2): undefined reference to `FcPatternGetString'

nsFontMetricsPS.cpp:(.text._ZN10nsXftEntryC2EP10_FcPattern+0x10a): undefined reference to `FcPatternGetInteger'

nsFontMetricsPS.o: In function `nsFontPSXft::FindFont(unsigned short, nsFont const&, nsFontMetricsPS*)':

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x119): undefined reference to `FcCharSetHasChar'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x347): undefined reference to `FcPatternCreate'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x418): undefined reference to `FcPatternAddInteger'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x443): undefined reference to `FcPatternAddInteger'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x461): undefined reference to `FcConfigSubstitute'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x46f): undefined reference to `FcDefaultSubstitute'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x49c): undefined reference to `FcFontSort'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x542): undefined reference to `FcPatternGetBool'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x576): undefined reference to `FcPatternGetString'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x5af): undefined reference to `FcPatternGetString'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x5ec): undefined reference to `FcPatternGetCharSet'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x60a): undefined reference to `FcCharSetCopy'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x6ab): undefined reference to `FcFontSetDestroy'

nsFontMetricsPS.cpp:(.text._ZN11nsFontPSXft8FindFontEtRK6nsFontP15nsFontMetricsPS+0x6b9): undefined reference to `FcPatternDestroy'

nsFontMetricsPS.o: In function `nsFontMetricsPS::~nsFontMetricsPS()':

nsFontMetricsPS.cpp:(.text._ZN15nsFontMetricsPSD1Ev+0x99): undefined reference to `FcCharSetDestroy'

nsFontMetricsPS.o: In function `nsFontMetricsPS::~nsFontMetricsPS()':

nsFontMetricsPS.cpp:(.text._ZN15nsFontMetricsPSD2Ev+0x99): undefined reference to `FcCharSetDestroy'

nsFontMetricsPS.o: In function `nsFontMetricsPS::~nsFontMetricsPS()':

nsFontMetricsPS.cpp:(.text._ZN15nsFontMetricsPSD0Ev+0x99): undefined reference to `FcCharSetDestroy'

../../../dist/lib/libgfxshared_s.a(nsFontConfigUtils.o): In function `NS_AddFFRE(_FcPattern*, nsCString*, int)':

nsFontConfigUtils.cpp:(.text._Z10NS_AddFFREP10_FcPatternP9nsCStringi+0xae): undefined reference to `FcPatternAdd'

nsFontConfigUtils.cpp:(.text._Z10NS_AddFFREP10_FcPatternP9nsCStringi+0xf4): undefined reference to `FcPatternAddWeak'

../../../dist/lib/libgfxshared_s.a(nsFontConfigUtils.o): In function `NS_AddLangGroup(_FcPattern*, nsIAtom*)':

nsFontConfigUtils.cpp:(.text._Z15NS_AddLangGroupP10_FcPatternP7nsIAtom+0x7a): undefined reference to `FcPatternAddString'

collect2: ld returned 1 exit status

gmake[4]: *** [libgfxps.so] Error 1

gmake[4]: Leaving directory `/var/tmp/portage/www-client/seamonkey-1.1.17/work/mozilla/gfx/src/ps'

gmake[3]: *** [libs] Error 2

gmake[3]: Leaving directory `/var/tmp/portage/www-client/seamonkey-1.1.17/work/mozilla/gfx/src'

gmake[2]: *** [libs] Error 2

gmake[2]: Leaving directory `/var/tmp/portage/www-client/seamonkey-1.1.17/work/mozilla/gfx'

gmake[1]: *** [tier_9] Error 2

gmake[1]: Leaving directory `/var/tmp/portage/www-client/seamonkey-1.1.17/work/mozilla'

make: *** [default] Error 2

 * 

 * ERROR: www-client/seamonkey-1.1.17 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 3317:  Called die

 * The specific snippet of code:

 *       emake || die;

 *  The die message:

 *   (no error message)

 * 

 * If you need support, post the topmost build error, and the call stack if relevant.

 * A complete build log is located at '/var/log/portage/www-client:seamonkey-1.1.17:20090820-101957.log'.

 * The ebuild environment file is located at '/var/tmp/portage/www-client/seamonkey-1.1.17/temp/environment'.

 * 

>>> Failed to emerge www-client/seamonkey-1.1.17, Log file:

>>>  '/var/log/portage/www-client:seamonkey-1.1.17:20090820-101957.log'

```

something's wrong with devnull's libXft (fontoconfig/freetype)?

I didn't looked thoroughly through ubuntu patches yet

p.s. when using cairo, libXft, fontconfig and freetype with default USE "+cleartype" I have no problems emerging this packages

----------

## PaulBredbury

 *Andy Crook wrote:*   

> undefined reference to `FcPatternGetString'

 

Do you have fontconfig installed? It's defined in /usr/include/fontconfig/fontconfig.h

----------

## Andy Crook

 *PaulBredbury wrote:*   

> Do you have fontconfig installed? It's defined in /usr/include/fontconfig/fontconfig.h

 

definitely yes

as I said I have all 4 packages (cairo, libXft, fontconfig and freetype) from devnull's overlay installed

the only difference is in this two USE flags

BUT

when emerged with default flags (+cleartype) they make no harm

and with USE "-cleartype ubuntu" I get these errors

----------

## IvanMajhen

Is there a bug in kickoff luncher? (kde 4.3)

All my fonts are rendered exactly the same, but fonts in kickoff look like they are not using lcddefault setting...

http://www.shrani.si/f/Z/WR/BEd3Z1g/snapshot1.png

----------

## bi3l

 *ocin wrote:*   

> bi3l, fontconfig-2.7.1 is available in portage, can you bump it in the overlays please? 

 

Nope, I'm on vacation.

----------

## RealNC

The "cleartype" USE flag of freetype in devnull doesn't do anything, so it might as well be removed.

----------

## natros

 *Andy Crook wrote:*   

> Seems like I have problems when using devnull's ebulds with USE flags "-cleartype ubuntu"
> 
> I'm unable to merge some packages, i.e. mozilla-thunderbird, seamonkey
> 
> ...
> ...

 

I'm having the same problem as you.  Any solution?

----------

## Andy Crook

 *natros wrote:*   

>  *Andy Crook wrote:*   Seems like I have problems when using devnull's ebulds with USE flags "-cleartype ubuntu"
> 
> I'm unable to merge some packages, i.e. mozilla-thunderbird, seamonkey
> 
> ...
> ...

 

The one solution I used is:

1. quickpkg devnull's cairo, libXft, fontconfig and freetype packages (emerged with "-cleartype ubuntu"), move them to some other dir on HDD

2. re-emerge this packages with standard use flags ("+cleartype -ubuntu")

3. quckpkg this packages

4. emerge all needed packages (i.e. mozilla-thunderbird)

5. change again flags to "-cleartype ubuntu", and then emerge -K all packages from 1st step

everyting works fine for me, but it's just workaround, so next time You'll have the same problem  :Smile: 

P.S. I know, it's dumb solutuion, but it works, don't blame me...  :Smile: 

----------

## bi3l

Updated fontconfig to 2.7.2 in both devnull and lcd-filtering.

----------

## omidxo

 *bi3l wrote:*   

> Updated fontconfig to 2.7.2 in both devnull and lcd-filtering.

 

http://hg.core.ws/devnull/rev/18b91fd8d11c#l3.108

```
<edit name="lcd_filter" mode="assign">
```

Should be

```
<edit name="lcdfilter" mode="assign">
```

----------

## bi3l

Fixed.

----------

## xiber

Think I may have asked this before but here goes:

I have cairo-1.8.8 / libXft-2.1.13 / freetype-2.3.9-r1 from devnull with "cleartype" use flag. Also have fontconfig-2.6.0-r2 (from devnull with cleartype use flag). Switched to fontconfig-2.7.2 (also from devnull with cleartype use flag). For the exact same configurations, using fontconfig-2.7.2 makes my fonts resemble their pre-devnull days (ie, looks much worse then with fontconfig-2.6.0-r2 ), so I keep going back to fontconfig-2.6.0-r2. Any idea why this should be the case? Should I switch to the ubuntu use flag?

----------

## loftwyr

Freetype 2.3.11 is in portage, can we get the overlay updated too?  

Thank you for doing this!

----------

## bi3l

Updated freetype to 2.3.11 and libXft to 2.1.14 in both lcd-filtering and devnull.

----------

## bi3l

Updated fontconfig to 2.8.0 in both devnull and lcd-filtering.

----------

## punloh

Could you tell why respect-fontconfig patch is dropped in cairo-1.8.8?

----------

## AaronPPC

fontconfig-2.8.0 is in lcd-filtering but not devnull.

----------

## bi3l

fontconfig-2.8.0 is in both.

----------

## AaronPPC

Odd, it wasn't in devnull when I synced this afternoon.  I used lcd-filtering.

----------

## kolcon

I still have problem with skype font hinting under amd64...

it is always the same user, same $HOME... 

under ~x86 gentoo and arch the fonts in skype look OK, hinting is fine.

under ~amd64 the hinting looks different (ugly) and I can't bring it to look the same

as under the other two systems

tried different hinting setting in xfce, played with qtconfig, no improvement  :Sad: 

Please advice what else should I try... since I use skype daily, it is getting on my eyes... thank you

----------

## manwe_

Firefox 3.5.6 now strictly depends on cairo 1.8.8 [previous 3.5.x versions were compiling fine with 1.8.6 after change in ebuild], so looks like I'll have to deal with this new cairo. This is how text looks like with:

- cairo 1.8.6,

- freetype 2.3.11,

- fontconfig 2.8.0,

- libXft 2.1.14.

http://manwe.rootnode.net/cairo1.png

So everything in the newest versions, except cairo. Config:

```
# cat /etc/fonts/local.conf

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

        <include ignore_missing="yes">/home/manwe/.fonts/vistafonts.conf</include>

        <match target="font">

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

        </match>

        <match target="font">

                <edit name="antialias" mode="assign"><bool>true</bool></edit>

        </match>

        <match target="font">

                <edit name="autohint" mode="assign"><bool>false</bool></edit>

        </match>

        <match target="font">

                <edit name="hinting" mode="assign"><bool>true</bool></edit>

        </match>

        <match target="font">

                <edit name="hintstyle" mode="assign"><const>hintslight</const></edit>

        </match>

        <match target="font">

                <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>

        </match>

        <selectfont>

                <rejectfont><pattern><patelt name="fontformat"><string>Type 1</string></patelt></pattern></rejectfont>

        </selectfont>

        <match target="pattern">

                <test qual="any" name="family"><string>Courier</string></test>

                <edit name="family" mode="assign"><string>Consolas</string></edit>

        </match>

        <match target="pattern">

                <test qual="any" name="family"><string>Courier</string></test>

                <edit name="family" mode="assign"><string>Consolas</string></edit>

        </match>

        <match target="pattern">

                <test qual="any" name="family"><string>Helvetica</string></test>

                <edit name="family" mode="assign"><string>Helvetica CE</string></edit>

        </match>

</fontconfig>

```

Now let's upgrade to cairo-1.8.8: http://manwe.rootnode.net/cairo2.png . Ugly as hell, "g" is moves to the left, "m" is asymmetrical, etc. Disabling hinting: 

```
<edit name="hinting" mode="assign"><bool>false</bool></edit>
```

helps with shapes of the letters, but makes them to blurry, most visible in the menu: http://manwe.rootnode.net/cairo3.png . I've tried messing with hint, autohint and lcdfilter but didn't get proper rendering, like with cairo 1.8.6. Any ideas?

----------

## PaulBredbury

 *manwe_ wrote:*   

> newest versions

 

Let's not forget about pixman, which cairo depends on, even though we don't need to patch pixman for the improved LCD font rendering.

pixman is currently at 0.16.4. Recompile cairo after upgrading pixman, to follow the dependency order.

See blurry fonts. Add entries to ~/.fonts.conf for specific font renderings that you don't like. This is the hassle that we have to go through, to set up fonts as we like them, on our hardware. Here's my ~/.fonts.conf as an example.

----------

## manwe_

 *PaulBredbury wrote:*   

> Let's not forget about pixman, which cairo depends on, even though we don't need to patch pixman for the improved LCD font rendering.

 

Why 0.16.4 i newer than 0.17.2?

 *PaulBredbury wrote:*   

> See blurry fonts. Add entries to ~/.fonts.conf for specific font renderings that you don't like. This is the hassle that we have to go through, to set up fonts as we like them, on our hardware. Here's my ~/.fonts.conf as an example.

 

I've started messing with my config, but couldn't get look like with cairo 1.8.6. Then tried your config and... it's great  :Smile:  Fonts look fabulous. Thanks for sharing   :Exclamation: 

----------

## PaulBredbury

 *manwe_ wrote:*   

> Why is 0.16.4 newer than 0.17.2?

 

Even numbers are the "stable" branch, odd numbers are the "unstable" branch.

Linux is unstable enough already, without deliberately using branches labelled "unstable". Example problem with 0.17.2

----------

## GoofyX

I get these days these two warnings:

```
Calculating dependencies - * Digest verification failed:

 * /usr/local/portage/layman/devnull/x11-libs/libXft/libXft-2.1.14.ebuild

 * Reason: Filesize does not match recorded size

 * Got: 1310

 * Expected: 1169                                                                                                     - * Digest verification failed:

 * /usr/local/portage/layman/devnull/media-libs/fontconfig/fontconfig-2.8.0.ebuild

 * Reason: Filesize does not match recorded size

 * Got: 4212

 * Expected: 4158                                                                                                    ... done!
```

Apparently the digests are wrong.

----------

## SlashBeast

Hi there. Anyone can put in first post, or post here info how start with new font rendering?

Just add "fontconfig -cleartype ubuntu" use flags, remerge what need it, remerge for example firefox and should work? IIRC I have been using it a long time ago and there was need to use eselect fontconfig but now I see sub-pixel conf's there.

```
# eselect fontconfig list

Available fontconfig .conf files (* is enabled):

  [1]   10-autohint.conf

  [2]   10-no-sub-pixel.conf

  [3]   10-sub-pixel-bgr.conf

  [4]   10-sub-pixel-rgb.conf

  [5]   10-sub-pixel-vbgr.conf

  [6]   10-sub-pixel-vrgb.conf

  [7]   10-unhinted.conf

  [8]   20-fix-globaladvance.conf *

  [9]   20-unhint-small-dejavu-sans.conf

  [10]  20-unhint-small-dejavu-sans-mono.conf

  [11]  20-unhint-small-dejavu-serif.conf

  [12]  20-unhint-small-vera.conf *

  [13]  25-ttf-arphic-ukai-render.conf

  [14]  25-ttf-arphic-uming-bitmaps.conf

  [15]  25-ttf-arphic-uming-render.conf

  [16]  25-unhint-nonlatin.conf

  [17]  30-metric-aliases.conf *

  [18]  30-urw-aliases.conf *

  [19]  35-ttf-arphic-ukai-aliases.conf

  [20]  35-ttf-arphic-uming-aliases.conf

  [21]  40-nonlatin.conf *

  [22]  41-ttf-arphic-ukai.conf

  [23]  41-ttf-arphic-uming.conf

  [24]  45-latin.conf *

  [25]  49-sansserif.conf *

  [26]  50-user.conf *

  [27]  51-local.conf *

  [28]  57-dejavu-sans.conf

  [29]  57-dejavu-sans-mono.conf

  [30]  57-dejavu-serif.conf

  [31]  60-latin.conf *

  [32]  64-ttf-arphic-uming.conf

  [33]  65-fonts-persian.conf *

  [34]  65-khmer.conf

  [35]  65-nonlatin.conf *

  [36]  69-unifont.conf *

  [37]  70-no-bitmaps.conf

  [38]  70-yes-bitmaps.conf

  [39]  75-ttf-arphic-ukai-select.conf

  [40]  80-delicious.conf *

  [41]  90-synthetic.conf *

  [42]  90-ttf-arphic-ukai-embolden.conf

  [43]  90-ttf-arphic-uming-embolden.conf

```

Also, @bi3l why you using tar to publish your overlay? I think a way better would be put it in git, at github for example and it will make super easy to merge your overlay into another.

----------

## luscinius

Hi

I have the exact same problem with the digests as GoofyX

----------

## GoofyX

Temporarily, I deleted devnull and used the tar from here: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2 The ebuilds from the tar seem to work fine if you copy them to your local overlay.

----------

## bi3l

 *GoofyX wrote:*   

> Apparently the digests are wrong.

 

Fixed.

----------

## bi3l

 *SlashBeast wrote:*   

> Hi there. Anyone can put in first post, or post here info how start with new font rendering?
> 
> Just add "fontconfig -cleartype ubuntu" use flags, remerge what need it, remerge for example firefox and should work? IIRC I have been using it a long time ago and there was need to use eselect fontconfig but now I see sub-pixel conf's there.

 

You should definitely play with eselect fontconfig to find your favorite settings.

 *SlashBeast wrote:*   

> Also, @bi3l why you using tar to publish your overlay? I think a way better would be put it in git, at github for example and it will make super easy to merge your overlay into another.

 

There is no good answer to that question, except because I'm a bit lazy. I'll switch to github or gitorious one day or another.

----------

## SlashBeast

Only for me small fonts with 'ubuntu' useflag are very hard to read?

Anyway, if anyone interesed, I merged gentoo-lcd-filtering.tar.bz2 latest to http://github.com/slashbeast/foo-overlay and will keep it updated.

----------

## PaulBredbury

 *SlashBeast wrote:*   

> Only for me small fonts with 'ubuntu' useflag are very hard to read?

 

So? Read this thread. You can change how they are rendered. E.g.:

```
   <!-- Greyscale for small fonts -->

   <match target="font">

      <test name="pixelsize" compare="less_eq"><double>7</double></test>

      <edit name="rgba"><const>none</const></edit>

   </match>
```

Here's my ~/.fonts.conf for Infinality's rendering, which is the best rendering - but, use Infinality's own configuration, since he does a better job than me.

For posterity, here's my old ~/.fonts.conf for Ubuntu's rendering.

Edit: Updated my ~/.fonts.conf for Postscript substitutions.

Edit2: Updated for better rendering of small italics.

Edit3: Better rendering of Arial Bold.

Edit4: Many miscellaneous tweaks, for individual fonts, and generalities such as small bold.

Edit5: Stopped replacing Helvetica 11pt with Arial - it's not needed anymore, and such replacing is nasty.

Edit6: Reorganized rules, stopped using "append_replace" (seems to have bad side-effect of also replacing other fonts in the same "family), and further tweaked the hinting rules.

Edit7: Tweaked Luxi Sans bold. Now using <match target="font"> instead of the seemingly-weird <match name="family" target="pattern">

Edit8: Tweaked Arial Black.

Edit9: Made Microsoft fonts hintfull.

Edit10: Tweaked Verdana bold.

Edit11: Tweaked Baskerville font.

Edit12: Am partially replacing Arial with Calibri, because Arial looks so bad.

Edit13: Tweaked Arial Black bold with hintnone.

Edit14: Split the horrible Arial into Calibri (small) and Corbel (small bold). Enabled embeddedbitmap for small sizes.

Edit15: Tweaked smallish Arial Bold to use hintnone instead of hintslight.

Edit17: Disabled "embeddedbitmap" - it's pointless for our purposes of getting nice anti-aliasing.

Edit18: Using CartoGothic Std and PT Sans (both free fonts) to replace Arial small-ish.

Edit19: Tweaked PT Sans bold and not-so-small.

Edit20: Tweaked Aller, Lucida Grande bold, and Luxi Sans bold & small.

Edit21: Minor tweaks to some free fonts: Aller, Droid, Fontin.

Edit22: Switched to Infinality's superior rendering, which makes the Ubuntu-specific tweaking obsolete.Last edited by PaulBredbury on Sun Sep 12, 2010 2:18 am; edited 25 times in total

----------

## PaulBredbury

The devnull overlay has removed cairo-respect-fontconfig.patch in cairo-1.8.8.ebuild, which is a mistake.

The patch is needed, so as not to partially ignore the fontconfig files in /etc/fonts/conf.d/ and ~/.fonts.conf

Can you put it back in please? Why was it taken out?

Edit: I've finally reported this patch upstream.Last edited by PaulBredbury on Sat Mar 27, 2010 6:22 pm; edited 1 time in total

----------

## bi3l

Fixed both in devnull and lcd-filtering. I can't remember why it was taken out but I'm pretty sure there is no good reason.

Edit. BTW, I've switched lcd-filtering to gitorious. See my signature.

----------

## savalas

The more I read this thread, the less I understand any of it. I've tried installing from the overlays mentionned in this thread but I couldn't see any difference in KDE. Could anyone be kind enough to take a couple of screenshot both with antialiasing and full hinting, one with the default Gentoo stuff (with the cleartype use flag) and another with any of devnull/lcd-filtering/callisto overlays (as it seems they all share the same patches?) to highlight the difference between the two? That would be really great, thanks!

----------

## na641

 *bi3l wrote:*   

> Fixed both in devnull and lcd-filtering. I can't remember why it was taken out but I'm pretty sure there is no good reason.
> 
> Edit. BTW, I've switched lcd-filtering to gitorious. See my signature.

 

i tried adding that gitorious layman overlay to my layman list of repos but its not listing. the format seems to be a little different.

----------

## PaulBredbury

Wow, Gentoo's cairo now contains Ubuntu patches - never thought I'd see the day.

----------

## na641

 *PaulBredbury wrote:*   

> Wow, Gentoo's cairo now contains Ubuntu patches - never thought I'd see the day.

 

i'm a little confused. so does this mean we don't need the cairo overlay anymore? also, is the portage cairo lcdfilter flag the same as the ubuntu flag from the overlay cairo?

----------

## PaulBredbury

I've been tweaking my ~/.fonts.conf a lot recently, and here it is - any decent feedback?   :Smile: 

I'm especially interested in fontconfig ruleset tweaks, if anyone has them, for fonts that I've ignored, or where they greatly disagree with my choice (then we'll get into the complexities of e.g. DPI, screen resolutions, font versions, etc.).

Some useful miscellaneous debugging commands:

fc-match --sort "Symbol"

fc-match -a | uniq | sort | less

fc-match -a | grep -i n019003l

fc-list "Nimbus Sans L"

fc-cat ~/.fonts/ | grep Condensed | cut -c-78

fc-query ~/.fonts/n019003l.pfb

lsof | grep -i firefox | egrep -i 'ttf|pfb'

----------

## Ruzbeh

 *PaulBredbury wrote:*   

> I've been tweaking my ~/.fonts.conf a lot recently, and here it is - any decent feedback?  
> 
> 

 

I was testing your config earlier, some fonts are still too fat. Example: the font of the name of the blog isn't fat, that's good, but the headline is. I'm running Windows and configuring my fonts in Linux in VirtualBox, so I can compare easily.

----------

## PaulBredbury

 *Ruzbeh wrote:*   

> the font of the name of the blog isn't fat, that's good, but the headline is.

 

The headline ("Good teachers help students...") is Tahoma (bold): tahomabd.ttf

```
$ fc-query ~/.fonts/tahomabd.ttf | grep -i weight

   weight: 200(i)(s)
```

200 is bold. But anyway, you're right. I've added a rule to make Microsoft's fonts hintfull. Try it now  :Smile: 

----------

## Ruzbeh

My bad. I later found out it was tahoma and I didn't have that installed. 

I've been testing a lot of different stuff lately, using your conf as a guide. Not that I mind, but issuing the kill command over and over again (kill, kill, kill, kill, kill, kill...) makes me a bit uneasy.

I like your conf, and it pretty much renders stuff correctly as far as I can tell, but it does make everything look too thin. Perhaps preferential, but I do like my fonts to look slightly fuzzy. (Rather too fuzzy than too thin.) I'm using my own fonts.conf right now, using anti-alias, rgb, hintslight, and hintnone for Arial specifically. Testing this stuff out isn't the easiest thing to do. Is there a website that displays fonts that are used very often in their oft-used sizes? That would make comparing fonts between Windows and Linux so much easier.

----------

## PaulBredbury

Too fat or too thin, based on whether we use hintmedium or hintfull  :Crying or Very sad:  Maybe we need hintabitmorebutnottoomuch  :Razz: 

Well, state specific examples, so I can look at tweaking them. Within the confines of what fontconfig provides, obviously.

Arial is the font that I hate the most - it won't look great when small, no matter what options are chosen. Most of my font-specific tweaking is for Arial small/bold, at e.g. digg. I think I might even replace it (with Calibra? Liberation Sans?).

It will be easy to create a test HTML page (example), and I'll do this soon. Also, typetester may be useful.

----------

## PaulBredbury

Here's a Python program to generate HTML of various fonts, and its outputted HTML page - save it, then open it in e.g. firefox.

Of course, your web browser relies on the fonts you have installed (and its settings, e.g. minimum font size) - the fc-query and fc-match commands will help to explain what you see.

----------

## aoeuaoue

A lot of this also depends on the Xorg driver being used. I've tested nouveau and nvidia, the former has absolutely no anti-aliasing, the latter does have some form of anti-aliasing in nvidia-settings. Though I am not sure how and to what decides applying it. I like microfonts (really tiny) and the Nouveau driver made them blurry and had some sort of glitch where in terminals bold r's would stick out like an overgrown wart full of hair.

Using 'nvidia-settings' I have anti-aliasing at max and now changed to 'Use Application Settings', it was set to 'Override Applications Settings'.

so ppl, please bear this in mind when making accusations about fonts!! radeonhd, fglrx, nvidia, nouveau, vesa, your screen resolution etc, there isn't a silver bullet to fix ALL fonts in ALL systems.

Also another thing I've noticed is that some settings only take effect after re-starting X. For instance testing terminal fonts xrdb -load .Xdefaults just changes the font but not the hinting and anti-aliasing settings that are either in .Xdefaults or .fonts.conf file.

Having said that, I am using for my terminal Inconsolata font and firefox uses the following:

```
lsof | grep -i firefox | egrep -i 'ttf|pfb'                                                                                                     

/usr/share/fonts/umeplus-fonts/umeplus-p-gothic.ttf                            

/usr/share/fonts/dejavu/DejaVuSerif.ttf                                        

/usr/share/fonts/dejavu/DejaVuSans.ttf                                         

/usr/share/fonts/corefonts/verdanaz.ttf                                        

/usr/share/fonts/corefonts/verdanai.ttf                                        

/usr/share/fonts/dejavu/DejaVuSansMono-Bold.ttf                                

/usr/share/fonts/corefonts/trebucbd.ttf                                        

/usr/share/fonts/corefonts/verdana.ttf                                         

/usr/share/fonts/corefonts/verdanab.ttf
```

So far letting default stuff on without changes everything looks better than all those custom .fonts.conf that've tried.

cheers!!

----------

## PaulBredbury

 *aoeuaoue wrote:*   

> nvidia-settings

 

Hang on a minute, aren't you talking complete nonsense?

nvidia-settings is for opengl anti-aliasing - this thread is talking about 2D apps like Abiword, Openoffice, geany, etc. What apps are you using, in which nvidia-settings' anti-aliasing affects text rendering?

 *Quote:*   

> Also another thing I've noticed is that some settings only take effect after re-starting X

 

Wrong. You just need to restart the app (maybe you had multiple xterms open, and need to close every instance?). This is easily proved in e.g. qtconfig:

```
(Set e.g. Xft.dpi: 120 in ~/.Xresources)

xrdb -merge ~/.Xresources

qtconfig

(See fonts change size)
```

 *Quote:*   

> without changes everything looks better than all those custom

 

That is most certainly absolute nonsense. Try the sample font HTML I provided above, and experiment with your settings, and you'll see that some fonts need e.g. hintslight/hintfull to prevent looking ugly or too bold, whereas other fonts may need e.g. autohint (a good example is Luxi Sans at Market Ticker, which looks ridiculously mis-shapen with hintmedium instead of hintslight). Look at my ~/.fonts.conf above, and you'll see the tweaks that I've found that can be used to improve the look of the fonts.

In other news, I've updated my ~/.fonts.conf above to replace Arial *sometimes*, because it looks so poor when small/bold and cannot be fixed, and it's so ubiquitous that I cannot tolerate its ugliness, when other fonts manage to look decent at the same size  :Smile: 

----------

## aoeuaoue

 *PaulBredbury wrote:*   

> 
> 
> nvidia-settings is for opengl anti-aliasing - this thread is talking about 2D apps like Abiword, Openoffice, geany, etc. What apps are you using, in which nvidia-settings' anti-aliasing affects text rendering?
> 
> 

 

oops, you are right I got confused then. I assumed anti-aliasing always referred to fonts LAWL!! Didn't think linux actually HAD 3D games needing anti-aliasing and associated games and anti-aliasing with m$$ games.

Also that didn't change a thing.

```
(Set e.g. Xft.dpi: 120 in ~/.Xresources)

xrdb -merge ~/.Xresources

qtconfig

(See fonts change size)
```

I have two 23" with a res 2048x1152 apiece. 

```
[    80.986] (II) NVIDIA(0): Computing DPI using physical size from Samsung SyncMaster

[    80.986] (II) NVIDIA(0):     (DFP-0)'s EDID and first mode to be programmed on Samsung

[    80.986] (II) NVIDIA(0):     SyncMaster (DFP-0):

[    80.986] (II) NVIDIA(0):   width  : 2048 pixels  510  mm (DPI: 101)

[    80.986] (II) NVIDIA(0):   height : 1152 pixels  290  mm (DPI: 100)
```

From my /var/log/Xorg.0.log. Is this the same dpi as Xft.dpi: in .Xresources/.Xdefaults? I am confused about this. Concerning fonts there are a few places where to set them in .Xresources/.Xdefaults:

```
xft.dpi:   101

xft.antialias: true

!Xft.lcdfilter: lcdfilterlegacy

Xft.hintstyle: hintfull
```

And then it's possible to pass anti-alias and hinting options individually at:

```
URxvt*font:     xft:Inconsolata:autohint=true:antialias=true:size=6
```

I wonder what's the relationship between .fonts.conf settings, Xft* in .Xdefaults and the fonts sections.

cheers

----------

## mwhitlock

 *na641 wrote:*   

> i tried adding that gitorious layman overlay to my layman list of repos but its not listing. the format seems to be a little different.

 

Layman uses a different XML schema now.  Here's what I have in my lcd-filtering.xml:

```
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE repositories SYSTEM "/dtd/repositories.dtd">

<repositories xmlns="" version="1.0">

   <repo quality="experimental" status="unofficial">

      <name>lcd-filtering</name>

      <description>LCD filtering</description>

      <homepage>http://forums.gentoo.org/viewforum-f-12.html</homepage>

      <owner>

         <email>billl@users.sourceforge.net</email>

      </owner>

      <source type="git">git://gitorious.org/lcd-filtering/lcd-filtering.git</source>

   </repo>

</repositories>
```

----------

## na641

 *mwhitlock wrote:*   

>  *na641 wrote:*   i tried adding that gitorious layman overlay to my layman list of repos but its not listing. the format seems to be a little different. 
> 
> Layman uses a different XML schema now.  Here's what I have in my lcd-filtering.xml:
> 
> ```
> ...

 

thanks a lot buddy, works great

----------

## PaulBredbury

So, who wants to add additional patches to cairo etc., to add support for the sub-LCD rendering method? It looks interesting  :Cool: 

----------

## PaulBredbury

There's some nice free fonts available.

The best from that list are: PT Sans, CartoGothic Std, Sansation, Aller.

PT Sans and CartoGothic Std are so good, that I'm currently using a combination of them to replace Arial small-ish.

Edit: freetype 2.4.0 misses out most of the characters of CartoGothic Std - so it's to be avoided currently - weird  :Confused: 

Edit2: freetype 2.4.1 fixes the missing characters in CartoGothic Std  :Smile: Last edited by PaulBredbury on Sun Jul 18, 2010 6:13 am; edited 2 times in total

----------

## PaulBredbury

I noticed that NiLuJe prefers to patch default_filter, so I tried it myself. Here's an example to show the difference with the Gibson filter. It's "warmer" (some would say blurrier), and to my eyes it's an improvement  :Very Happy: 

Easy alternative to the patch:

```
sed -i -e "s:0x10, 0x40, 0x70, 0x40, 0x10:0x1c, 0x38, 0x55, 0x38, 0x1c:" src/base/ftlcdfil.c
```

Just recompile freetype2, then restart firefox to see the change.

Edit: More combinations on Infinality's forum.

This looks like a nice way to fine-tune "lcddefault". It would be interesting to see if people prefer other variations.

In other news, freetype 2.4.0 is out - the 2 Ubuntu patches "freetype-bytecode-interpreter" and "enable-full-bytecode-interpreter" can be dropped as no longer needed.Last edited by PaulBredbury on Thu Oct 28, 2010 4:56 am; edited 1 time in total

----------

## PaulBredbury

Infinality has a great freetype patch for sub- rather than whole-pixel hinting, which has better font spacing, as an alternative to Ubuntu's freetype LCD patch.

Here's a freetype-2.4.2-infinality-20100904.patch all-in-one patch I've made for freetype 2.4.2 - take a look at it, to see what it contains.

I still also recommend adding:

sed -i -e "s:0x10, 0x40, 0x70, 0x40, 0x10:0x1c, 0x38, 0x55, 0x38, 0x1c:" src/base/ftlcdfil.c

Old stuff:

freetype-2.4.2-infinality-20100903.patch

freetype-2.4.2-infinality-20100828.patch

Old patch

Here's an all-in-one patch I've made for freetype 2.4.0 (also works with freetype 2.4.1)

Edit: Got "hinting" vs "filtering" confused  :Smile: 

Edit2: Here's the patch for freetype 2.4.2

Edit3: Added upstream patches.Last edited by PaulBredbury on Sat Sep 04, 2010 10:42 am; edited 8 times in total

----------

## sipingal

 *PaulBredbury wrote:*   

> Infinality has a great freetype patch for sub- rather than whole-pixel filtering, which has better font spacing, as an alternative to Ubuntu's freetype LCD patch.
> 
> Here's an all-in-one patch I've made for freetype 2.4.0

 

That's great. Why not push to upstream? Seems it solve the memu delay problem as well.

Gilles said: I bit worried about speed in activities menu as well, it's damn slow on my Core2@2.2Ghz which I can't understand.

Details see here: http://blogs.gentoo.org/index.php/2009/10/25/gnome-2-28-1-is-there?blog=86

----------

## kernelOfTruth

 *PaulBredbury wrote:*   

> There's some nice free fonts available.
> 
> The best from that list are: PT Sans, CartoGothic Std, Sansation, Aller.
> 
> PT Sans and CartoGothic Std are so good, that I'm currently using a combination of them to replace Arial small-ish.

 

thanks for those fonts !   :Smile: 

----------

## KejPi

Hi, is there any plan to release freetype 2.4.0 with patches in devnull or should I switch to standard Gentoo version?

Thanks!

----------

## bi3l

freetype 2.4.0 is available in LCD filtering (note that I've changed the USE flags to match those of standard gentoo).

----------

## PaulBredbury

freetype 2.4.1 is out, and fixes the problem with missing characters in CartoGothic Std.

My Infinality patch for 2.4.0 works fine with 2.4.1, and it's better than Ubuntu's rendering. Although, annoyingly for me, it makes most of my Ubuntu-specific fontconfig rule-tweaking obsolete  :Evil or Very Mad: 

----------

## anshuljain

Seems like some more patches have started to filter in from Gentoo and Arch land  :Smile:  Hello to my Gentoo friends (and especially to PaulBredbury). I've been following the patches from infinality ever since I came across this post (again) and tried it on openSUSE 11.3 w/ freetype 2.4.1. I must say that the patch is HIGHLY impressive as compared to the Ubuntu patches from Lucid/Maverick. I had those patches in my Opensuse Build Service repository briefly, but took them down as I had some questions on this patch.

I use a propeitary app called Labview and it does not use fontconfig for rendering. I'm not sure what it uses, but for Labview to pick up the fonts I need to run mkfontdir and mkfontscale to get the fonts.scale file in the ~/.fonts directory. I reverted back to the Ubuntu patches as the Infinality patches caused the fonts (Tahoma font is what I use for Labview) to be rendered completely horribly. It looks smudged and highly pixelated. With the Ubuntu patch, its back to its normal self. My question is- how can I ensure that the the Infinality patch will render Labview the same way as the Ubuntu patch does?

Some screenshot of my Labview app and the desktop with the Ubuntu patch:-

[IMG]http://thumbnails16.imagebam.com/8931/92c0af89306592.jpg[/IMG]

[IMG]http://thumbnails23.imagebam.com/8931/5652c289306191.jpg[/IMG]

I'd appreciate some assistance from the experts over here, so that I can take this knowledge and apply it to make life better on openSUSE  :Smile: 

Regards (from openSUSE-land)

Anshul

----------

## PaulBredbury

 *anshuljain wrote:*   

> I'm not sure what it uses

 

Maybe libXft? Try:

ldd /usr/bin/labview | grep -i xft

----------

## anshuljain

Nope, its not Xft. I did this:-

anshul@sagarika /usr/local/bin $ ldd /usr/local/bin/labview 

	linux-gate.so.1 =>  (0x00706000)

	libGL.so.1 => /usr/lib/mesa/libGL.so.1 (0x00c8a000)

	libX11.so.6 => /usr/lib/libX11.so.6 (0x0046f000)

	libXext.so.6 => /usr/lib/libXext.so.6 (0x00dc2000)

	libstdc++.so.5 => not found

	libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x005a7000)

	libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x00f30000)

	libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x00110000)

	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00129000)

	libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x00bb8000)

	libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00c1e000)

	libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00dd8000)

	libdrm.so.2 => /lib/libdrm.so.2 (0x00283000)

	libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00d05000)

	/lib/ld-linux.so.2 (0x00a78000)

	librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0x00e5e000)

	libXau.so.6 => /usr/lib/libXau.so.6 (0x0061f000)

	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00edb000)

Any suggestions... :Smile: ?

----------

## maruko

I'm using PaulBredbury's fonts.conf and, so far, everything looks good.   :Smile: 

Everything except Konsole.

Konsole is using Monospace, 9 with "Smooth fonts" enabled.

```

$ fc-match monospace

DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

```

Also, the cursor is not in the proper place. It looks like it has some gap after the last characters 't'. Take note that I didn't input any spaces in there and it's only "test" and not "test ". Switching to the font "Consolas" fixes this problem, but I'd like to use DejaVu Sans Mono...

*EDIT* Just selecting DejaVu Sans Mono instead of Monospace fixes the problem.

----------

## ocin

Hey bi3l, I just came across this bug, can you look into it? Thanks in advance!

----------

## GoofyX

@bi3l, the lcd-filtering overlay is not displayed in the listing of layman's overlays. We have to manually add it ourselves and sync it?

----------

## grogi

I hate to do that - but with all that mess around font in Linux I cannot let it go. 

 *PaulBredbury wrote:*   

> Infinality has a great freetype patch for sub- rather than whole-pixel filtering,

 

Hinting, not filtering. Hinting is a process of fitting the glyph into the pixel grid. 

 *Quote:*   

> which has better font spacing, as an alternative to Ubuntu's freetype LCD patch.
> 
> Here's an all-in-one patch I've made for freetype 2.4.0 (also works with freetype 2.4.1)

 

Works! Awsome... 

What patches are included?Last edited by grogi on Tue Aug 03, 2010 11:50 pm; edited 1 time in total

----------

## grogi

 *PaulBredbury wrote:*   

> freetype 2.4.1 is out, and fixes the problem with missing characters in CartoGothic Std.
> 
> My Infinality patch for 2.4.0 works fine with 2.4.1, and it's better than Ubuntu's rendering. Although, annoyingly for me, it makes most of my Ubuntu-specific fontconfig rule-tweaking obsolete 

 

The BCI Hinting works really great with your patch - I don't have any problems I had before with AutoHinter, and the glyphs look sharp and natural. It looks that my .fonts.conf will be reduced to provide font substitutes while all autohint / hintstyle switches will go away  :Smile: 

----------

## PaulBredbury

 *grogi wrote:*   

> What patches are included?

 

Look right at the top of the patch file:

 *Quote:*   

> # From http://www.infinality.net/fedora/linux/13/SRPMS/freetype-subpixel-2.3.12-3.fc13.src.rpm
> 
> # and modified to patch freetype 2.4.0
> 
> # See http://www.infinality.net/blog/?p=67
> ...

 

If you want to see e.g. freetype-2.3.0-enable-spr.patch, then look at the Fedora src.rpm

Mod Edit: split unhelpful comments off here - tomk

----------

## PaulBredbury

freetype 2.4.2 is out - here's the infinality patch, for the best font-rendering I've seen so far.

For anyone wondering what on Earth a "type 42" font is, the answer is here.

----------

## m.s.w

How to use patches? Should I wrote a custom ebuild to use it?

----------

## bi3l

I gave a look at infinality's patchset and here are a few remarks. I've made some of them directly to moony but he never answered me:

- the subpixel field of the TT_ExecContextRec structure is the same as the existing grayscale field, it can be removed

- the new compatible_widths field is always false, it can be removed

- the new bgr field is always false, it can be removed

- the symmetrical_smoothing is not used, it can be removed

- afaict, skip_x is always 1 and skip_y is always 0, the code can be simplified.

All in all, this patchset may give very good results (I haven't tested it, yet) but it seems to be quite unfinished. If you really want to, I can add it as is to the LCD filtering overlay but I'd prefer waiting for a cleaner version. If someone with better knowledge on freetype then me can check the patchset and give a few advices, I can fix the patches myself if there nothing new on infinality's side.

----------

## Infinality

Hey bi3l-  I finally replied to your post here:   http://www.infinality.net/blog/?p=67&cpage=1#comment-9090

----------

## michaeljr

I've been using the infinality patched freetype on Arch Linux and am trying to set up a new Gentoo box.

I can't find the LCD Filtering repo using layman. How do I add the repo using layman?

Thanks.

----------

## bi3l

 *GoofyX wrote:*   

> @bi3l, the lcd-filtering overlay is not displayed in the listing of layman's overlays. We have to manually add it ourselves and sync it?

 

Yep.

 *michaeljr wrote:*   

> I can't find the LCD Filtering repo using layman. How do I add the repo using layman?

 

Dowload this file, edit /etc/layman/layman.cfg and add "file:///path/to/lcd-filtering.xml" in the 'overlays' section (/path/to being the directory containing lcd-filtering.xml).

----------

## norg

Hi, i switched back to gentoo and the only thing that's still bothering me is "fonts" :/

I added the lcd-filtering overlay but the patched freetype won't appear for emerge.

I downloaded the xml file and put it in the layman config, i could also add it with "layman -a lcd-filtering" but still won't appear.

I'm trying to add this cause my fonts are still not perfect at firefox. In urxvt and on gtk apps like gajim i use terminus what's working smooth.

So i found this thread and hope you can help me.

I made this screenshots to show you some webpage working fine:

http://andi.wootstube.de/up/2010-08-24-012049_1280x1006_scrot.png

These are screenshots from webpages that still seem to be ugly, fontfinder is saying it's Verdana but it looks weird:

http://andi.wootstube.de/up/2010-08-24-012053_1280x1006_scrot.png

http://andi.wootstube.de/up/2010-08-24-012056_1280x1006_scrot.png

http://andi.wootstube.de/up/2010-08-24-012059_1280x1006_scrot.png

http://andi.wootstube.de/up/2010-08-24-012101_1280x1006_scrot.png

As you see for example on the "Polizei" the "i" is thicker than the "l".

I tried turning off anti-aliasing and hinting but it would be worse then.

The fonts were fine with debian so i thinkt there has to be a way to get this working with gentoo.

And here are my settings:

http://andi.wootstube.de/up/eselect_fontconfig.txt

http://andi.wootstube.de/up/xorg.conf

Firefox Font Settings:

Fonts for Western

Proportional: Serif (14)

Serif: serif

Sans-serif: sans-serif

Monospace: monospace (12)

Minimum font size 10

Allow pages to choose their own fonts -> checked

I have no ~/.fonts.conf but i tried the one from PaulBredbury but that one disabled terminus in gtk apps somehow.

Edit: I found out, that the most problems are with Microsoft Fonts like Arial, Verdana, Courier. So i guess they have to be fixed.

For example the "code" environment in this forum uses Courier, Courier New, monospace. When i force monospace it looks fine, but with Courier it looks wrong.

----------

## FizzyWidget

would using the auto-hinter useflag on freetype help or cause more issues?

----------

## PaulBredbury

 *Carps wrote:*   

> would using the auto-hinter useflag on freetype help or cause more issues?

 

Disable it - it won't help in the slightest. You can see from the ebuild what it does.

----------

## FizzyWidget

its not enabled, i was just wondering, i am using your fonts.conf atm and am trying to tweak the hell out anything i can to make the fonts look good  :Smile: 

edit what about the lcdfilter flag?

----------

## norg

How did you manage to get this overlay ebuild working, so that the overlay ebuild is used instead of the one from the default portage tree?

```
root@gentoo_ws:~ # layman -a lcd-filtering

* Running command "/usr/bin/git clone "git://gitorious.org/lcd-filtering/lcd-filtering.git" "/var/lib/layman/lcd-filtering""...

Initialized empty Git repository in /var/lib/layman/lcd-filtering/.git/

remote: Counting objects: 121, done.

remote: Compressing objects: 100% (117/117), done.

remote: Total 121 (delta 41), reused 0 (delta 0)

Receiving objects: 100% (121/121), 77.59 KiB | 63 KiB/s, done.

Resolving deltas: 100% (41/41), done.

* Successfully added overlay "lcd-filtering".

root@gentoo_ws:~ # eix-update -a lcd-filtering

Reading Portage settings ..

Building database (/var/cache/eix) ..

[0] "gentoo" /usr/portage/ (cache: metadata-flat)

     Reading category 154|154 (100%) Finished             

[1] "" /usr/portage/local/overlay (cache: parse|ebuild*#metadata-flat#assign)

     Reading category 154|154 (100%) Finished      

[2] "" lcd-filtering (cache: parse|ebuild*#metadata-flat#assign)

     Reading category 154|154 (100%) EMPTY!
```

So layman -a did succeed but it seems to be empty

Edit: i forgot to update the /etc/make.conf  :Smile: 

So still the issue with fonts like Verdana, Arial etc. that they look messed up.

On my old debian system i used dpkg-reconfigure fontconfig and the settings that made everything fine were:

1. Hinting: Native (instead of Automatic or None) 2. Subpixel: Automatich (instead of Always/Never, although it doesn't affect firefox) 3. Bitmapfonts: yes (without yes fonts like terminus wont work).

So i made two screenshots to show the difference.

Screenshots with Gentoo:

http://andi.wootstube.de/up/2010-08-25-024230_1280x1006_scrot.png

http://andi.wootstube.de/up/2010-08-25-024317_1280x1006_scrot.png

Screenshots with Debian:

http://andi.wootstube.de/up/2010-08-24-220836_1280x1006_scrot.png

http://andi.wootstube.de/up/2010-08-24-220933_1280x1006_scrot.png

corefonts are installed on both system.

Edit2: Another confusing fact, on my gentoo system at work i have the same settings and the fonts are much better. What i found out that xdpyinfo tells me that the 19" LCD at work has 96x96DPI but the 19" LCD has 85x86DPI although both are running on 1280x1024. May this be the issue for the fonts?

Edit3: A nice tool to see what effects hinting and antialiasing will have is "gwaterfall" (you need to get the source from debian). It's just weird that it needs to be started by root to get hint/antialias switch working. Maybe this will help some of you with generating a suitable font.conf.

Ah the issue with root is, that gwaterfall won't work when you have a .fonts.conf, so move it to test font settings.

ok i found the problem but i have no good fix. Althought the FontPath for corefonts is the first in my xorg.conf the corefonts aren't used as first choice. 

```
Section "Files"

    FontPath        "/usr/share/fonts/terminus"

    FontPath        "/usr/share/fonts/corefonts"

    FontPath        "/usr/share/fonts/100dpi/"

    FontPath        "/usr/share/fonts/75dpi/"

    FontPath        "/usr/share/fonts/misc/"

   ...

EndSection
```

But when i use lsof:

```
root@gentoo_ws:~ # lsof | grep fonts

firefox-b 17590       andi  mem       REG              253,5   139640    1976947 /usr/share/fonts/corefonts/verdana.ttf

firefox-b 17590       andi  mem       REG              253,5   154264    1976951 /usr/share/fonts/corefonts/verdanai.ttf

firefox-b 17590       andi  mem       REG              253,5   360337    1859245 /usr/share/fonts/misc/12x13ja.pcf.gz

firefox-b 17590       andi  mem       REG              253,5    96263    2362229 /usr/share/fonts/default/ghostscript/n022003l.pfb

firefox-b 17590       andi  mem       REG              253,5   275572    1976933 /usr/share/fonts/corefonts/arial.ttf

firefox-b 17590       andi  mem       REG              253,5    17969    1859416 /usr/share/fonts/misc/7x13B.pcf.gz

firefox-b 17590       andi  mem       REG              253,5    66372    2362267 /usr/share/fonts/TTF/luxisri.ttf

firefox-b 17590       andi  mem       REG              253,5    26355    1859376 /usr/share/fonts/misc/6x10.pcf.gz

firefox-b 17590       andi  mem       REG              253,5   136032    1978205 /usr/share/fonts/corefonts/verdanab.ttf

firefox-b 17590       andi  mem       REG              253,5    71784    2362294 /usr/share/fonts/TTF/luximr.ttf

firefox-b 17590       andi  mem       REG              253,5     4459    1859430 /usr/share/fonts/misc/6x10-ISO8859-1.pcf.gz

firefox-b 17590       andi  mem       REG              253,5     5063    1880230 /usr/share/fonts/terminus/ter-112n.pcf.gz
```

So now Courier from corefonts is used to render the code section here in the forum. At least some are working like arial and verdana.

Is there anything else i have to check except xorg.conf?

Chromium is doing it right, lsof says /usr/share/fonts/corefonts/cour.ttf

I tried moving all the /usr/share/fonts directories except the corefonts and so i can force corefonts/cour.ttf but that seems to be the right way.

I also tried a fresh archlinux install in vbox and there it's working out of the box, here the comparison (left gentoo, right arch):

http://img178.imageshack.us/img178/4817/201008252133322560x1024.png

you can see the difference on the "@" for example.Last edited by norg on Thu Aug 26, 2010 10:13 pm; edited 1 time in total

----------

## norg

ok i think i fixed it, at least most of it. I switched back to firefox instead of firefox-bin. Although i don't know what's the exact difference.

But there seems to be a bug with "courier" in corefonts. The "code" segment here uses courier then courier new then monospace. If i forbid using courier firefox switches to courier new and it's looking fine. If i look at lsof, firefox doesn't user courier from corefonts but he uses courier new. Well cour.ttf is used when i force courier new, when courier is used lsof prints no relation to the corefonts folder so i guess it must be one of the pcf.gz from the misc folder.

So i want to have courier and maybe courier new replaced, so i tried:

```

 </match>

   <!-- Replace Courier New with a better-looking font -->

   <match target="pattern" name="family">

      <test name="family" qual="any">

         <string>Courier New</string>

      </test>

      <edit name="family" mode="assign">

         <!-- Other choices - Andale Mono, Courier New, Luxi Mono, Bitstream Vera Sans Mono -->

         <string>Bitstream Vera Sans Mono</string>

      </edit>

   </match>

   <!-- Replace Courier New with a better-looking font -->

   <match target="pattern" name="family">

      <test name="family" qual="any">

         <string>Courier</string>

      </test>

      <edit name="family" mode="assign">

         <!-- Other choices - Andale Mono, Courier New, Luxi Mono, Bitstream Vera Sans Mono -->

         <string>Bitstream Vera Sans Mono</string>

      </edit>

   </match>

```

But firefox ignores this, when i use the fontfinder addon and forbid courier/courier new it's working. And yes bitstream is installed  :Smile: 

Edit:

The wrong courier is /usr/share/fonts/default/ghostscript/n022003l.pfb so Nimbus Mono L was mapped to Courier cause of 30-metric-aliases.conf. I think this should be removed from default fontconfig settings.

----------

## PaulBredbury

 *norg wrote:*   

> firefox-bin

 

That won't use the system cairo - need --enable-system-cairo

Your fontconfig rant makes very little sense.

I will repeat again, Infinality's font rendering is superior to Ubuntu's, making most font substitutions unnecessary, because Infinality's font rendering makes the non-substituted fonts look good enough.

----------

## lessless

where is the link to the how-to ?  :Smile: 

----------

## norg

 *PaulBredbury wrote:*   

> Your fontconfig rant makes very little sense.

 

May be but this fixed the issue with Nimbus Mono L used instead of switching to Courier New in Firefox. Chromium does this without changing 30-metric-aliases.conf

 *PaulBredbury wrote:*   

> I will repeat again, Infinality's font rendering is superior to Ubuntu's, making most font substitutions unnecessary, because Infinality's font rendering makes the non-substituted fonts look good enough.

 

And i tried this patch and it looks nice, but the above problem with Nimbus Mono L for Courier was still there.

Edit:

Ok i found out, that with the patch "lcdfilter" from lcd-filtering overlay it looks worse :/

It's not that sharp.

freetype etc. with lcd-filtering overlay patch:

http://andi.wootstube.de/up/2010-08-27-144009_1280x1006_scrot.png

freetype etc. without the patch:

http://andi.wootstube.de/up/2010-08-27-144404_1280x1006_scrot.png

disabled 30-metric-alias.conf:

http://andi.wootstube.de/up/2010-08-27-144656_1280x1006_scrot.png

As you can see with gentoo default settings it looks sharper then with the patch from the overlay and disabling 30-metric helps for the code segment.

Although the rest of the 30-metric.conf is good for arial, so i just deleted the courier part.

----------

## chabo

to PaulBredbury:

Hello,

so You use only /etc/fonts/local.conf and and your ~/.fonts.conf after Infinality patch?

thanks

----------

## PaulBredbury

 *chabo wrote:*   

> use only /etc/fonts/local.conf and and your ~/.fonts.conf

 

Well, there's still the configuration from fontconfig's default install, in /etc/fonts/conf.d/ (as symlinks) which I don't mess with:

```
$ ls /etc/fonts/conf.d/

10-no-sub-pixel.conf       20-unhint-small-vera.conf  30-replace-bitmap-fonts.conf  40-nonlatin.conf  49-sansserif.conf  51-local.conf  65-fonts-persian.conf  69-unifont.conf    90-synthetic.conf

20-fix-globaladvance.conf  30-metric-aliases.conf     30-urw-aliases.conf            45-latin.conf     50-user.conf       60-latin.conf  65-nonlatin.conf       80-delicious.conf
```

----------

## chabo

Thanks, will try

----------

## Infinality

If anyone is interested, I updated my patch to include the Gentoo modifications as well as a new enhancement to synthetic emboldening.  Enjoy:

http://www.infinality.net/blog/?p=67

----------

## PaulBredbury

 *Infinality wrote:*   

> a new enhancement to synthetic emboldening

 

Yeah, it looks better - and gotten from just removing one line of code  :Smile: 

```
outline->points[n].y = v_cur.y + strength + in.y;
```

I've updated my git-following patch.

----------

## Infinality

You don't want to know how much time I spent finding and commenting out that line of code.   :Wink: 

----------

## chabo

 *PaulBredbury wrote:*   

>  *chabo wrote:*   use only /etc/fonts/local.conf and and your ~/.fonts.conf 
> 
> Well, there's still the configuration from fontconfig's default install, in /etc/fonts/conf.d/ (as symlinks) which I don't mess with:
> 
> ```
> ...

 

Just one more question.

Do You use some packages from lcd-filtering overlay or only default gentoo repository plus patched freetype?

I've tried that patch, it looks really nice, but don't know if is it using by all application.

Thanks

----------

## PaulBredbury

 *chabo wrote:*   

> Do You use some packages from lcd-filtering overlay

 

I use Lunar Linux, and for now am still using my own versions of fontconfig, libXft and cairo which include Ubuntu's patches (and my cairo-respect-fontconfig.patch) - basically equivalent to those in the lcd-filtering overlay.

Edit: You need fontconfig, libXft and cairo from the lcd-filtering overlay, otherwise cairo *won't* use the patched freetype's improved rendering.Last edited by PaulBredbury on Thu Sep 09, 2010 5:58 am; edited 1 time in total

----------

## jsevilleja

 *PaulBredbury wrote:*   

> Infinality has a great freetype patch for sub- rather than whole-pixel hinting, which has better font spacing, as an alternative to Ubuntu's freetype LCD patch.
> 
> Here's a freetype-2.4.2-infinality-20100904.patch all-in-one patch I've made for freetype 2.4.2 - take a look at it, to see what it contains.
> 
> I still also recommend adding:
> ...

 

Is there any guide or something? I've edited freetype ebuild from lcd-filtering and tried to apply the patch (freetype-2.4.2-infinality-20100904.patch), but when emerging, it always fails.

EDIT: I managed to build freetype with infinality patch (lcd-filtering ebuild + infinality). What do I've to do now? Thanks

----------

## chabo

I think after pacth of freetype You should use .fonts.conf from PaulBredbury or /etc/fonts/local.conf from Infinality's web. Also You have to use "lcdfilter" flag for x11-libs/cairo and it's all(same for x11-libs/libXft if You use lcd-filtering overlay)

----------

## rahulthewall

I just updated the following packages from the lcd-filtering overlay:

```

##LCD Filtering Overlay

media-libs/fontconfig lcdfilter -cleartype

media-libs/freetype lcdfilter -cleartype

x11-libs/cairo glitz lcdfilter -cleartype

x11-libs/libXft lcdfilter -cleartype

```

Whether or not this is a horrible combination of use flags I would like to know. Also, what should my .fonts.conf look like?

----------

## Infinality

Yet another patch update.   Among a few enhancements, this one also removed a couple things I think you guys had enabled in modules.cfg, just so you are aware.

http://www.infinality.net/blog/?p=67

----------

## SlashBeast

Is lcd-filtering still maintained? Maybe some of you will ask for commit rights and will push updates because looks like owner of this overlay does not (for some reason) update it.

----------

## devsk

Can someone please tell what patch needs to be applied on top what's in portage at this time?

Which packages are to be modified? freetype, libXft. Anything else?

----------

## PaulBredbury

People seem confused, so let's recap. To get the current state-of-the-art in font rendering:

1.  Apply Infinality's freetype patches (example: pross overlay). Edit: Also consider the Gibson filter - sed one-liner, which I still think looks smoother than the default.

2.  Apply Ubuntu's patches to fontconfig. (This step doesn't seem to be strictly required, but this would be the right time to do it.)

3.  Apply Ubuntu's patches to libXft, so that apps which use libXft will use the better rendering.

4.  Apply Ubuntu's patches to cairo, so that apps which use cairo will use the better rendering. Also apply my cairo-respect-fontconfig.patch, so that ~/.fonts.conf isn't occasionally ignored.

5.  Use Infinality's fontconfig rules, in /etc/fonts/conf.d/ or as ~/.fonts.conf

6.  For completeness, set up ~/.Xresources - this is the "backup" settings for crappy/old programs which don't use fontconfig.

7.  Restart your apps (e.g. firefox) and marvel at the beautiful fonts.

Edit: Clarified why ~/.Xresources is used.Last edited by PaulBredbury on Sun Sep 04, 2011 8:44 pm; edited 2 times in total

----------

## swimmer

Thank you very much Paul for this splendid summary!

Can't Infinality's freetype patches not be merged in the lcd-filtering overlay (like all the other patches)? Otherwise it's quite some hazzle to get all the bits & pieces together from different overlays and keep them uptodate ...

Kindly yours

swimmer

----------

## ssteinberg

 *PaulBredbury wrote:*   

> People seem confused, so let's recap. To get the current state-of-the-art in font rendering:
> 
> 1.  Apply Infinality's freetype patches (example: pross overlay).
> 
> 2.  Apply Ubuntu's patches to fontconfig. This step doesn't seem to be strictly required.
> ...

 

Tried this and took screenshot to compare against cairo with cleartype. Quality isn't bad, but as much as I tried, cleartype seems to produce clearer, crispier fonts on my LCD. I am sticking with cleartype.

----------

## ssteinberg

Here is a quickly hacked together comparison screenshots:

http://i56.tinypic.com/dxjko0.jpg

----------

## PaulBredbury

 *ssteinberg wrote:*   

> clearer, crispier fonts

 

I suggest you try e.g.:

sed -i -e "s:0x10, 0x40, 0x70, 0x40, 0x10:0, 85, 86, 85, 0:" src/base/ftlcdfil.c

in freetype2 (I got those numbers from here).

Looks ugly to me, though.

----------

## guiohm

 *PaulBredbury wrote:*   

> People seem confused, so let's recap. To get the current state-of-the-art in font rendering:
> 
> 1.  Apply Infinality's freetype patches (example: pross overlay).
> 
> 2.  Apply Ubuntu's patches to fontconfig. This step doesn't seem to be strictly required.
> ...

 

First, thanks a lot for this recap (and for the hard work behind it -> PaulBredbury, Infinality, Ubuntu's team...)

My fresh gentoo install can now stand the comparison with OS X that is running just aside.

I think we should make a sort of "Cleartype Settings Tool", at least for gentoo (like a "Cleartype USE-flag setting tool" maybe ?) to permit users to choose easily their "cleartype" preferences.

The first reason is that I spend at least 2 hours to figure how to get a "correct rendering of fonts" (it's subjective I know).

The second reason is that even if I much prefer the result of this recap, it may not be the taste of someone else. So the user should have a choice.

Anyway, Thanks.

----------

## Infinality

Anybody seen patches around that will allow you to specify the LCD filter weights with fontconfig?  In other words, inside your fonts.conf or local.conf?

(edit:  I'm referring to custom FIR weights, like:  [0.1, 0.2, 0.4, 0.2, 0.1] )Last edited by Infinality on Tue Sep 14, 2010 12:22 pm; edited 1 time in total

----------

## SlashBeast

Thanks to Olivier Rolland, lcd-filtring overlay is now in gentoo's layman.

----------

## bi3l

I've commited infinality's patchset to the LCD filtering overlay. Enable the lcd-filter USE flag for cairo, fontconfig, libXft and freetype and you'll have everything you need except infinality's fontconfig rules and .Xresources configuration.

----------

## devsk

 *PaulBredbury wrote:*   

> People seem confused, so let's recap. To get the current state-of-the-art in font rendering:
> 
> 1.  Apply Infinality's freetype patches (example: pross overlay). Edit: Also consider the Gibson filter - sed one-liner, which I still think looks smoother than the default.
> 
> 2.  Apply Ubuntu's patches to fontconfig. (This step doesn't seem to be strictly required, but this would be the right time to do it.)
> ...

 

 *Quote:*   

> I've commited infinality's patchset to the LCD filtering overlay. Enable the lcd-filter USE flag for cairo, fontconfig, libXft and freetype and you'll have everything you need except infinality's fontconfig rules and .Xresources configuration.

 

OK, someone help me please. My fonts have taken a turn for the worse with this change. They look washed up and have blurs around turns. What I did:

1. Added lcd-filtering overlay as bi3l has added all patches to his overlay.

2. Enabled lcdfilter and removed cleartype USE flag.

3. Emerged cairo fontconfig freetype libXft. They had lcdfilter enabled as shown by emerge command output with -v.

4. I copied the /etc/fonts/local.conf to /etc/fonts/conf.d/51-local.conf.

5. Edited ~/.Xresources and added:

```
! Settings from Infinality

Xft.autohint:                   0

Xft.lcdfilter:                  lcddefault

Xft.hintstyle:                  hintfull

Xft.hinting:                    1

Xft.antialias:                  1

Xft.dpi:                        96

Xft.rgba:                       rgb
```

6. Made the 'eselect fontconfig list' look like the following:

```
# eselect fontconfig list

Available fontconfig .conf files (* is enabled):

  [1]   10-antialias.conf *

  [2]   10-autohint.conf

  [3]   10-hinting.conf *

  [4]   10-hinting-full.conf *

  [5]   10-hinting-medium.conf

  [6]   10-hinting-slight.conf

  [7]   10-no-sub-pixel.conf

  [8]   10-sub-pixel-bgr.conf

  [9]   10-sub-pixel-rgb.conf *

  [10]  10-sub-pixel-vbgr.conf

  [11]  10-sub-pixel-vrgb.conf

  [12]  10-unhinted.conf

  [13]  11-lcd-filter-lcddefault.conf

  [14]  20-fix-globaladvance.conf

  [15]  20-unhint-small-dejavu-sans.conf

  [16]  20-unhint-small-dejavu-sans-mono.conf

  [17]  20-unhint-small-dejavu-serif.conf

  [18]  20-unhint-small-vera.conf

  [19]  25-unhint-nonlatin.conf

  [20]  30-metric-aliases.conf *

  [21]  30-urw-aliases.conf *

  [22]  40-nonlatin.conf *

  [23]  45-latin.conf *

  [24]  49-sansserif.conf *

  [25]  50-user.conf

  [26]  51-local.conf *

  [27]  53-monospace-lcd-filter.conf

  [28]  57-dejavu-sans.conf

  [29]  57-dejavu-sans-mono.conf

  [30]  57-dejavu-serif.conf

  [31]  60-latin.conf *

  [32]  65-fonts-persian.conf *

  [33]  65-khmer.conf

  [34]  65-nonlatin.conf *

  [35]  69-unifont.conf *

  [36]  70-no-bitmaps.conf *

  [37]  70-yes-bitmaps.conf

  [38]  80-delicious.conf *

  [39]  90-synthetic.conf *

```

I restarted thunderbird and bam! Fonts are worse than before.

So, what did I do to deserve faded, blurry, washed up fonts? My favorite font 'Fontin' is looking horrible!

----------

## devsk

 *bi3l wrote:*   

> I've commited infinality's patchset to the LCD filtering overlay. Enable the lcd-filter USE flag for cairo, fontconfig, libXft and freetype and you'll have everything you need except infinality's fontconfig rules and .Xresources configuration.

 How come the Emboldening patch is not included in the patchset?

----------

## devsk

This was as painful as I had expected it. The end result is I can't even restore the damn thing to my font appearance that I had earlier....sigh!

What a classic waste of time! Man, I am really upset now!

----------

## PaulBredbury

 *devsk wrote:*   

> Emerged cairo fontconfig freetype libXft

 

Your compilation order is wrong. God knows what made you do that. The correct order is as I already stated above, and have repeated many times in this huge thread.

----------

## devsk

 *PaulBredbury wrote:*   

>  *devsk wrote:*   Emerged cairo fontconfig freetype libXft 
> 
> Your compilation order is wrong. God knows what made you do that. The correct order is as I already stated above, and have repeated many times in this huge thread.

 Does the order matter if you fire that command twice?

And i just checked: portage emerges them in order, no matter how you specify them on the command line as long as they are all specified, which I did.

So, that's not the cause.

----------

## PaulBredbury

 *devsk wrote:*   

> Does the order matter if you fire that command twice?

 

No.

 *devsk wrote:*   

> /etc/fonts/conf.d/51-local.conf

 

That's a bad choice of filename, because it already exists, as a symlink created by fontconfig. I prefer and use ~/.fonts.conf

 *Infinality wrote:*   

> Anybody seen patches around that will allow you to specify the LCD filter weights with fontconfig?

 

I looked, but can't find any. There's the bug report, resulting in FT_Library_SetLcdFilterWeights in freetype2, but no fontconfig patch to use it.

----------

## devsk

 *PaulBredbury wrote:*   

>  *devsk wrote:*   /etc/fonts/conf.d/51-local.conf 
> 
> That's a bad choice of filename, because it already exists, as a symlink created by fontconfig. I prefer and use ~/.fonts.conf

 Why do you think I wouldn't have verified what that contained originally and either merged it or deemed it unnecessary? It was just setting hintslight and rgba=none for Segui UI and Consolas fonts.

Again, not a problem.

Got something else?

One thing I notice is that cairo's ubuntu patch in lcd filtering overlay is very minimal and changes only config or makefile stuff in 1.10 whereas it changed a tonne of real C code for 1.8. Is that right?

----------

## PaulBredbury

Ubuntu's patches were applied upstream - example.

----------

## devsk

OK. It seems like infinality's patches screw up certain fonts while making some other fonts look good. When I moved to Lucida Grande, things are looking much better.

My favorite font Fontin is rendered pretty crappy by infinality's patch.

@infinality: can you please use the Fontin font and test to see what tuning is needed to render that font better with your patch? I see you have tweaks for Lucida, Verdana etc. in the code. Fontin rendering is full of smears in 'e', 'S' etc. Basically, wherever there is a curve. Bold Fontin is completely unreadable.

Yes, Lucida Grande is rendered much better than I have ever seen it. At all sizes.

----------

## PaulBredbury

Infinality has more changes - for the "main patch", use 20100916-1 instead of 20100909-2.

My quick impression is that it looks better, and "sharper".

----------

## devsk

 *PaulBredbury wrote:*   

> Infinality has more changes - for the "main patch", use 20100916-1 instead of 20100909-2.
> 
> My quick impression is that it looks better, and "sharper".

 Crap! Another one! I just downloaded the 0914 yesterday night and replaced it inside lcd-filtering overlay.

----------

## Infinality

 *devsk wrote:*   

> OK. It seems like infinality's patches screw up certain fonts while making some other fonts look good. When I moved to Lucida Grande, things are looking much better.
> 
> My favorite font Fontin is rendered pretty crappy by infinality's patch.
> 
> @infinality: can you please use the Fontin font and test to see what tuning is needed to render that font better with your patch? I see you have tweaks for Lucida, Verdana etc. in the code. Fontin rendering is full of smears in 'e', 'S' etc. Basically, wherever there is a curve. Bold Fontin is completely unreadable.
> ...

 

It looks like this font has few or no truetype instructions in it, in which case, it isn't going to render will with a truetype interpreter.  One of my goals is to make it so that fonts without instructions render nicely, however there is already a solution that is most of the way there-  the freetype autohinter.   Why not just have this font use autohinting, via your fonts.conf or local.conf?

----------

## Infinality

 *PaulBredbury wrote:*   

> Infinality has more changes - for the "main patch", use 20100916-1 instead of 20100909-2.
> 
> My quick impression is that it looks better, and "sharper".

 

I would tend to agree with your impression.  Some of the change is very subtle, but I did notice this as well.  The only significant change I did was to disable the "grayscale" flag when "subpixel" was enabled.  Apparently some bytecode instructions DO make a differentiation there.  Previously, I just left the grayscale flag enabled, because I *assumed* it didn't matter!    :Very Happy: 

----------

## Infinality

devsk-  I'll add all the fonts from this page into my /etc/fonts/local.conf under "autohint" for the time being, until they look nicer with the TT interpreter:

http://www.josbuivenga.demon.nl/fontin.html

(edit:  Oh yeah, and Lucida Grande looks awesome with the patch!  Completely agree!)Last edited by Infinality on Fri Sep 17, 2010 12:09 am; edited 1 time in total

----------

## devsk

 *Infinality wrote:*   

>  *devsk wrote:*   OK. It seems like infinality's patches screw up certain fonts while making some other fonts look good. When I moved to Lucida Grande, things are looking much better.
> 
> My favorite font Fontin is rendered pretty crappy by infinality's patch.
> 
> @infinality: can you please use the Fontin font and test to see what tuning is needed to render that font better with your patch? I see you have tweaks for Lucida, Verdana etc. in the code. Fontin rendering is full of smears in 'e', 'S' etc. Basically, wherever there is a curve. Bold Fontin is completely unreadable.
> ...

 Ohh you bugger! You really know what you are talking about! Done! Fontin looks very good now.

One more issue, and I think I would stop bugging you after that: The capital letters look zoomed out and total stand out. I think way more than they should. This is with the Lucida Grande font.

----------

## Infinality

 *devsk wrote:*   

> One more issue, and I think I would stop bugging you after that: The capital letters look zoomed out and total stand out. I think way more than they should. This is with the Lucida Grande font.

 

Can you post a screenshot somewhere?

----------

## devsk

 *Infinality wrote:*   

>  *devsk wrote:*   One more issue, and I think I would stop bugging you after that: The capital letters look zoomed out and total stand out. I think way more than they should. This is with the Lucida Grande font. 
> 
> Can you post a screenshot somewhere?

 I think it just may be the fact that I am not used to this look. But I will try to post a screenshot.

----------

## Infinality

I will have an update soon... maybe this weekend, that will make even more dramatic improvements to most MS legacy fonts in particular.  Arial, Trebuchet, and Tahoma look fantastic!  I found a nice tweak in light of the latest grayscale variable removal.

----------

## mbar

That would be great!

EDIT: Best. Overlay. Ever. At last SegoeUI looks like in Win7.   :Wink: 

----------

## rahulthewall

How to get the Windows and Apple fonts on Linux (apologies for the noob question - but I couldn't find Lucida Grande anywhere on the net).

Also, what are the fonts I need to have installed to use the .fonts.conf provided by Infinality.

----------

## PaulBredbury

 *rahulthewall wrote:*   

> what are the fonts I need to have installed to use the .fonts.conf provided by Infinality.

 

None in particular. Fontconfig can/will only use the fonts that are available on the system. Example, using my custom ~/.fonts.conf

```
$ fc-match serif

times.ttf: "Times New Roman" "Normal"  # Using a custom fontconfig rule

$ fc-match sans

DejaVuSans.ttf: "DejaVu Sans" "Book"  # Standard stuff

$ fc-match "this font is missing"  # No such font.

DejaVuSans.ttf: "DejaVu Sans" "Book"  # Fontconfig falls back to good ol' DejaVu
```

----------

## wantilles

I studied the cairo-1.10-r3 ebuild in the lcd-filtering overlay, and I have a question to ask.

How do you really implement cleartype functionality - if you do implement it - since there is no epatch clause to apply the relevant patch (cairo-1.2.4-lcd-cleartype-like.diff) in the ebuild, under any condition (USE flag)?

----------

## PaulBredbury

 *wantilles wrote:*   

> implement cleartype functionality

 

Look in the freetype2 ebuild.

Infinality, to satisfy everyone, can you please add a copy of the old cleartype-style rendering - some people still prefer it, although I'm not sure why  :Confused: 

----------

## rahulthewall

 *PaulBredbury wrote:*   

>  *rahulthewall wrote:*   what are the fonts I need to have installed to use the .fonts.conf provided by Infinality. 
> 
> None in particular. Fontconfig can/will only use the fonts that are available on the system. Example, using my custom ~/.fonts.conf
> 
> ```
> ...

 

Thanks for this. Then I don't need to bother about installing all the extra fonts. Also could you tell me, how to change these defaults - I would like to make Droid Sans (Serif) the default.

----------

## PaulBredbury

 *rahulthewall wrote:*   

> how to change these defaults

 

Read this thread, then you'll know. Just look at some sample fontconfig files, e.g. mine.

----------

## rahulthewall

 *PaulBredbury wrote:*   

>  *rahulthewall wrote:*   how to change these defaults 
> 
> Read this thread, then you'll know. Just look at some sample fontconfig files, e.g. mine.

 

Cool, that is all I wanted to know (whether the changes are to made in .fonts.conf). Will start editing. Thanks again.

----------

## wantilles

 *PaulBredbury wrote:*   

>  *wantilles wrote:*   implement cleartype functionality 
> 
> Look in the freetype2 ebuild.
> 
> Infinality, to satisfy everyone, can you please add a copy of the old cleartype-style rendering - some people still prefer it, although I'm not sure why 

 

Indeed, I had been looking in packages-debian-org, and in here, for a way to implement the exact patch you are referring to, on top of the new cairo 1.10.

----------

## wantilles

 *PaulBredbury wrote:*   

>  *wantilles wrote:*   implement cleartype functionality 
> 
> Look in the freetype2 ebuild.

 

I just did. I admit that my ebuild-ish might be a bit rusty, but there is nothing specific happening if the USE flag cleartype is used - and the funny part is that it's used by default.

And the only patch that is applied regardless of USE flags specified, is the freetype2-2.3.2-enable-valid.patch.

----------

## KejPi

 *PaulBredbury wrote:*   

> can you please add a copy of the old cleartype-style rendering - some people still prefer it, although I'm not sure why 

 

Well, maybe I did something wrong by using lcdfilter Lucida Grande doesn't look good also DejaVu Sans doesn't look good. On the other hand Droid Sans looks much better nevetheless I'm still not sure wheter it looks better than cleartype or not. It seems to me quite much blurry.

----------

## PaulBredbury

wantilles, the point is that the lcdfilter code *should* be in freetype2 (rather than cairo), under the control of the fontconfig rules.

Then you will be able to render e.g. Lucida Grande with lcdfilter, DejaVu Sans with cleartype, and Droid Sans with Infinality's rendering. Or whatever combination you want, by editing the fontconfig rules. Also, the apps which don't even use cairo (but do use freetype2) will not be excluded.

----------

## Infinality

 *PaulBredbury wrote:*   

>  *wantilles wrote:*   implement cleartype functionality 
> 
> Look in the freetype2 ebuild.
> 
> Infinality, to satisfy everyone, can you please add a copy of the old cleartype-style rendering - some people still prefer it, although I'm not sure why 

 

My goal is to make every existing option, and every new one configurable.  In the particular case you are referring to:  "infinality" vs. "cleartype" (which BTW is a very poor choice of package name that increases confusion), there is no way to enable one or the other through fontconfig currently, unless fontconfig is modified.  I've been down that road already  :Wink:  .  Currently this can only be done at compile time in freetype.  

But this brings up a much larger issue, which is that the existing freetype / fontconfig interaction is a hodgepodge of band-aids on band-aids that is confusing, difficult to use, and hard to extend from a coding point of view due to lots of interdependencies and assumptions.  For instance, "slight hinting" always implies autohint within freetype.  Instead of something like this in fontconfig:

```
   <match target="font" >

      <edit mode="assign" name="hinting" >

         <bool>true</bool>

      </edit>

      <edit mode="assign" name="autohint" >

         <bool>false</bool>

      </edit>

      <edit mode="assign" name="antialias" >

         <bool>true</bool>

      </edit>

      <edit mode="assign" name="hintstyle" >

         <const>hintfull</const>

      </edit>

      <edit name="lcdfilter" mode="assign">

         <const>lcddefault</const>

      </edit>

   </match>
```

... I think we need something like ....

```
   <match target="font" >

      

      <!-- The two main options -->

      <edit mode="assign" name="hintstyle" >

         <const> [ none | autohint-light | autohint-full | TT-native | TT-subpixel | ....... ] </const>

      </edit>

      <edit mode="assign" name="rendering" >

         <const> [ monochrome | antialiased | subpixel | ......]  </const>

      </edit>

      <!-- Options for any of the above options -->

      <edit name="subpixel-filter" mode="assign">  <!-- applies if subpixel rendering is enabled -->

         <const>[ lcddefault | lcdlight | lcdnone | ........ ]</const>

      </edit>

      <edit name="subpixel-geometry" mode="assign">  <!-- applies if subpixel rendering is enabled -->

         <const>[ unknown | rgb | bgr | vrgb | vbgr | none ........ ]</const>

      </edit>

      .....

      .....

   </match>
```

This creates a proper separation between all the layers involved in bringing the font to the screen, allows for any combination of options that one desires, and is easily extensible.  Everyone's needs can be met this way.  The only problem is that the existing hodgepodge is pretty ingrained.

 :Mad: 

----------

## Infinality

Just to translate the above into Gentoo-ese, 

What you guys call cleartype is:    

native-TT hinting, subpixel rendering

What you guys call infinality is:     

subpixel-TT hinting, subpixel rendering

What Windows XP/Vista/7 Cleartype is:

subpixel-TT hinting, subpixel rendering

What Apple seems to do:

no hinting, subpixel rendering

The settings that look like Win98:  

native-TT hinting, monochrome rendering

What Microsoft calls "smooth edges of screen fonts" in Win98:    

native-TT hinting, antialiased rendering on bold

What mechmg93 on the archlinux forum likes:

native-TT hinting, antialiased rendering on everything

Everybody likes something different I guess.  Of course.... they are wrong, but that is their right.    :Very Happy: 

----------

## ^marcs

wow, those patches are rly nice piece of work! keep it going please  :Smile: 

in my configuration everything is looking good, but there is one thing that's bugging  me, when i pick "subpixel rendering" in gnome fonts configuration, my terminal text scrolling it quite slow, especialy when maximized - it might be urxvt performance issue, no idea, when ill pick up "best shapes" urxvt works like a charm.

also fonts in java applications (netbeans, running on sun-jre) became totaly messed up, stretched in horizontal like hell, but thats offtopic.

----------

## Infinality

... it will hopefully be coming soon.   I'm thinking this one is going to "WOW" people.  Legacy MS fonts just look fantastic, and I've got the code looking much nicer too.  I know I said maybe last weekend, but maybe this weekend.   :Wink: 

----------

## rahulthewall

I am using Droid Sans as my default fonts. I currently do not like how my bold fonts are rendered.

http://i.imgur.com/9MLcO.png

----------

## rahulthewall

Also, Inconsolata seems to misbehave in the terminal (konsole).

http://imgur.com/kx468

----------

## Infinality

Yes, like I mention on my page at infinality.net, this patch is by no means perfect.  Part of the problem you are running into actually has nothing to do with my patch, but the fact that those fonts have missing or poor TT hinting information in them-  so, freetype is simply doing what the font tells it to do.  Does the regular BCI-enabled freetype do any better on these fonts than the patched version?  I don't know for sure but I'm guessing not.

Until fonts like this are somehow handled in my patch "by default", your best bet is to do what has always been available to do:  Use fontfontconfig settings to adjust your preferred hint settings on a font by font basis.  I'm guessing autohint "slight hinting" would be appropriate for these fonts.

----------

## rahulthewall

 *Infinality wrote:*   

> Yes, like I mention on my page at infinality.net, this patch is by no means perfect.  Part of the problem you are running into actually has nothing to do with my patch, but the fact that those fonts have missing or poor TT hinting information in them-  so, freetype is simply doing what the font tells it to do.  Does the regular BCI-enabled freetype do any better on these fonts than the patched version?  I don't know for sure but I'm guessing not.
> 
> Until fonts like this are somehow handled in my patch "by default", your best bet is to do what has always been available to do:  Use fontfontconfig settings to adjust your preferred hint settings on a font by font basis.  I'm guessing autohint "slight hinting" would be appropriate for these fonts.

 

But Inconsolata is using slight hinting, or somehow the settings from .fonts.conf are not respected.

```

 <!-- Make these fonts use autohint slight hinting -->

 <match target="font">

  <test name="family" qual="any">

   ...

   <string>Inconsolata</string>

   ...

  </test>

  <edit mode="assign" name="autohint">

   <bool>true</bool>

  </edit>

  <edit mode="assign" name="hintstyle">

   <const>hintslight</const>

  </edit>

 </match>

```

I am using the .fonts.conf that you provide.

----------

## PaulBredbury

 *rahulthewall wrote:*   

> the settings from .fonts.conf are not respected

 

Do a tiny bit of actual work yourself, and you'll answer your own question.

Read this huge thread, which is full of essential information, and notice the patch I keep mentioning - cairo-respect-fontconfig.patch

Play with the fontconfig rules, and you can easily see for yourself whether the rules are being obeyed, e.g. set:

```
    <edit name="antialias" mode="assign"><bool>false</bool></edit>
```

And the font will look horrendously bitmapped, which is a dead giveaway.

----------

## bi3l

For the record, cairo-respect-fontconfig.patch is applied by the ebuilds of the LCD filtering overlay.

----------

## rahulthewall

 *PaulBredbury wrote:*   

>  *rahulthewall wrote:*   the settings from .fonts.conf are not respected 
> 
> Do a tiny bit of actual work yourself, and you'll answer your own question.
> 
> Read this huge thread, which is full of essential information, and notice the patch I keep mentioning - cairo-respect-fontconfig.patch
> ...

 

From what I understood, the cairo-respect-fontconfig.patch is supposed to respect the settings which are set via eselect fontconfig. And I knew the lcd-filtering overlay contained that patch and thus forgot to mention that I am in fact using that patch. I turned off antialiasing in .fonts.conf as you suggested and there was no change in how fonts are rendered which now confirms my suspicion that the settings in .fonts.conf are being ignored.

I think, (and I might be totally mistaken here), that the settings in fontconfing (the ones set via eselect fontconfig) are overriding the settings specified in .fonts.conf. I am now going to make some tests to verify this.

----------

## norg

 *PaulBredbury wrote:*   

> Read this huge thread, which is full of essential information

 

I think it would help if we create a wiki page for this issue or a seperated howto thread. This thread is huge and with discussions. A wiki/howto that gathers the information and summarizes it would help a lot i guess.

----------

## bi3l

I've just created a wiki on the gitorious page of LCD filtering. It's very limited at the moment, but feel free to improve it (everyone has write access).

----------

## pross

 *bi3l wrote:*   

> I've just created a wiki on the gitorious page of LCD filtering. It's very limited at the moment, but feel free to improve it (everyone has write access).

 

Nice idea  :Smile: 

----------

## rahulthewall

I deleted the .fonts.conf file, and configured everything via eselect fontconfig. I am quite satisfied with the way my fonts look now - Inconsolata (on konsole) is back to the perfection it was. This is what eselect fontconfig list currently reports:

```

rahul@googly ~ $ eselect fontconfig list

Available fontconfig .conf files (* is enabled):

  [1]   10-antialias.conf *

  [2]   10-autohint.conf

  [3]   10-hinting-full.conf *

  [4]   10-hinting-medium.conf

  [5]   10-hinting-slight.conf

  [6]   10-hinting.conf *

  [7]   10-no-sub-pixel.conf

  [8]   10-sub-pixel-bgr.conf

  [9]   10-sub-pixel-rgb.conf *

  [10]  10-sub-pixel-vbgr.conf

  [11]  10-sub-pixel-vrgb.conf

  [12]  10-unhinted.conf

  [13]  11-lcd-filter-lcddefault.conf *

  [14]  20-fix-globaladvance.conf

  [15]  20-unhint-small-dejavu-sans-mono.conf

  [16]  20-unhint-small-dejavu-sans.conf

  [17]  20-unhint-small-dejavu-serif.conf

  [18]  20-unhint-small-vera.conf

  [19]  25-unhint-nonlatin.conf

  [20]  30-metric-aliases.conf *

  [21]  30-urw-aliases.conf *

  [22]  40-nonlatin.conf *

  [23]  45-latin.conf *

  [24]  49-sansserif.conf *

  [25]  50-user.conf *

  [26]  51-local.conf *

  [27]  53-monospace-lcd-filter.conf *

  [28]  57-dejavu-sans-mono.conf *

  [29]  57-dejavu-sans.conf *

  [30]  57-dejavu-serif.conf *

  [31]  60-latin.conf *

  [32]  60-liberation.conf *

  [33]  65-fonts-persian.conf *

  [34]  65-khmer.conf *

  [35]  65-nonlatin.conf *

  [36]  66-lohit-assamese.conf *

  [37]  66-lohit-bengali.conf *

  [38]  66-lohit-gujarati.conf *

  [39]  66-lohit-hindi.conf *

  [40]  66-lohit-kannada.conf *

  [41]  66-lohit-kashmiri@devanagari.conf *

  [42]  66-lohit-konkani.conf *

  [43]  66-lohit-maithili.conf *

  [44]  66-lohit-marathi.conf *

  [45]  66-lohit-oriya.conf *

  [46]  66-lohit-punjabi.conf *

  [47]  66-lohit-sindhi@devanagari.conf *

  [48]  66-lohit-tamil.conf *

  [49]  66-lohit-telugu.conf *

  [50]  67-lohit-malayalam.conf *

  [51]  67-lohit-nepali.conf *

  [52]  69-unifont.conf *

  [53]  70-no-bitmaps.conf *

  [54]  70-yes-bitmaps.conf

  [55]  80-delicious.conf *

  [56]  90-synthetic.conf *

```

----------

## kernelOfTruth

IMO it would be better to outsource the discussion part of this HOWTO to the thread I just created:

 Freetype subpixel font rendering - discussion thread 

this should keep this howto more clear and only the essence shall stay in here

@PaulBredbury, Infinality:

thanks for your work in this area - my fonts really look clearer and better readable now

----------

## rahulthewall

So, I took the time and (as PaulBredburdy suggested) went through the thread, and I think I am now quite satisfied with the way my fonts look. I put together my experience in my blog. If anyone thinks this is OK, they can push it to git.

http://blog.segfault.co.in/?p=192

----------

## Infinality

Updated patches here!     :Very Happy: 

http://www.infinality.net/blog/?p=67

----------

## mbar

 *Infinality wrote:*   

> Updated patches here!    
> 
> 

 

Updated ebuilds where?  :Wink: 

----------

## bi3l

In the LCD filtering overlay.

----------

## pross

freetype 2.4.3 is in portage

----------

## Infinality

Updated patch for freetype-2.4.3:

http://www.infinality.net/blog/?p=67

----------

## GoofyX

The updated patch hasn't make it to the lcd-filtering overlay, right?

----------

## bi3l

 *GoofyX wrote:*   

> The updated patch hasn't make it to the lcd-filtering overlay, right?

 

Wrong.

----------

## GoofyX

Ok, a few minutes ago, before posting my message, the overlay was not updated. Now, it is.

Thanks for the great work guys!

----------

## GoofyX

OK, I get a Manifest error:

```
>>> Verifying ebuild manifests

!!! A file is not listed in the Manifest: '/var/lib/layman/lcd-filtering/media-libs/freetype/files/freetype-2.4.3-ubuntu.patch'

```

----------

## bi3l

I'll fix that asap.

----------

## GoofyX

Ok, I updated freetype, but the fonts look worse to me than before. How can I tell if I'm using the patented bytecode interpreter from freetype (isn't this the cleartype)? The difference now is that the fonts look more bold and reddish in some points, because of the antialising. The bad thing is that I cannot revert to the initial situation.

----------

## pross

```
Calculating dependencies... done!

>>> Verifying ebuild manifests

!!! A file is not listed in the Manifest: '/var/lib/layman/lcd-filtering/media-libs/freetype/files/freetype-2.4.3-ubuntu.patch'
```

I did it manually and package installed.

----------

## GoofyX

Actually, the fonts look good. It's that I got used to the ones without the lcdfilter flag. Disabling it and restarting X, the fonts displayed as before (which is strange, since I always had the lcdfilter enabled). So, with -lcdfilter, what is this equal to, regarding hinting, antialiasing, etc.?

----------

## bi3l

```
>>> Verifying ebuild manifests

!!! A file is not listed in the Manifest: '/var/lib/layman/lcd-filtering/media-libs/freetype/files/freetype-2.4.3-ubuntu.patch'

```

Fixed.

----------

## PaulBredbury

Due to Infinality bugs I suggest downgrading, for the time being.

----------

## rahulthewall

 *PaulBredbury wrote:*   

> Due to Infinality bugs I suggest downgrading, for the time being.

 

Thanks for this, I was beating my head against the wall wondering why okular is crashing!  :Smile: 

----------

## kernelOfTruth

 *rahulthewall wrote:*   

>  *PaulBredbury wrote:*   Due to Infinality bugs I suggest downgrading, for the time being. 
> 
> Thanks for this, I was beating my head against the wall wondering why okular is crashing! 

 

I had the same problems 

thanks for the heads up !   :Surprised: 

----------

## Infinality

Not sure what is causing the crashes, but good to hear the reports.  I'll hopefully get a fix this weekend.

EDIT:  Solved.  See post below.Last edited by Infinality on Sat Oct 09, 2010 1:51 am; edited 1 time in total

----------

## Infinality

I have identified what is causing the crash.  It appears it has something to do with the font family name not being set.  Next patch will have this fix in it.

EDIT:  Fixed.  http://www.infinality.net/blog/?p=67

----------

## PaulBredbury

 *Infinality wrote:*   

> Fixed.

 

No. Neither bug is fixed by freetype-add-subpixel-hinting-infinality-20101008-1.patch

Open this page or this PDF, and firefox/evince crashes.

----------

## Infinality

Ahh crap!  I updated the comments in the correct patch file, and added the fix to an old patch file.  Ok, now this time I tested it and it really works, for real!   Please re-download.

----------

## PaulBredbury

Thanks, your *new* freetype-add-subpixel-hinting-infinality-20101008-1.patch (filesize 94312) fixes those 2 bugs.

----------

## Infinality

Even though I specifically pointed out that this particular patch (20101004-2) was probably broken, I still hate to have people spinning their wheels with problems and bugs.  You guys are kind of my "beta testers" as I get the most feedback out of you.  I check the Gentoo and Archlinux forums pretty regularly, but if you find an issue, feel free to make a post on my blog.  

---

Also, on an unrelated note, I do like the Gibson filter you have been pushing { 0x1c, 0x38, 0x55, 0x38, 0x1c }, but I've found that at least on my monitor, it looks better with 0x60 in the middle.  I think the FIR filter is very dependent on one's monitor contrast and gamma.  On my monitor at work, I'm pretty sure the default Gibson filter would look much nicer.  That's what you get when you buy a cheap monitor.   :Wink: 

I'm working on a "membership/sigmoidal function" filter to precede the FIR filter, which does a pretty good job of duplicating the "Microsoft graininess", for those that prefer it that way.  Basically it lowers values less than half intensity, and raises those above half intensity.  If you want to tinker with it here it is:

val = 256.0 /(1.0+exp(-(10.0*(val/256.0-.5))));

It goes right before the line  "pix    = fir[0] + weights[0] * val;"

----------

## PaulBredbury

 *Quote:*   

> hate to have people spinning their wheels with problems and bugs

 

This single, huge, public thread is primarily for users, and tweakers (e.g. me). We want to know what works stably, and what doesn't, and what might look better with tweaks (and how to apply those tweaks). It's the best single source of info for the state-of-the-art in font rendering under Linux, AFAIK.

This thread, at risk of stating the obvious, serves a different purpose to a developer's forum or blog.

You changed freetype-add-subpixel-hinting-infinality-20101008-1.patch without calling it "-2", so I mentioned the filesize, to reduce confusion for the users.

The bug report on the firefox-crashing URL was already present.

Users will bitch & moan mercilessly, unless everything looks and works perfectly (which will never happen with fonts, until screens have 600+ DPI instead of ~120)  :Twisted Evil: 

 *Quote:*   

> 0x60

 

This looks even better, thanks.

----------

## bi3l

I've updated the overlay with the last patchset (including paul's gibson filter improved by infinality) but I haven't changed the version of the ebuild  (you have to manually reemerge freetype after updating the overlay : emerge -1 freetype).

----------

## jcTux

I have no more crashes with okular.

----------

## KejPi

Wouldn't it be better to increase revision in this case so that people not following this thread know about changes?

----------

## Infinality

 *KejPi wrote:*   

> Wouldn't it be better to increase revision in this case so that people not following this thread know about changes?

 

I debated updating the version number here, and probably should have, but I figured since it was only an hour or so since the initial release, I could squeeze it in without anyone noticing.   :Wink: 

----------

## KejPi

Well, a general rule says that you should not release two different things with the same ID (version number). At the end breaking this rule usually leads to some confusion. 

But I don't want to complain - I am happy I can use it  :Smile: 

----------

## jsevilleja

I've followed the wiki from lcd-filtering overlay with the fonts.conf from infinality, and now everything looks great. The only problem I've found, is, that in konsole, for example, when I'm typing, the bash "cursor" (I don't know if you guys call it "cursor") always goes two or three spaces ahead the keys. This also causes that the columns from the output of an "ls -la /" aren't aligned. How can I solve this? Thanks.

----------

## KejPi

 *jsevilleja wrote:*   

> The only problem I've found, is, that in konsole, for example, when I'm typing, the bash "cursor" (I don't know if you guys call it "cursor") always goes two or three spaces ahead the keys. This also causes that the columns from the output of an "ls -la /" aren't aligned. How can I solve this? Thanks.

 

I had this problem too - solved by choosing different font - monotype (I think this is the default one) does not work good.

----------

## jsevilleja

 *KejPi wrote:*   

>  *jsevilleja wrote:*   The only problem I've found, is, that in konsole, for example, when I'm typing, the bash "cursor" (I don't know if you guys call it "cursor") always goes two or three spaces ahead the keys. This also causes that the columns from the output of an "ls -la /" aren't aligned. How can I solve this? Thanks. 
> 
> I had this problem too - solved by choosing different font - monotype (I think this is the default one) does not work good.

 

Sorry, but, exactly, how did you do that? Thanks

----------

## KejPi

 *jsevilleja wrote:*   

> 
> 
> Sorry, but, exactly, how did you do that? Thanks

 

Konsole -> Settings -> Set profiles -> Change -> Look -> Change font

Sorry for probably not correct translation, I am using localised version of KDE

----------

## jsevilleja

 *KejPi wrote:*   

>  *jsevilleja wrote:*   
> 
> Sorry, but, exactly, how did you do that? Thanks 
> 
> Konsole -> Settings -> Set profiles -> Change -> Look -> Change font
> ...

 

Solved, thanks. I thought that you were referring to change the local.conf.  :Smile: 

----------

## equilibrium

 *PaulBredbury wrote:*   

> Here's my ~/.fonts.conf for Infinality's rendering, which is the best rendering - but, use Infinality's own configuration, since he does a better job than me.
> 
> For posterity, here's my old ~/.fonts.conf for Ubuntu's rendering.

 

I just installed the changes/configs etc as suggested, rebooted and am just amazed at how much better fonts look   :Very Happy: 

----------

## tallica

Another update: http://www.infinality.net/blog/?p=208 (Freetype Autohint Enhancement Patch)

Infinality, thanks!

----------

## legogogo

Why if firefox fonts is not like in other system? How it change?

http://lostpic.net/images/653ab65c1dce062f39325710a323a105.png

----------

## PaulBredbury

There's a security bug and new 20101022 Infinality patches, so here's an all-in-one patch (freetype-2.4.3-20101023-2-brebs.patch.bz2) to apply to vanilla freetype2-2.4.3 - it includes:

freetype-add-subpixel-hinting-infinality-20101022-1.patch

freetype-enable-subpixel-hinting-infinality-20100909-1.patch

freetype-enhance-emboldening-infinality-20101022-1.patch

freetype-auto-autohint-for-non-tt-hinted-fonts-infinality-20101002-1.patch

freetype-enhance-autohint-infinality-20101022-1.patch

freetype-use-modified-gibson-filter-infinality-20101022-1.patch

freetype-2.2.1-enable-valid.patch

freetype2-git-20101023 (from: git diff a5a32c15c594d57b9a512e3b50721caedb5697bc), which includes the security fix.

sed -i -r 's:.*(#.*TT_CONFIG_OPTION_SUBPIXEL_HINTING.*) .*:\1:' include/freetype/config/ftoption.h  - to ensure that Infinality's experimental stuff is enabled

sed -i -r 's:.*(#.*SYSTEM_ZLIB.*) .*:\1:' include/freetype/config/ftoption.h  - To use system ZLIB

rm -f include/freetype/config/ftoption.h.orig src/base/ftobjs.c.orig src/truetype/ttinterp.c.orig  - To remove useless files

So, this is the latest of everything including the kitchen sink, in terms of patches to freetype2  :Smile: 

----------

## bi3l

Updated LCD Filtering accordingly.

----------

## tallica

bi3l, Do you use the lcdfilter patch for poppler? I can't get Evince to use it...

----------

## bi3l

No, I have not maintained poppler's ebuild in LCD filtering for a while. Do you want me to update it ?

----------

## tallica

I've already bumped it in my local overlay. It cleanly apply to poppler 0.14.4 although Evince doesn't seem to care... all I get is monochrome antialiasing :/

EDIT:

Looks like Evince needs patching, I'm working on it right now.

----------

## vnekontakta

Hello! Yesterday after updating freetype library from lcd-filtering overlay i noticed that cyrillic small letter "у" looks broken in browser when html page using Trebuchet MS from corefont package (in both Firefox-3.6.9 and Chromium-7.0.517.41). When i downgraded from freetype-2.4.3 to 2.4.2 (same lcd-filtering overlay) problem is gone, but fonts looks not so good like with freetype-2.4.3. I use x86_64 system. 

Screenshot from page http://www.linux.org.ru/ :

http://youpic.su/view.php?id=s001.youpic.su/pictures/1287853200/0605bbf0ea438d144fd1d3514e36d635.png

Bigger: http://youpic.su/view.php?id=s001.youpic.su/pictures/1287853200/cbb6d64778e54f646ba4e15fd44979f9.png

Or from here http://www.ienews.ru/pochemu_putin_krab.html :

http://youpic.su/view.php?id=s001.youpic.su/pictures/1287853200/ad8dccef17767343156886fd041f1726.png

Bold small letter looks fine.

In system this letter also broken:

http://youpic.su/view.php?id=s001.youpic.su/pictures/1287853200/1bfd315a6473171a6cf80383cbaf5a1f.png

----------

## tallica

Ok, I've found a patch: https://bbs.archlinux.org/viewtopic.php?id=82529 I've applied it against Evince 2.30.3, but I'm not 100% satisfied: http://ompldr.org/vNXd1bw/evince.png

```
--- a/backend/pdf/ev-poppler.cc   Sun Oct 24 15:06:16 2010 +0200

+++ b/backend/pdf/ev-poppler.cc   Sun Oct 24 17:44:39 2010 +0200

@@ -379,10 +379,24 @@

 

 #ifdef HAVE_POPPLER_PAGE_RENDER

    cairo_t *cr;

+   cairo_font_options_t *options;

 

    surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,

                      width, height);

+

+   memset (cairo_image_surface_get_data (surface), 0xff,

+      cairo_image_surface_get_height (surface) *

+      cairo_image_surface_get_stride (surface));

+

+   options = cairo_font_options_create ();

+   cairo_surface_get_font_options (surface, options);

+   cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_SUBPIXEL);

+   cairo_font_options_set_subpixel_order (options, CAIRO_SUBPIXEL_ORDER_RGB);

+   cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);

+   

    cr = cairo_create (surface);

+   cairo_set_font_options (cr, options);

+   cairo_font_options_destroy (options);

 

    switch (rc->rotation) {

            case 90:
```

Setting CAIRO_HINT_STYLE_NONE/FULL/SLIGHT doesn't seem to make any difference. Is there anything that I can improve?

EDIT:

Difference between Evince and Gnome-terminal rendering: http://ompldr.org/vNXd4aw

----------

## PaulBredbury

 *vnekontakta wrote:*   

> cyrillic small letter "у" looks broken in browser when html page using Trebuchet MS

 

Yeah, looks broken to me too. It's been reported in Infinality's new forum.

----------

## mbar

Inconsolata Medium (12 points) has also the letter "m" rendering broken.

EDIT: at least when it's colored (not black), do "ls -la" on directory with files with "m" in filename.

----------

## pezed

After updating the overlay and emerging world today I noticed my fonts looked bad.  I reverted back to "bf61c65" which is from September and now things look back to how they should.  Not sure whats going on here:

Example (load them in seperate tabs to quickly switch between them to see the differences):

Fonts how they look using "bf61c65" (what I consider to be "good" rendering):

http://www.imgbin.org/index.php?page=image&id=2720

Fonts using HEAD:

http://www.imgbin.org/index.php?page=image&id=2719

Notice how bad the bold e's appear, the bold s's appear too thin, overall the fonts seem too tall.  Guess I'll just stick with the older revision for now but just curious, are these changes intentional or some misconfiguration on my end?

Thanks.

----------

## rahulthewall

libXft has reached version 2.2.0 in portage. Do we have a patch for that already?

----------

## PaulBredbury

 *rahulthewall wrote:*   

> libXft has reached version 2.2.0 in portage. Do we have a patch for that already?

 

Simply don't apply 001_no_export_freetype.diff

pezed, try hintfull for the broken bold fonts. See above in this thread for how to identify them:

lsof | grep -i firefox | egrep -i 'ttf|pfb'

----------

## iGold

I just want to ask is it important to set real DPI for subpixel hinting and LCD filter?

I have 9" netbook with real DPI about 134, but 96 DPI has autodetected by X Window. If I set DPI to 134 fonts become too big at 9-10 points and also many UI elements begin to work incorrectly. But it seems to glyph edges more colourful at 96 DPI.

FYI: I use freetype2-infinality (and respective local.conf), libxft-lcd and "respect fontconfig" patched cairo in LXDE under Arch Linux.

----------

## PaulBredbury

 *iGold wrote:*   

> But it seems to glyph edges more colourful at 96 DPI

 

That's a clue to the answer - yes, it's important.

DPI is *two* values - horizontal and vertical, because we don't have square monitors.

----------

## ssteinberg

 *PaulBredbury wrote:*   

>  *iGold wrote:*   But it seems to glyph edges more colourful at 96 DPI 
> 
> That's a clue to the answer - yes, it's important.
> 
> DPI is *two* values - horizontal and vertical, because we don't have square monitors.

 

Nor are we using square resolutions (whether native or actual). Our pixels are squares, horizontal and vertical pixel density is identical.

(You deserve to be punched if you are one of those using a 1280x1024 resolution on 4x3 monitor...)

----------

## aoeuaoue

hi,

I've been always confused about the USE flags in media-libs/freetype in portage it has two USE flags dealing with qualty of fonts.

```

[-    ] auto-hinter (media-libs/freetype):

Use the unpatented auto-hinter instead of the (recommended) TrueType bytecode interpreter

```

and the other one is:

```

[- c  ] bindist - Flag to enable or disable options for prebuilt (GRP)  packages (eg. due to licensing issues)
```

Now without doing this crazy patching what's the preferred USE flag to use with freetype package? Currently I haven't turned on any. But my Inconsolata font looks a bit crazy in terminals with some letters. For instance the word Terminator looks like this:

Terminator

Which USE flag is better to use with freetype, bindist or auto-hinter?

Thanks in advanced.

P.S.: I wish manufacturers would make computer monitors with RETINA DISPLAY  :Very Happy: 

----------

## mbar

 *PaulBredbury wrote:*   

>  *rahulthewall wrote:*   libXft has reached version 2.2.0 in portage. Do we have a patch for that already? 
> 
> Simply don't apply 001_no_export_freetype.diff
> 
> pezed, try hintfull for the broken bold fonts. See above in this thread for how to identify them:
> ...

 

Could someone please update the overlay?

----------

## iGold

Thank you for the answer, PaulBredbury.

Well, I found why my fonts were so colourful. This effect was only in firefox because of switched off option --enable-system-cairo in recent Arch binary version of firefox (https://bbs.archlinux.org/viewtopic.php?id=105660). When I rebuilt FF with --enable-system-cairo it began render fonts the same way as other applications. Much better even with incorrect DPI setting.

----------

## luscinius

I also have problems similar to pezed.

Note that in the pictures shown the horizontal bar of the "e" letter appears uplifted. I think it was mentioned that some of the patches implement hinting in vertical direction only. This would explain the behavior of the "e" letter (in particular, the fact that the horizontal bar is lifted only for some particular font sizes). Would it be possible to introduce a USE flag to disable these particular patches? 

I have another question: what is the fontconfig cache, the one in .fontconfig and /var/cache/fontconfig? After a freetype upgrade the fonts did not look good, and removing .fontconfig/* fixed it. Otherwise the fonts look differently on different computers with the same configuration. 

aoeuaoue:

bindist and auto-hinter are the two separate USE flags, and they can be used in any combination. 

The fragment of the ebuild they are used in is:

```
 

   if ! use bindist; then

      # See http://freetype.org/patents.html

      # ClearType is covered by several Microsoft patents in the US

      enable_option FT_CONFIG_OPTION_SUBPIXEL_RENDERING

   fi

   if use auto-hinter; then

      disable_option TT_CONFIG_OPTION_BYTECODE_INTERPRETER

      enable_option TT_CONFIG_OPTION_UNPATENTED_HINTING

   fi

```

Thus USE="+bindist" makes disables subpixel rendering, and USE="+auto-hinter" disables bytecode interpreter (the latter one is no longer patented).

You can also try changing your fontconfig settings.

----------

## aoeuaoue

 *luscinius wrote:*   

> I also have problems similar to pezed.
> 
> Note that in the pictures shown the horizontal bar of the "e" letter appears uplifted. I think it was mentioned that some of the patches implement hinting in vertical direction only. This would explain the behavior of the "e" letter (in particular, the fact that the horizontal bar is lifted only for some particular font sizes). Would it be possible to introduce a USE flag to disable these particular patches? 
> 
> I have another question: what is the fontconfig cache, the one in .fontconfig and /var/cache/fontconfig? After a freetype upgrade the fonts did not look good, and removing .fontconfig/* fixed it. Otherwise the fonts look differently on different computers with the same configuration. 
> ...

 

So, do you mean I can benefit with having nicer fonts by setting those two USE flags? Currently I don't have +bindist nor +auto-hinter turned on.

thanks

----------

## luscinius

 *Quote:*   

> 
> 
> So, do you mean I can benefit with having nicer fonts by setting those two USE flags? 
> 
> 

 

Probably no. These USE flags disable some features (sub-pixel rendering or hinting using built-in hints). As far as I understand, it can be done using fontconfig as well (e.g., using eselect fontconfig for the system-wide changes). I would not fo it myself.

Regarding Inconsolata font: which terminal are you using? Does this font look bad in other apps as well?

----------

## swimmer

I solved the problem with the letter "e" by using infinality's local.conf from 14-09-2010 ...

HTH

swimmer

----------

## darklegion

 *PaulBredbury wrote:*   

>  *iGold wrote:*   But it seems to glyph edges more colourful at 96 DPI 
> 
> That's a clue to the answer - yes, it's important.
> 
> DPI is *two* values - horizontal and vertical, because we don't have square monitors.

 

So what is the real world answer, use hardware DPI or always force 96 DPI?

----------

## PaulBredbury

Use the DPI which is the physical reality of your monitor.

96 and 120 dpi, are just convenient hacks.

Example on my PC:

$ xdpyinfo | grep -B1 dot

  dimensions:    1920x1080 pixels (372x231 millimeters)

  resolution:    131x119 dots per inch

----------

## darklegion

 *PaulBredbury wrote:*   

> Use the DPI which is the physical reality of your monitor.
> 
> 96 and 120 dpi, are just convenient hacks.
> 
> Example on my PC:
> ...

 

Okay, I've been using DisplaySize based on the dimensions of my monitor. However, DPI seems to be the same value for both vertical and horizontal. Is this expected, or should most monitors have different vertical and horizontal DPI?

It's a 32 Inch Panasonic TV (uses an IPS-alpha panel, which could be relevant here)

```

DisplaySize 698 393

```

```

xdpyinfo | grep -B1 dot

dimensions:    1920x1080 pixels (707x398 millimeters)

resolution:    69x69 dots per inch

```

----------

## bi3l

 *mbar wrote:*   

> Could someone please update the overlay?

 

Done.

----------

## PaulBredbury

1920/707*25.4 = 68.9...

1080/398*25.4 = 68.9...

So looks right.

There's 25.4 millimetres in an inch.

----------

## mbar

 *bi3l wrote:*   

>  *mbar wrote:*   Could someone please update the overlay? 
> 
> Done.

 

many thanks!

----------

## devsk

So, after the upgrade to freetype 2.4.3 from lcd-filtering overlay, my fonts look bigger than they looked with 2.4.2. What happened? How do I fix it? I am still logged into the same X session, so DPI is 96 all over.

One more thing: in certain fonts, 's' is looking weird with middle part gone!

----------

## PaulBredbury

 *devsk wrote:*   

> in certain fonts, 's' is looking weird with middle part gone!

 

This is noticeable with FreeMono and MS Mincho, and can't really be cured with fontconfig rules.

Anyway, will hopefully have a new release soon.

----------

## Infinality

The s issue is a result of the horizontal stem width snapping (that makes autohint look like Windows fonts).  It's annoying me too, and I'm trying to figure out a way to fix it without ruining the rest of the glyphs.  Any suggestions would be appreciated!

 :Cool: 

EDIT:  The way I recommend approaching this bug, from me, the coder, to you guys, the end-user is this:  Given how awesome FreeMono looks now, compared to before, who cares about a little problem with the s.   :Very Happy: 

----------

## devsk

Man, I hate this ping pong. Every upgrade of freetype has been disruptive and I am left to tune the whole damn thing from scratch. Now, my fonts are ugly thick and bigger than before in gtk apps, and smaller and thicker in KDE. Also, some fonts are bigger than others in the same firefox window. Going back to 2.4.2 for now.

----------

## PaulBredbury

Hooray, a new Infinality release  :Very Happy: 

Fonts look different (improved) yet again, and there's many new options. Will take a while to digest all of this  :Shocked: 

----------

## devsk

 *PaulBredbury wrote:*   

> Hooray, a new Infinality release 
> 
> Fonts look different (improved) yet again, and there's many new options. Will take a while to digest all of this 

 And once you digest, you will help us mere mortal get good looking normal fonts, right?... :Very Happy: 

----------

## PaulBredbury

This patch will make things slightly easier - freetype-2.4.3-infinality-20101114-brebs-all-in-one.patch.bz2

It's the result of:

```
patch -Np1 -i freetype-add-subpixel-hinting-infinality-20101114-1.patch  &&

patch -Np1 -i freetype-enable-subpixel-hinting-infinality-20100909-1.patch  &&

patch -Np1 -i freetype-entire-infinality-patchset-20101114-1.patch  &&

patch -Np1 -i freetype-2.4.3-20101114-infinality-apply-env-defaults.patch  &&

patch -Np1 -i freetype-2.2.1-enable-valid.patch  &&

patch -Np1 -i freetype-2.4.3-git-20101109.patch  &&

# Enable system zlib

sed -i -r 's:.*(#.*SYSTEM_ZLIB.*) .*:\1:' include/freetype/config/ftoption.h  &&

rm -f include/freetype/config/ftoption.h.orig src/base/ftobjs.c.orig src/truetype/ttinterp.c.orig include/freetype/internal/ftobjs.h.orig

```

Apply it, and only it, to vanilla freetype 2.4.3, then compile.

freetype-2.4.3-20101114-infinality-apply-env-defaults.patch replaces the need for any shell exports, as long as you agree with the settings I've chosen. And freetype-2.4.3-git-20101109.patch applies all the latest git updates (fixing yet another security bug).

You'll still have to pay attention to fontconfig settings, though.

Shell exports are a bad idea, because they only apply if the app is started from the shell command-line. They do *not* apply if I start e.g. firefox from the XFCE menu.

----------

## Infinality

 *PaulBredbury wrote:*   

> Shell exports are a bad idea, because they only apply if the app is started from the shell command-line. They do *not* apply if I start e.g. firefox from the XFCE menu.

 

Wouldn't they still apply if you included the infinality settings in /etc/profile or /etc/profile.d/infinality-settings ?  At least, I tested this and it worked.  Maybe it would make sense to have a real config file in a known place.  Hmmm....

----------

## PaulBredbury

 *Infinality wrote:*   

> a real config file

 

We already have fontconfig, let's use that.

By the way, my fonts are looking fantastic  :Very Happy: 

----------

## rahulthewall

Can someone please push a patched ebuild for freetype-2.4.4 to the overlay?

Thanks.

----------

## mbar

 *rahulthewall wrote:*   

> Can someone please push a patched ebuild for freetype-2.4.4 to the overlay?
> 
> Thanks.

 

please, please, please, please, please, oh please  :Smile: 

----------

## xzerth

Is there any recipe on how to get awesome fonts on 1024x768?

What use flags and what packages form which overlay?  :Rolling Eyes: 

I'm asking because I can't get good fonts with lcd-filtering overlay.

----------

## PaulBredbury

 *xzerth wrote:*   

> 1024x768

 

No resolutions require special handling - use the same general setup procedure.

The lower the DPI (dots per inch), the worse fonts will look. Even on an inkjet printer, it's easy to tell the difference between 300 DPI and 600 DPI - and you've probably got about 60:

Assuming a 15-inch (measuring horizontally & vertically) square viewing area:

1024/15=68 DPI

768/15=51 DPI

----------

## StringCheesian

 *mbar wrote:*   

>  *rahulthewall wrote:*   Can someone please push a patched ebuild for freetype-2.4.4 to the overlay?
> 
> Thanks. 
> 
> please, please, please, please, please, oh please 

 

Looks like someone tried it (same old patches applied to new 2.4.4 freetype, I mean) and reported that it works:

http://www.infinality.net/forum/viewtopic.php?f=2&t=42

I'll see what happens if I bump it locally.

EDIT: It works, here's the quick and dirty way:

```
# First copy media-libs/freetype folder from lcd-filter to your own overlay, then:

cd YOUR_OVERLAY/media-libs/freetype

rename 2.4.3 2.4.4 freetype-2.4.3.ebuild files/{*3-settings*,*3-subpixel*,*3-ubuntu*,*3-add*}

ebuild freetype-2.4.4.ebuild digest

emerge -av1 freetype
```

If you bump from freetype-2.4.3-r2.ebuild you'll have to comment out or delete the epatch lines for the two patches that fail: freetype-2.4.3-CVE-2010-3814.patch and freetype-2.4.3-SA41738.patch. Bumping from freetype-2.4.3.ebuild (as in the code block above) is the lazy solution for those who don't care about a one line change to what USE="+debug" does.

----------

## PaulBredbury

There's a couple more patches to apply, to stop freetype crashing and to show all characters. Here's what I do (to freetype 2.4.4), and here's the patches:

```
  patch -Np1 -i freetype-add-subpixel-hinting-infinality-20101114-1.patch  &&

  patch -Np1 -i freetype-enable-subpixel-hinting-infinality-20100909-1.patch  &&

  patch -Np1 -i freetype-entire-infinality-patchset-20101114-1.patch  &&

  # https://bbs.archlinux.org/viewtopic.php?pid=864540#p864540

  patch -Np1 -i freetype2-infinality-protect_style_name-goddesse.patch  &&

  # http://forums.gentoo.org/viewtopic-p-6487616.html#6487616

  patch -Np1 -i freetype-2.4.3-20101114-infinality-apply-env-defaults.patch  &&

  # Also in RPM - http://www.infinality.net/fedora/linux/13/SRPMS/

  patch -Np1 -i freetype-2.2.1-enable-valid.patch  &&

  # git diff 9ec31cea16a492bed96a96a7c30c1a466adb9792 > ~/temp/freetype-git-20101222.patch

  patch -Np1 -i freetype-2.4.4-git-20101222.patch  &&

  # Enable system zlib

  sed -i -r 's:.*(#.*SYSTEM_ZLIB.*) .*:\1:' include/freetype/config/ftoption.h  &&

  # Remove useless files

  rm -f include/freetype/config/ftoption.h.orig src/base/ftobjs.c.orig src/truetype/ttinterp.c.orig include/freetype/internal/ftobjs.h.orig  &&
```

----------

## bi3l

 *rahulthewall wrote:*   

> Can someone please push a patched ebuild for freetype-2.4.4 to the overlay?

 

Done at last.

----------

## PaulBredbury

cairo 1.10.2 is out:

 *Quote:*   

> The cairo community is pleased to announce the 1.10.2 release of the cairo graphics library. This is the first update to cairo's stable 1.10 series and contains a large number of bug fixes.

 

With Ubuntu's patch collection cairo_1.10.0-1ubuntu5.debian.tar.gz, don't apply these two:

fix_trailing_comma.patch

05_fix_glyph_advance.patch

Because they are already in cairo 1.10.2

Edit: poppler 0.16.0 is out also.

----------

## PaulBredbury

Another Infinality patch, to fix "tricky" fonts, is here.

----------

## khippy

It is not a must to use lcd-filtering for proper text view. I have satisfying results following this guide:

http://www.kev009.com/wp/2009/12/getting-beautiful-fonts-in-gentoo-linux/

It is simple, uses USE keywords and a small amount of configuration files to adjust your personal needs.

It is your decision, what to use.

----------

## PaulBredbury

firefox 3.6.13 is not properly compatible with system cairo 1.10.2

The good news is that firefox 4 beta 8 works OK.

The bad news is that some extensions (e.g. Greasemonkey, CustomizeGoogle) are automatically disabled because they're not compatible with firefox 4.

Edit: firefox 4 betas 9 and 10 are not compatible with system cairo, because mozilla tweaks its own internal cairo  :Shocked: 

Edit2: firefox 4 beta 12 works with system cairo  :Smile: Last edited by PaulBredbury on Thu Mar 10, 2011 11:59 am; edited 2 times in total

----------

## adimanav

does system cairo-1.10.2-r1 have all infinality and other patches that cairo-1.10.0-r3 from lcd-filter overlay have? i tried it but found problems with font and other rendering so reverted back to the lcd-filter version.

on another note, i find chromium renders devnagari fonts incorrectly while firefox does the right thing. i'm attaching screenshots to clarify. am using the latest ebuilds from lcd-filter. seems to be a problem with chromium but wanted to get some expert opinion. yes i'm quite the newbie  :Smile: 

firefox http://i56.tinypic.com/5djsoy.png

chromium http://i52.tinypic.com/20gxmpk.png

----------

## PaulBredbury

By "system", I mean using firefox's --enable-system-cairo option, rather than its own bundled cairo. So "system" is whatever *you* have installed for cairo.

 *adimanav wrote:*   

> does system cairo-1.10.2-r1 have all infinality and other patches that cairo-1.10.0-r3 from lcd-filter overlay have?

 

No, look at the ebuild. It has:

```
   epatch "${FILESDIR}"/${PN}-1.8.8-interix.patch

   epatch "${FILESDIR}"/${PN}-1.10.0-buggy_gradients.patch
```

But no Infinality patches.

I only use firefox - the ver 4 betas currently.

----------

## rahulthewall

Can we please have an updated ebuild for cairo-1.10.2-r1 (to relfect the tree version) for the lcd-filtering overlay.

Thanks

Rahul

----------

## rahulthewall

Updated ebuild of cairo-1.10.2-r1 along with the latest patchset from ubuntu.

http://dl.dropbox.com/u/2649236/cairo.tar.gz

----------

## ^marcs

Thanks for that  :Smile: 

Its a shame overlay isn't maintained any more  :Sad: 

If some one like me droping on the forums once a week it's hard to cover this huge topic with dozen of patches and patches of patches

----------

## bi3l

Don't worry, the overlay is still maintained : I've added ebuild and patches for cairo 1.10.2 and updated the ebuild and patchset for freetype 2.4.4.

Note: Infinilaty's entire additional patch for freetype is controlled through environment variables. The default values are set by /etc/env.d/99lcdfilter. INFINALITY_FT_PSEUDO_GAMMA and INFINALITY_FT_FILTER_PARAMS have been commented out because the patch read them in a locale dependent way. If you want to change these settings, you must use the decimal point given by 'locale -k decimal_point'.

----------

## pross

```
!!! Digest verification failed:

!!! /var/lib/layman/lcd-filtering/media-libs/freetype/files/99lcdfilter

!!! Reason: Filesize does not match recorded size

!!! Got: 7271

!!! Expected: 7269
```

----------

## bi3l

Fixed, thanks.

----------

## pross

Sorry, no it isnt

```
pross@mybox ~ $ cat /var/lib/layman/lcd-filtering/x11-libs/libXft/Manifest 

AUX libXft-2.1.14-ubuntu.patch 24916 RMD160 80b0f535f500515ab4eeba068c0978e2427bd898 SHA1 1598f844d7b115e5f74910648dc71bf95d154563 SHA256 aaa44ae87a683e1ef2cdda63e65e807d8b3b500bd0ee6bf03a432d4de31d073f

AUX libXft-2.2.0-ubuntu.patch 24455 RMD160 9adb30b3a5a8e1d5b83b45bda01957834a830139 SHA1 70a24463d67529f7075e8614b757041c2fdc9101 SHA256 f472b21321db88d06b07231d5f23ddd3e27bedb15c104760b07a394193947658

DIST libXft-2.1.14.tar.bz2 289068 RMD160 d167f657ad1d574496c757fb24f9f361c7f405a9 SHA1 e08ae6b1f56e160179b9f141b4ab799333ec725e SHA256 700e9d594b81cad3dfd5fac4a5cfd0c4cf7780c812507ef04eb40139ebf5175e

DIST libXft-2.2.0.tar.bz2 290451 RMD160 e2955cfd5c8d2e02d4dba5f01b5132634005f971 SHA1 ed29784259f4e26df78141035560ae8a7c62e83f SHA256 c8685ae56da0c1dcc2bc1e34607e7d76ae98b86a1a71baba3a6b76dbcf5ff9b2

EBUILD libXft-2.1.14.ebuild 1331 RMD160 f5850d1307be4718a684709cf12f6b43be23a125 SHA1 3fc1c69f95e3ed850a9711042632031aadb98a15 SHA256 4c6aca1291840ee12d2ff84563ac945217cbc4aa00e27340fd8e0139f705765b

EBUILD libXft-2.2.0.ebuild 1331 RMD160 f5850d1307be4718a684709cf12f6b43be23a125 SHA1 3fc1c69f95e3ed850a9711042632031aadb98a15 SHA256 4c6aca1291840ee12d2ff84563ac945217cbc4aa00e27340fd8e0139f705765b

pross@mybox ~ $ ls -l /var/lib/layman/lcd-filtering/x11-libs/libXft/

total 12

-rw-r--r-- 1 root root 1201 Feb 13 15:38 Manifest

drwxr-xr-x 2 root root 4096 Feb 13 15:38 files

-rw-r--r-- 1 root root 1331 Feb 13 15:38 libXft-2.2.0.ebuild
```

----------

## bi3l

Fixed again, sorry.

----------

## pross

 *bi3l wrote:*   

> Fixed again, sorry.

 

Worked perfectly this time!

----------

## illuminated

I upgraded to cairo 1.10.2 which should have cleartype enabled but when it really does not make any difference enabling it. My firefox&thunderbird fonts are now pretty much unreadable and I don't know what to do. Useflag lcdfilter does not look great for me so I prefer cleartype

edit

I fixed my fonts. I just had to unemerge everything first and then follow instructions on LCD Filter Wiki.

----------

## illuminated

I have one more question. Has anybody experienced any difficulties when reading text that has font size smaller than usual ? For example, when somebody puts 'code' tag around some tags, I have to zoom in a couple of times to read it.Last edited by illuminated on Sun Jul 10, 2011 8:06 am; edited 1 time in total

----------

## PaulBredbury

illuminated, you should either describe the problem properly (yes, small text is *small*, we know that) or show a screenshot.

----------

## patrix_neo

 *illuminated wrote:*   

> I have one more question. Has anybody experienced any difficulties when reading text that has font size smaller than usual ? For example, when somebody puts 'code' tag around some tags, I have to zoom in a couple of times to read it.

 

I can only tell from own experience. I had that problem while having a new monitor and upgraded Xorg. My final solution was find a resolution for my monitor, to skip /etc/X11/xorg.conf, make a new one ONLY for my nvidia card and use a HDMI cable. Better contrast too.

----------

## illuminated

 *PaulBredbury wrote:*   

> illuminated, you should either describe the problem properly (yes, small text is *small*, we know that) or show a screenshot.

 

It works after reboot  :Very Happy: 

----------

## illuminated

Hello again. Although I love Gentoo, I'm really struggling with setting up the fonts which would be nice and very easy to read (as close as possible to the originals). I have followed wiki guide about lcd-filtering but the problem I ran into was that texts on web sites was very hard to read especially when they had more than 3 paragraphs. So, I installed all Windows fonts and use infinality's .fonts.config. I tried changing rendering style in the file, but the fonts still don't look very clear. I suppose this is because I don't have any infinality's patches installed. I read almost whole topic and I still don't know how to apply these patches and which to apply. At the bottom, I attached few screenshots how my fonts look like with infinality's .fonts.config and infinality rendering style chosen.

http://img862.imageshack.us/i/snapshot3e.png/

http://img84.imageshack.us/i/snapshot4a.png/

http://img838.imageshack.us/i/snapshot5x.png/

edit

I figured it out now. Apparently all infinality patches are included in overlay (missed this somehow). My problems were that I wasn't using .Xresources file and I had few fonts enabled which basically made my fonts look very bad.

----------

## PaulBredbury

With Infinality's rendering, don't use INFINALITY_FT_STEM_ALIGNMENT_TYPE - it's unstable.

----------

## stelinux

Freetype & co. compiled with -cleartype +lcdfilter give libreoffice segfault. Revert the programs to +cleartype -lcdfiter give libreoffice start normally. The sigsegv is related to libfreetype.6.6.2 at the open of the file.

Now I'm at office but when I go to home I post you my emerge --info.

----------

## PaulBredbury

 *stelinux wrote:*   

> libreoffice segfault

 

Are you using freetype2-infinality-protect_null_pointer-goddesse.patch

References:

https://bbs.archlinux.org/viewtopic.php?pid=864901#p864901

http://aur.archlinux.org/packages.php?ID=38888  (click on "tarball" to get the patches)

http://www.infinality.net/forum/viewtopic.php?f=2&t=14&p=225#p224

http://www.infinality.net/forum/viewtopic.php?f=2&t=48

----------

## bi3l

 *PaulBredbury wrote:*   

> Are you using freetype2-infinality-protect_null_pointer-goddesse.patch

 

Actually yes, but it appears the patch is not complete in LCD filtering. I'll commit a fix asap.

----------

## stelinux

 *PaulBredbury wrote:*   

>  *stelinux wrote:*   libreoffice segfault 
> 
> Are you using freetype2-infinality-protect_null_pointer-goddesse.patch
> 
> References:
> ...

 

No, I've not found it in my lcd-filtering directory

----------

## bi3l

The name of the patch is freetype-2.4.4-protect-style-name.patch and it's been updated. Please, give it a try.

----------

## nordic bro

bit of a font mod noob so can someone tell me where to get these windows/mac fonts besides "the internet"?  :Smile:   it seems the infinality/lcd-filtering overlay stuff is really meant for them?  so is there a pkg of those fonts I can download, rather than just searching out some random individuals and hoping they'll replace the standard ones I use now?

also, I more or less stick to standard font pkgs in gentoo (corefonts, font-bh*, ttf-bitstream, etc.) so for things where I define the font such as when starting xterm or emacs, do I have to specifically change my invocation to pick up the windows/mac version?  or putting the windows/mac fonts folder at the top of xorg.conf will do that automatically?  

if so, how do I know that's working?  that is, how do I know I have the windows/mac equiv of the font being used rather than something saying internally "can't find that font, will just use an existing fallback instead"?

thanks.

----------

## PaulBredbury

 *nordic bro wrote:*   

> where to get these windows/mac fonts

 

Freetard-acceptable (i.e. hugely strict on the licence) big collections of quality fonts optimized for screens, the likes of which distros could actually officially include, are very rare.

A few pages ago in this very thread, I linked to various free fonts worth trying.

 *Quote:*   

> it seems the infinality/lcd-filtering overlay stuff is really meant for them?

 

Infinality's rendering is the best so far, in my not-so-humble opinion, but it can't magically make a crap font look good. What it will do, is make good fonts look great. So, er, yeah, good fonts are better than crap ones.

Anyway, the whole thing's so (annoyingly) subjective that you have to experiment yourself, to find the best setup for yourself, on your monitor, your DPI settings (which some people have set wrongly - it should be the natural DPI of your monitor, AFAICT, x times y, not 96DPI square and not 120DPI square), your eyes, your personal preferences.

 *Quote:*   

> hoping they'll replace the standard ones I use now?

 

Don't "hope", learn to love ~/.fonts.conf, its customization potential, and the freetype commands, e.g.:

```
fc-match -a "Sans" | head
```

 *Quote:*   

> how do I know that's working?

 

For e.g. firefox, there's:

```
lsof | grep -i firefox | egrep -i 'ttf|pfb'
```

Which I've already mentioned in this thread.

You should fully read this thread, then ask better questions.

----------

## PaulBredbury

Infinality's 20110604 patches are out, but they're unstable.

Edit: Has workaround, see below.Last edited by PaulBredbury on Sat Jul 23, 2011 8:35 am; edited 1 time in total

----------

## illuminated

Which fontconfig .conf files should be selected when using infinality config (besides user.conf) ?

----------

## stelinux

 *bi3l wrote:*   

> The name of the patch is freetype-2.4.4-protect-style-name.patch and it's been updated. Please, give it a try.

 

 :Very Happy:  patch solve the segfault of libfreetype in libreoffice.

Thank you so much   :Very Happy: 

----------

## RomaHagen

Hi,

I've read the last 9 pages of this thread. Let me please ask some stupid question that I asked in the infinality forum already once again, since I'm not satisfied with the answer I got there.

I was always frustrated with the quality of font rendering in Linux. Now that can be improved. But.. To improve it one will need to spend probably days.

My main confusing is why those patches cannot be submitted upstream. I seems to found the answer, but I'm still confused.

At viewtopic.php?f=2&t=18 it says "The existing Truetype interpreter in Freetype renders fonts "correctly"...  This is not Freetype misbehaving; rather it is Freetype doing exactly what the font tells it, and Windows using tricks to make them look nicer. " 

As I understood the heritage of the big and ugly Micro$oft is a burden to Linux users as always. Micro$oft didn't follow specifications and added it's own "tweaks". With patches you try to mimic Micro$oft's implementation. That's why your patches cannot be submitted upstream. Is that correct?

If so, then I have another question. The main problem is that old fonts, which were designed for black and white displays are tweaked to work on colored ones. But aren't there any modern fonts that are designed for modern displays and that are perfectly rendered with freetype? Then we won't need patches, tweaks etc.

Thanks for your answer in advance!

----------

## PaulBredbury

 *RomaHagen wrote:*   

> I'm not satisfied with the answer I got there.

 

Which was this. You should explain what you're not satisfied with, rather than do a copy-n-paste.

 *Quote:*   

> To improve it one will need to spend probably days.

 

Or spend 15 minutes installing e.g. Mint, which includes Ubuntu's font-rendering patches. Or Fuduntu which includes Infinality's.

 *Quote:*   

> That's why your patches cannot be submitted upstream. Is that correct?

 

I already answered this - it's the FUD caused by patents. Patents owned by the likes of Microsoft *and* Apple. If you google a bit, you'll find the list.

 *Quote:*   

> tweaked to work on colored ones

 

You mean, to take advantage of sub-pixel rendering. The fonts are still coloured black, but may appear with red/green/blue fringes, depending on the algorithm, monitor, font, and eyesight of the user.

 *Quote:*   

> Then we won't need patches, tweaks etc.

 

Nonsense. We won't need tweaks when we have 600DPI monitors, rather than e.g.:

```
$ xdpyinfo | grep -B1 dot

  dimensions:    1920x1080 pixels (372x231 millimeters)

  resolution:    131x119 dots per inch
```

As I already mentioned in this thread.

----------

## RomaHagen

Sorry, just after I posted it I suspected that you were the guy that replied to me at infinalitie's forum.

I'm aware of the patents you mentioned, but haven't they expired? See http://www.freetype.org/patents.html .

Well, I would like to set up nice font rendering on my system and not change the distro because of it:)

Hm.. with the patches you haven't got it right. What I mean is a reasonable default font rendering as provided by Microsoft or Apple. Of course according to the personal taste the patches can be added. But I suppose the majority of users are just fine with font rendering as in Windows or Mac OS X. This is what I would like the default freetype provides.

----------

## PaulBredbury

There's more patents listed at subpixel rendering and cleartype.

Linux's font rendering can be made better than Windows', so there's no point in just copying their style. You could argue that it should be an option. I might argue that people who want such an option should get their eyes tested  :Laughing: 

I'm sure you won't see Windows' style in upstream freetype until around 2020, when all the potential patents have expired. So I recommend learning how to apply patches.

----------

## RomaHagen

Well, I can not only apply patches but also write them. I just would like to have them all upstream.  :Smile:   And it took me a lot of time just to get to know that such patches exist! Previously I used openSUSE, now I've switched to Arch and found out about all this at the Arch Wiki.

Hm.. I thought the problems were not patents but the necessity to use quirks to render legacy fonts as Microsoft did. Of course, such code should not land in the upstream. Now I know that the patents is the other obstacle.

By no means should Linux copy Windows style. What I meant is that the quality should be comparable.

----------

## devsk

```
!!! Multiple package instances within a single package slot have been pulled

!!! into the dependency graph, resulting in a slot conflict:

media-libs/freetype:2

  (media-libs/freetype-2.4.5::gentoo, ebuild scheduled for merge) pulled in by

    (no parents that aren't satisfied by other packages in this slot)

  (media-libs/freetype-2.4.4::lcd-filtering, installed) pulled in by

    media-libs/freetype[lcdfilter=,cleartype=] required by (x11-libs/libXft-2.2.0::lcd-filtering, installed)

    media-libs/freetype:2[lcdfilter=,cleartype=] required by (x11-libs/cairo-1.10.2-r1::lcd-filtering, ebuild scheduled for merge)
```

Does anybody know why lcd-filtering overlay is not updated to 2.4.5?

----------

## PaulBredbury

2.4.5 needs Infinality's 2010 patches to be redone, thanks to freetype upstream's changes in the last couple of months. I'm using a freetype2 git snapshot from 20110419.

I reckon it would be a better use of effort to fix the crashing bug in Infinality's 2011 version.

----------

## PaulBredbury

Now that the crashing bug has a workaround, here's a handy collection of the patches required for "Infinality 2011", plus my own "change-the-defaults-to-be-sensible" patch (which this time sticks to Infinality's recommendations).

Base is the official freetype 2.4.5 release (Edit: 2.4.6 now). Patching code to use:

```
# From http://www.infinality.net/fedora/linux/15/SRPMS/freetype-infinality-2.4.5.x-2.20110604_1.4.fc15.src.rpm

patch -Np1 -i freetype-add-subpixel-hinting-infinality-20110604-1.patch &&

patch -Np1 -i freetype-enable-subpixel-hinting-infinality-20100909-1.patch &&

patch -Np1 -i freetype-entire-infinality-patchset-20110604-1.patch &&

# Workaround bug in http://www.infinality.net/forum/viewtopic.php?f=2&t=71

patch -Np1 -i stem_align-crash-workaround.patch &&

# Apply Infinality's own recommended defaults, as the real defaults

patch -Np1 -i env-defaults-20110722.patch &&

# Enable table validation, as done in Fedora & Debian/Ubuntu

patch -Np1 -i freetype-2.2.1-enable-valid.patch &&

# Enable system zlib

sed -i -r 's:.*(#.*SYSTEM_ZLIB.*) .*:\1:' include/freetype/config/ftoption.h &&

# Remove files created by the patch commands

rm -f src/smooth/ftsmooth.c.orig src/autofit/aflatin.c.orig include/freetype/config/ftoption.h.orig modules.cfg.orig &&

# Your usual ./configure --prefix=/usr and make and make install

```

Compared to the 2010 Infinality patchset, the fonts look cleaner.

Edit: Changed the default INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH from 50 to 0, because 0 removes the ugly distortion, and makes the font appear slightly darker.Last edited by PaulBredbury on Wed Aug 10, 2011 6:30 pm; edited 1 time in total

----------

## bi3l

The LCD-filtering overlay has been updated.

----------

## Ormaaj

Thanks my fonts look amazing now! I used these lcdfiltering patches a year ago and it broke since then and forgot that I can't live without it.

I edited your wiki a bit to be more copy/paste friendly. The text wrapping is ugly but it copys from the page to my clipboard correctly anyway.

----------

## Desti²

 *bi3l wrote:*   

> The LCD-filtering overlay has been updated.

 

Thank you!  :Wink: 

But why are this things not in the main portage?

----------

## RealNC

The freetype ebuild is out of sync with the portage one.

Edit:

Also, the "cleartype" USE flag does nothing and should be removed from the ebuild.

----------

## Odysseus

I'm editing this post to reflect that I erred in my statements below in regards to disabling the auto hinter. I have now come to find that several of the features of the "infinality" patch set REQUIRES the auto hinter enabled in conjunction with the BCI hinter.

If one follows the steps outlined on the "lcdfilter" layman page and on the infinality.net page, and adjusts '/etc/env.d/99lcdfilter' to personal taste; they will discover the beauty of the best font rendering I've ever seen on Linux! I thought my fonts looked great in my previous configuration, but couldn't have been more wrong! I highly recommend installing this overlay! 

I've left the the rest of this post unedited..................

 *RealNC wrote:*   

> The freetype ebuild is out of sync with the portage one.
> 
> Edit:
> 
> Also, the "cleartype" USE flag does nothing and should be removed from the ebuild.

 

Very true and hasn't done anything for some time.

Some observations and things I've discovered while trying to improve the look of my fonts that I'd like to pass on to those reading this thread in the future.

The instructions at the lcdfilter webpage are wrong for one of their recommended fontconfig options.

DO NOT enable '10-autohint.conf' if you plan on enabling any of the 'sub-pixel' rgb settings and or lcdfilter. They were not designed to work together and work at cross ends. Having both enabled causes problems with many fonts rendering correctly.

The autohinter invokes the "free" hinter that was the old default when the BCI hinter was having licensing issues. Enabling '10-hinting.conf' invokes the BCI hinter which is what you want when using quality TTfonts like those from Windows. When using this hinter with an lcd monitor, be sure to enable '10-hinting-slight.conf', '10-antaliasing.conf', one of the 'sub-pixel' rgb settings and or lcdfilter.conf. The result will be cleartype font rendering on par if not better than windows.Last edited by Odysseus on Mon Oct 17, 2011 6:13 pm; edited 2 times in total

----------

## bi3l

 *Odysseus wrote:*   

> The instructions at the lcdfilter webpage are wrong for one of their recommended fontconfig options.

 

Feel free to fix them.

----------

## bi3l

 *RealNC wrote:*   

> The freetype ebuild is out of sync with the portage one.

 

Was in sync last time I checked. I'll check again asap.

 *Odysseus wrote:*   

> Very true and hasn't done anything for some time

 

Do nothing if there is nothing to do.

 *RealNC wrote:*   

> Also, the "cleartype" USE flag does nothing and should be removed from the ebuild.

 

Was removed, actually.

----------

## Odysseus

I edited my post above to correct an error..... and I'm editing this to emphasize how thrilled I am with font rendering using this patchset.

 *bi3l wrote:*   

>  *Odysseus wrote:*   Very true and hasn't done anything for some time 
> 
> Do nothing if there is nothing to do.

 

I was referring to the cleartype USE flag doing nothing anymore, not to the fine work you folks have done applying the patch set to the various applications that need them, and in maintaining the overlay.

I hope this clears things up!

Ciao

Odysseus

----------

## Odysseus

Version bump please to stay in sync with the portage tree.... TIA

----------

## golagoda

Agreed with the above, this is the only way fonts are tolerable so it would be great for it to be updated.

Thank you so much for all your work so far.

----------

## bi3l

Done.

----------

## tallica

There's a brand new release of the Infinality Freetype Patches.

http://www.infinality.net/blog/infinality-freetype-patches/

----------

## bi3l

Updated to the latest patchset from infinality but there are a few issues I must investigate.

----------

## poncho

 *bi3l wrote:*   

> Updated to the latest patchset from infinality but there are a few issues I must investigate.

 

I have a modified version of your ebuilds in my overlay and they work fine for me.

http://poncho.spahan.ch/public/overlay/lcd-filtering-infinality/media-libs/freetype/freetype-2.4.8.ebuild

The most important change is

```
if use lcdfilter; then

   insinto /etc/profile.d

   newins "${FILESDIR}"/infinality-settings.sh-${INFINALITY} infinality-settings.sh

   insinto /etc/fonts/

   newins "${FILESDIR}"/local.conf-${INFINALITY} local.conf

fi
```

----------

## bi3l

Thanks for the info, but infinality-settings.sh is done through /etc/env.d/99lcdfilter and local.conf doesn't fix my issues.

----------

## poncho

 *bi3l wrote:*   

> Thanks for the info, but infinality-settings.sh is done through /etc/env.d/99lcdfilter and local.conf doesn't fix my issues.

 

I think this part of infinality-settings.sh

```
if [ "$SET_XFT_SETTINGS" = "true" ]; then

  echo "$XFT_SETTINGS" | xrdb -merge > /dev/null 2>&1

fi
```

doesn't work if you put the file into env.d

I got a parsing error on env-update.

It works fine if you put it in profile.d

----------

## bi3l

Yes, I've striped this part from 99lcdfilter, it's in my .Xresources.

----------

## tallica

2011-11-20 – Updated zip and infinality-settings package to remove Canwell replacements.  These were making Cantarell render as Arial.

edit:

2011-11-20 – Updated zip and freetype-infinality package to modify internal Courier New rules that were causing rendering issues.

http://www.infinality.net/fedora/linux/zips/infinality-patches-20111120-2.tar.gz

----------

## Odysseus

I don't know where to post bug reports for the lcdfilter overlay...... so I'll post here....

The new version of freetype has several rendering issues not present in the previous versions.

If freetype is compiled with the lcdfilter use flag it now causes major problems with mozilla-firefox. On some webboards and sites I frequent, some fonts are being rendered infinitesimally small and impossible to read. If I un-check "Allow pages to choose their own fonts, instead of my selection above" then they render correctly. However, even after doing this some fonts in drop-down menus and selection buttons still are rendering too small to read.

The only solution to correcting this behavior was to downgrade back to the previous version.

I hope this issue can soon be resolved.

Thanks again for your good work on this project.

----------

## niblifar

I have the same issue using the Liberation Sans font except only the m's are rendered much smaller than the other letters. It's quite odd.

----------

## Odysseus

 *niblifar wrote:*   

> I have the same issue using the Liberation Sans font except only the m's are rendered much smaller than the other letters. It's quite odd.

 

This is also an issue I was having, but forgot to mention in my post above. I don't have installed Liberation Sans fonts. I use the microsoft corefonts with Arial as my default, but the tiny "m" issue is also present with the latest version of freetype from the overlay.

----------

## bi3l

This is a known issue, see here. A new patchset should be released soon.

----------

## bi3l

Fixed with  the latest version of the patch. You can update the repository and reemerge freetype.

----------

## bi3l

I've spent quite some time working on LCD filtering lately, adding many configuration files and tweaking a few things. You should reinstall all the packages and follow the wiki to get better font rendering.

----------

## Doorbreath

If we put infinality's local.conf in /etc/fonts/local.conf with whatever rendering style we like defined as he says on the website will it be the same results as following the lcd-filtering wiki with all the eselect fontconfig stuff?

----------

## bi3l

Yes, more or less.

----------

## Infinality

This release should fix some (hopefully ALL) of the crashers from the last release.

http://www.infinality.net/blog/infinality-freetype-patches/

----------

## illuminated

When I try to re-emerge freetype, I get the following error http://pastebin.com/Me2iRr27 :\

----------

## bi3l

 *illuminated wrote:*   

> When I try to re-emerge freetype, I get the following error http://pastebin.com/Me2iRr27 :\

 

Fixed.

----------

## swimmer

 *bi3l wrote:*   

> Fixed.

 

Thank you very much for your fantastic work!

May I ask you whether you have any plans to implement the new fontconfig 

structure as Infinality introduced it with the new release from 23-12-2011?

Kindly yours

swimmer

----------

## bi3l

[quote="swimmer"] *bi3l wrote:*   

> May I ask you whether you have any plans to implement the new fontconfig 
> 
> structure as Infinality introduced it with the new release from 23-12-2011?

 

Yes, but I have to analyze what infinality did.

----------

## swimmer

 *bi3l wrote:*   

> Yes, but I have to analyze what infinality did.

 

Good to hear  :Smile:  And please don't feel any pressure and take your time to 

analyze that beast ...  :Wink: 

----------

## SlashBeast

Did anyone noticed that small fonts are unreadable small? For example size 8 is uber small but something about 12 is smaller than 11, after reverting the patches everything is all right. Openbox's menu and qt4 apps was unreadable.

----------

## ^marcs

Ay there!

Just wanted to ask when we could expect patched cairo-1.10.2-r2 in overlay? 

cairo-1.10.2-r1 is blocking qt-4.8 update due to some important patches being added in r2 rev. 

Thanks for great job.

----------

## Helmering

 *^marcs wrote:*   

> Ay there!
> 
> cairo-1.10.2-r1 is blocking qt-4.8 update due to some important patches being added in r2 rev.

 

The only difference beetween r1 and r2 is the qt-surface patch.

here's the patch for the ebuild:

```
77a78

>       epatch "${FILESDIR}"/${P}-qt-surface.patch
```

The "cairo-1.10.2-qt-surface.patch" has to be copied into the files directory of the lcdfilter overlay

Is working fine here

bye, Ralf

----------

## ^marcs

Thanks for the tip!

----------

## zhou13

Could you make an upgrade to r2 please? The overlay is out of date.

----------

## bi3l

 *zhou13 wrote:*   

> Could you make an upgrade to r2 please? The overlay is out of date.

 

Done.

----------

## Ld.dD

Among all font rendering I've seen on Linux so far I like what's Ubuntu doing the most. I'm trying to match that in Gentoo, without success.

My settings:

overlay set up according to wiki http://gitorious.org/lcd-filtering

usage: source ft-settings.sh ubuntu (but tried most of the others as well)

# eselect fontconfig list

  [1]   10-antialias.conf *

  [2]   10-autohint.conf * (tried disabling as well)

  [3]   10-hinting-full.conf (tried as well)

  [4]   10-hinting-medium.conf *

  [5]   10-hinting-slight.conf (tried as well)

  [6]   10-hinting.conf *

  [7]   10-no-sub-pixel.conf

  [8]   10-sub-pixel-bgr.conf

  [9]   10-sub-pixel-rgb.conf *

  [10]  10-sub-pixel-vbgr.conf

  [11]  10-sub-pixel-vrgb.conf

  [12]  10-unhinted.conf

  [13]  11-lcd-filter-lcddefault.conf *

  [14]  20-fix-globaladvance.conf *

  [15]  20-hinting-small-fonts-slight.conf *

  [16]  20-unhint-small-dejavu-sans-mono.conf

  [17]  20-unhint-small-dejavu-sans.conf

  [18]  20-unhint-small-dejavu-serif.conf

  [19]  20-unhint-small-vera.conf *

  [20]  21-hinting-small-aquabase-slight.conf *

  [21]  21-hinting-small-arial-black-slight.conf

  [22]  21-hinting-small-browallia-slight.conf *

  [23]  22-hinting-courier-italic-slight.conf *

  [24]  25-hinting-non-tt-instructed-slight.conf

  [25]  25-hinting-tt-instructed-full.conf

  [26]  25-hinting-tt-instructed-none.conf

  [27]  25-hinting-tt-instructed-slight.conf

  [28]  25-unhint-nonlatin.conf

  [29]  30-metric-aliases.conf *

  [30]  30-urw-aliases.conf *

  [31]  40-nonlatin.conf *

  [32]  45-latin.conf *

  [33]  49-sansserif.conf *

  [34]  50-user.conf *

  [35]  51-local.conf *

  [36]  53-monospace-lcd-filter.conf *

  [37]  57-dejavu-sans-mono.conf *

  [38]  57-dejavu-sans.conf *

  [39]  57-dejavu-serif.conf *

  [40]  60-latin.conf *

  [41]  60-liberation.conf

  [42]  65-fonts-persian.conf *

  [43]  65-khmer.conf

  [44]  65-nonlatin.conf *

  [45]  69-unifont.conf *

  [46]  70-no-bitmaps.conf *

  [47]  70-yes-bitmaps.conf

  [48]  80-delicious.conf *

  [49]  90-embolden.conf (tried as well)

  [50]  90-synthetic.conf

Screenshots: 

http://imgur.com/a/sApjC

Ubuntu: vanilla

"default": Gentoo without patches, dejavu, PaulBredbury's "old" ~/.font.config from the forum (lost the link)

"infernality": above settings, dejavu and ubuntu font

The default "looks" close but subpixel rendering is quite different from ubuntu (and the result worse, imo). Inifinality is bolder and blurrier but close up subpixel rendering appears to be the same in principle. Changing the profile to default, osx or inifinality didn't help with that. "windows" is thinner, but jagged.

Is there a way to get exactly the same rendering (or better of course;) as in Ubuntu? In case I just had to change config files,  I think those should be part of the default settings because well, ubuntu is supposed to look like ubuntu, right?

Another question:

Several patches that used to be required have been upstreamed. Apart from config files, what patches do I need if I just want to copy the Ubuntu rendering but don't want Infinality? Does the overlay even support that and contain all the necessary patches or are we all supposed to use infinality?

There's libXft-2.2.0-ubuntu.patch and cairo-1.10.2-ubuntu.patch but they are only required if apps depend on cairo and libXft

fontconfig-2.8.0-ubuntu.patch is only config related.

http://gitorious.org/lcd-filtering/lcd-filtering/trees/master/media-libs/freetype/files doesn't contain anything obviously coming from Ubuntu. Does that mean for non cairo apps Gentoo already uses the same rendering as Ubuntu and the only difference is configuration?

Edit:

I replaced the whole /etc/fonts with the content of an Ubuntu installation. That did not take care of the bolder ubuntu font. I only conclude it's not "just edit your .fontsconfig".

Another screenshot, Firefox chrome, very subtle except for some characters like the "w". http://imgur.com/a/FxbTK (upper one is gentoo, click to zoom)

So close, but not perfect  :Sad: 

----------

## ^marcs

Infinality's patches are the world saver, but still ubuntu's sharpness and perfect shapes beats it  :Sad:  - I tried to get ubuntu font settings into gentoo too - no luck tho. 

Have You tried sourcing /usr/lib64/ft-settings.sh with ubuntu parameter? Maybe that will get You somewhat closer.

----------

## Ld.dD

 *^marcs wrote:*   

> 
> 
> Have You tried sourcing /usr/lib64/ft-settings.sh with ubuntu parameter? Maybe that will get You somewhat closer.

 

I did, see "my settings" in the post above, in my case it's /usr/lib/ft-settings. Their wiki should probably mention that you most likely need the full path.

----------

## duderonomy

Wow this is a long thread...

Many thanks to PaulBredbury (and others too). 

It's been 1 year, 5 months, 8 days since this (apparently) very useful summary:

https://forums.gentoo.org/viewtopic-p-6422790.html#6422790

Is it still considered relevant or is it obsolete by now?

Also... for purpose of improving font rendering in firefox:

Is compiling firefox with --enable-system-cairo relevant in Feb 2012?  

If so, what is best way to do it? 

I tried modifying the ebuild and then running 

`ebuild firefox-10.0.1.ebuild manifest`

to satsify the integrity check for firefox-10.0.1 ebuild, but then had to wait forever.

It took a very long time as it appeared to have download the source for every 

firefox ebuild in the /usr/portage/www-client/firefox directory. 

(I would like to avoid that next time) 

Can I update a single ebuild's integrity check more quickly (next time) or was this the only way?

Thank you!!!

 :Very Happy: 

----------

## PaulBredbury

 *duderonomy wrote:*   

> Is it still considered relevant

 

Yes - it's what I still do.

Also with /etc/profile.d/infinality-settings.sh (or whatever dir Gentoo uses)

 *Quote:*   

> Is compiling firefox with --enable-system-cairo relevant

 

Yes, still needed.

----------

## Odysseus

The LCD-filtering overlay needs updating.

The current versions for media-libs/freetype-2.4.9 and x11-libs/libXft-2.3.0-r1 now in ~ arches.

TIA

Ciao

----------

## Helmering

 *Odysseus wrote:*   

> The LCD-filtering overlay needs updating.
> 
> The current versions for media-libs/freetype-2.4.9 and x11-libs/libXft-2.3.0-r1 now in ~ arches.
> 
> TIA
> ...

 

We have to wait a bit

http://www.infinality.net/forum/viewtopic.php?f=2&t=204#p1372

Ralf

----------

## PaulBredbury

Freetype 2.4.9 seems buggy anyway.

----------

## Spinmc

Infinality patchset for freetype-2.4-9 has been released yesterday!

http://www.infinality.net/blog/infinality-freetype-patches/

----------

## PaulBredbury

Freetype

For freetype 2.4.9, here's Infinality's RPM (from dir).

Apply all its patches, except maybe -more-demos and -multilib. Happily, it includes 2.4.9 bugfixes.

infinality-settings.sh in the RPM has some new options:

```
# Experimental emboldening values for OSX mode

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
```

libXft

There's also a new libXft RPM, but it's just a rebuild - no code changes.

Cairo

With cairo 1.12.0, no Ubuntu patches are required (none are available for 1.12.0 yet anyway). Still apply cairo-respect-fontconfig.patch and cairo-1.10.0-buggy_gradients.patch

Edit: Arch has a git-fixes patch.

Compile cairo with: --disable-static --disable-xlib-xcb --enable-tee

--disable-xlib-xcb prevents usage of the poor xcb, apparently.

cairo-1.10.2-qt-surface.patch doesn't seem to be needed.

Fontconfig

Before touching fontconfig 2.9.0, I'll wait for Ubuntu to produce patches for it.

Pango

Pango 1.30.0 needs glib 2.32.0 rather than 2.30.3, so personally I'll ignore it for now.

Are we done yet?

As a reminder, the compilation order is:

freetype2 fontconfig libXft cairo pango

----------

## jcTux

I use this howto http://gitorious.org/lcd-filtering/pages

Everything is fine and look beautiful, except for Chromium browser. 

I have the feeling that Chromium do not take into account lcdfilter settings. While with Firefox everything is ok.

Is someone here has the same problem as me ?

----------

## PaulBredbury

Who wrote http://gitorious.org/lcd-filtering/pages/Install ?

The compilation order is wrong. Should be:

```
emerge -uNav freetype fontconfig cairo libXft
```

Since fontconfig's configure contains "You must have freetype installed".

----------

## jcTux

 *PaulBredbury wrote:*   

> Who wrote http://gitorious.org/lcd-filtering/pages/Install ?
> 
> The compilation order is wrong. Should be:
> 
> ```
> ...

 

Thank you PaulBredbury.

I re-emerge the packages with the order you advise, but I don't see any difference.

Here a picture to compare what I have with Firefox vs. Chromium:

http://img834.imageshack.us/img834/268/fontsfirefoxvschromium.png

----------

## gkmac

 *jcTux wrote:*   

> Everything is fine and look beautiful, except for Chromium browser. 
> 
> I have the feeling that Chromium do not take into account lcdfilter settings.

 

Unfortunately, that is correct.

----------

## bi3l

 *PaulBredbury wrote:*   

> Who wrote http://gitorious.org/lcd-filtering/pages/Install ?

 

Me.

 *PaulBredbury wrote:*   

> The compilation order is wrong. Should be:
> 
> ```
> emerge -uNav freetype fontconfig cairo libXft
> ```
> ...

 

As long as the dependancies are correctly defined in the ebuilds and there is no static linking, the order is meaningless.

----------

## jcTux

 *gkmac wrote:*   

>  *jcTux wrote:*   Everything is fine and look beautiful, except for Chromium browser. 
> 
> I have the feeling that Chromium do not take into account lcdfilter settings. 
> 
> Unfortunately, that is correct.

 

I upgrade from the stable version (18.0.1025.151) in portage to the unstable and masked version (19.0.1084.1) --> the improvements are very visible.

----------

## Helmering

Hi Paul

 *PaulBredbury wrote:*   

> Who wrote http://gitorious.org/lcd-filtering/pages/Install ?
> 
> The compilation order is wrong. Should be:
> 
> ```
> ...

 

That's already the second time you complain incorrectly about this:

https://forums.gentoo.org/viewtopic-p-6425056-highlight-order.html#6425056

And thanx Bi3l and his great "lcd-filtering" overlay users like me get easily the infinalty patches and something more into their systems.

Cheers, RalfLast edited by Helmering on Wed Apr 11, 2012 7:57 pm; edited 1 time in total

----------

## r0shi

For some reason I'm getting this error when I try to run

emerge -uNav fontconfig freetype cairo libXft

Is there a way to fix this?

!!! Multiple package instances within a single package slot have been pulled

!!! into the dependency graph, resulting in a slot conflict:

x11-libs/libXft:0

  (x11-libs/libXft-2.2.0::lcd-filtering, ebuild scheduled for merge) pulled in by

    x11-libs/libXft[lcdfilter=,cleartype=] required by (x11-libs/cairo-1.10.2-r2::lcd-filtering, ebuild scheduled for merge)

  (x11-libs/libXft-2.3.0-r1::gentoo, installed) pulled in by

    (no parents that aren't satisfied by other packages in this slot)

media-libs/freetype:2

  (media-libs/freetype-2.4.9-r1::gentoo, installed) pulled in by

    (no parents that aren't satisfied by other packages in this slot)

  (media-libs/freetype-2.4.8::lcd-filtering, ebuild scheduled for merge) pulled in by

    media-libs/freetype:2[lcdfilter=] required by (x11-libs/cairo-1.10.2-r2::lcd-filtering, ebuild scheduled for merge)

    media-libs/freetype[lcdfilter=] required by (x11-libs/libXft-2.2.0::lcd-filtering, ebuild scheduled for merge)

----------

## Helmering

 *r0shi wrote:*   

> For some reason I'm getting this error when I try to run
> 
> emerge -uNav fontconfig freetype cairo libXft
> 
> Is there a way to fix this?
> ...

 

There is at the moment a more recent and stable version of freetype in portage. This is causing the mismatch.

lcd-filtering overlay will downgrade freetype.

Either:

- Wait until lcd-filtering overlay is updated. (Bi3l is normally advising the availability in this forum)

- Put >media-libs/freetype-2.4.8 temporary in your package.mask file

- Try

```
 emerge -1av fontconfig::lcd-filtering freetype::lcd-filtering cairo::lcd-filtering libXft::lcd-filtering
```

Cheers

----------

## bi3l

Added ebuilds and patchsets for freetype 2.4.9-r1 and libXft 2.3.0-r1.

----------

## EatMeerkats

 *bi3l wrote:*   

> Added ebuilds and patchsets for freetype 2.4.9-r1 and libXft 2.3.0-r1.

 

Thanks!  There seems to be a bug in the ebuild that prevents /usr/lib64/ft-settings.sh from getting installed.  Portage (2.1.10.49) complains about the following:

```
 * QA Notice: command not found:

 * 

 *    /var/tmp/portage/media-libs/freetype-2.4.9-r1/temp/environment: line 2838: newinst: command not found
```

----------

## bi3l

Fixed, thanks.

----------

## EatMeerkats

 *bi3l wrote:*   

> Fixed, thanks.

 

Thanks, but now the digest verification fails  :Smile: 

----------

## mbar

Yep:

```
Calculating dependencies - * Digest verification failed:

 * /var/lib/layman/lcd-filtering/media-libs/freetype/freetype-2.4.8.ebuild

 * Reason: Filesize does not match recorded size

 * Got: 4266

 * Expected: 4267                                                                                                                                              - * Digest verification failed:

 * /var/lib/layman/lcd-filtering/media-libs/freetype/freetype-2.4.9-r1.ebuild

 * Reason: Filesize does not match recorded size

 * Got: 4396

 * Expected: 4397                                                                                                                                             ... done!

```

----------

## bi3l

Fixed again. Sorry.

----------

## ppurka

I just tried to add this overlay for the first time. Why is the cleartype flag forced here?

```
~> layman -a lcd-filtering

* Running... # /usr/bin/git clone git://gitorious.org/lcd-filtering/lcd-filtering.git /var/lib/layman/lcd-filtering

Cloning into /var/lib/layman/lcd-filtering...

remote: Counting objects: 616, done.

remote: Compressing objects: 100% (607/607), done.

remote: Total 616 (delta 292), reused 0 (delta 0)

Receiving objects: 100% (616/616), 357.61 KiB | 110 KiB/s, done.

Resolving deltas: 100% (292/292), done.

* Successfully added overlay "lcd-filtering".

~> echo "media-libs/fontconfig ~x86" >> /etc/portage/package.keywords/fonts

~> echo "media-libs/freetype ~x86" >> /etc/portage/package.keywords/fonts  

~> echo "x11-libs/cairo ~x86" >> /etc/portage/package.keywords/fonts  

~> echo "x11-libs/libXft ~x86" >> /etc/portage/package.keywords/fonts

~> echo "media-libs/fontconfig -cleartype lcdfilter" >> /etc/portage/package.use/fonts

~> echo "media-libs/freetype -bindist -cleartype lcdfilter" >> /etc/portage/package.use/fonts  

~> echo "x11-libs/cairo -cleartype lcdfilter" >> /etc/portage/package.use/fonts  

~> echo "x11-libs/libXft -cleartype lcdfilter" >> /etc/portage/package.use/fonts

~> quietemerge -auNv fontconfig freetype cairo libXft

---------------------------------------------------------- Pretended emerge -----------------------------------------------------------

These are the packages that would be merged, in order:

Calculating dependencies  ... done!

[ebuild   R   ~] media-libs/freetype-2.4.9-r1::lcd-filtering [2.4.9-r1::gentoo] USE="X bzip2 lcdfilter%* -auto-hinter -bindist -debug -doc -fontforge -static-libs -utils" 0 kB

[ebuild     U ~] media-libs/fontconfig-2.8.0-r2::lcd-filtering [2.8.0-r1::gentoo] USE="cleartype%* lcdfilter%* -doc -static-libs%" 0 kB

[ebuild     U ~] x11-libs/libXft-2.3.0-r1::lcd-filtering [2.2.0::gentoo] USE="cleartype%* lcdfilter%* -static-libs" 318 kB

[ebuild     U ~] x11-libs/cairo-1.10.2-r2::lcd-filtering [1.10.2-r1::gentoo] USE="X cleartype%* glib lcdfilter%* opengl qt4 svg (-aqua) -debug -directfb -doc (-drm) (-gallium) (-openvg) -static-libs -xcb" 0 kB

Total: 4 packages (3 upgrades, 1 reinstall), Size of downloads: 318 kB

The following USE changes are necessary to proceed:

#required by x11-libs/cairo-1.10.2-r2[X], required by cairo (argument)

>=x11-libs/libXft-2.3.0-r1 cleartype

#required by x11-libs/cairo-1.10.2-r2, required by cairo (argument)

>=media-libs/fontconfig-2.8.0-r2 cleartype

~> eselect profile list 

Available profile symlink targets:

  [1]   default/linux/amd64/10.0

  [2]   default/linux/amd64/10.0/selinux

  [3]   default/linux/amd64/10.0/desktop *

  [4]   default/linux/amd64/10.0/desktop/gnome

  [5]   default/linux/amd64/10.0/desktop/kde

  [6]   default/linux/amd64/10.0/developer

  [7]   default/linux/amd64/10.0/no-multilib

  [8]   default/linux/amd64/10.0/server

  [9]   hardened/linux/amd64

  [10]  hardened/linux/amd64/selinux

  [11]  hardened/linux/amd64/no-multilib

  [12]  hardened/linux/amd64/no-multilib/selinux
```

----------

## ppurka

That was very silly of me. I had cairo +cleartype in a separate file in /etc/portage/package.use.

----------

## Element Dave

My fonts look much better thanks to the contributed patches.  One question: by default the variables below are exported globally.  I don't suppose they have analogous counterparts that can be set in a fontconfig XML file, or somewhere besides the environment?  I only glanced at the original (infinality) patch, but I'm guessing the only alternative is to define them at compile time.

```
INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH

INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE

INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH

INFINALITY_FT_CONTRAST

INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH

INFINALITY_FT_FRINGE_FILTER_STRENGTH

INFINALITY_FT_USE_VARIOUS_TWEAKS

INFINALITY_FT_BRIGHTNESS

INFINALITY_FT_GAMMA_CORRECTION

INFINALITY_FT_FILTER_PARAMS

INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS

INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE

INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH

INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH

INFINALITY_FT_STEM_ALIGNMENT_STRENGTH

INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT

INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE

INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE

INFINALITY_FT_STEM_FITTING_STRENGTH

INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS

INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE

```

----------

## PaulBredbury

 *Element Dave wrote:*   

> counterparts that can be set in a fontconfig XML file

 

No. I did mention originally that fontconfig would be better, for flexibility when mixed with the fontconfig rules.

 *Quote:*   

> alternative is to define them at compile time

 

That's what I used to do - check this thread. But /etc/profile.d/ works fine.

----------

## Helmering

 *Element Dave wrote:*   

> My fonts look much better thanks to the contributed patches.  One question: by default the variables below are exported globally.  I don't suppose they have analogous counterparts that can be set in a fontconfig XML file, or somewhere besides the environment?  I only glanced at the original (infinality) patch, but I'm guessing the only alternative is to define them at compile time.

 

Bi3l doesn't change the patches, he fits them to gentoo. (/etc/env.d/99lcdfilter and /usr/lib/ft-settings.sh)

As a Gentoo user with lcd-filtering overlay applied you should have a look here: http://gitorious.org/lcd-filtering/pages/Freetype

It's very easy to compare directly some different pre-defined profiles reguarding infinilty patches.

Open a terminal, type 

```
~$ source ft-settings.sh <the style you like to test>
```

Afterwards start your prefered browers within the same terminal. With two terminals opened and the same procedure you can easily compare different styles.

I made my choice persistant in /etc/bash/bashrc.

RalfLast edited by Helmering on Tue Apr 24, 2012 6:29 pm; edited 1 time in total

----------

## Helmering

Before you compare:

It's best to disable user.conf and local.conf using 

```
eselect fontconfig
```

----------

## PaulBredbury

There's a patch for cairo 1.12.0, to allow firefox 12.0 to compile with --enable-system-cairo

I see that Arch are currently using a git snapshot for cairo 1.12.0

----------

## MarekSieradzki

1. How is it related to this: http://www.antigrain.com/research/font_rasterization/index.html? (method that seems to be correct, look nice and not infringe anything)

Author describes it as:

 *Quote:*   

> 
> 
> Use horizontal RGB sub-pixel anti-aliasing for LCD flat panels.
> 
> Use vertical hinting only and completely discard the horizontal one.
> ...

 

2. Why isn't it upstream already?

3. Why isn't there a guide in first post?

4. Most of all: what does it do? Don't redirect me to reading 100 of pages of configuration XML, thank you.

----------

## mrpdaemon

Thanks for maintaining this awesome overlay. Font rending looks so much better after applying these changes  :Smile: 

----------

## ^marcs

Anyone else have have some fonts messed up in firefox after recent update?

my current versions 

```
[ebuild   R    ] media-libs/freetype-2.4.9-r1::lcd-filtering  USE="X bzip2 lcdfilter -auto-hinter -bindist -debug -doc -fontforge -static-libs -utils" 1,470 kB

[ebuild   R    ] media-libs/fontconfig-2.9.0::lcd-filtering  USE="lcdfilter -cleartype -doc -static-libs" 1,644 kB

[ebuild   R    ] x11-libs/libXft-2.3.0-r1::x-portage [2.3.0-r1::lcd-filtering] USE="lcdfilter -cleartype -static-libs" 318 kB

[ebuild   R    ] x11-libs/cairo-1.10.2-r2::lcd-filtering  USE="X glib lcdfilter opengl svg xcb (-aqua) -cleartype -debug -directfb -doc (-drm) (-gallium) (-openvg) (-qt4) -static-libs" 23,007 kB

```

example

https://www.dropbox.com/s/rew0xlc8p99uiep/ff_bad_fonts.png

----------

## EatMeerkats

 *^marcs wrote:*   

> Anyone else have have some fonts messed up in firefox after recent update?
> 
> my current versions 
> 
> ```
> ...

 

Things look fine here with:

```
[ebuild   R   ~] media-libs/freetype-2.4.9-r1::lcd-filtering  USE="X bzip2 lcdfilter -auto-hinter -bindist -debug -doc -fontforge -static-libs -utils" 1,470 kB

[ebuild   R   ~] media-libs/fontconfig-2.9.0::lcd-filtering  USE="lcdfilter -cleartype -doc -static-libs" 0 kB

[ebuild   R   ~] x11-libs/libXft-2.3.0-r1::lcd-filtering  USE="lcdfilter -cleartype -static-libs" 318 kB

[ebuild   R   ~] x11-libs/cairo-1.10.2-r2::lcd-filtering  USE="X glib lcdfilter opengl svg (-aqua) -cleartype -debug -directfb -doc (-drm) (-gallium) (-openvg) (-qt4) -static-libs -xcb" 23,007 kB
```

----------

## PaulBredbury

 *^marcs wrote:*   

> in firefox after recent update?

 

Well, what did you update?

I would recompile in the correct order:

pixman freetype2 fontconfig libXft cairo pango

In other news, cairo 1.12.2 is out, and running well.

----------

## EatMeerkats

 *PaulBredbury wrote:*   

> I would recompile in the correct order:
> 
> pixman freetype2 fontconfig libXft cairo pango

 

Please stop telling people to use the "correct order" – there is no "correct order" due to the way Portage works.

 *bi3l wrote:*   

>  *PaulBredbury wrote:*   The compilation order is wrong. Should be:
> 
> ```
> emerge -uNav freetype fontconfig cairo libXft
> ```
> ...

 

----------

## PaulBredbury

 *EatMeerkats wrote:*   

> there is no "correct order" due to the way Portage works.

 

Don't be so trusting. People can and do screw up compilations in every way possible. A recompilation won't hurt, and might fix the problem.

As a simple example, if a big patch is added to freetype, then "emerge cairo" is run, Portage won't know that freetype should be recompiled first.

----------

## mbar

 *^marcs wrote:*   

> Anyone else have have some fonts messed up in firefox after recent update?
> 
> 

 

Use eselect fontconfig, as some conf files were changed.

----------

## ^marcs

I have reseted whole fontconfig configuration and applied again as described in wiki, also tried rebuilding firefox, no effect.

*edit*

Ive downgraded fontconfig-2.9.0 to fontconfig-2.8.0-r2 and it helped.

----------

## EatMeerkats

 *PaulBredbury wrote:*   

> As a simple example, if a big patch is added to freetype, then "emerge cairo" is run, Portage won't know that freetype should be recompiled first.

 

Then the patch should be controlled by a USE flag or the version of freetype should be bumped to -r1 or something… either way, cairo's dependencies should require either the USE flag or new version if necessary.  Since bi3l's ebuilds require the proper "lcdfilter" USE flags, everything will be built in the correct order.

----------

## jcTux

 *^marcs wrote:*   

> 
> 
> *edit*
> 
> Ive downgraded fontconfig-2.9.0 to fontconfig-2.8.0-r2 and it helped.

 

Same solution here.

----------

## swimmer

 *^marcs wrote:*   

> I have reseted whole fontconfig configuration and applied again as described in wiki, also tried rebuilding firefox, no effect.
> 
> *edit*
> 
> Ive downgraded fontconfig-2.9.0 to fontconfig-2.8.0-r2 and it helped.

 

You saw and tried the new 11-lcdfilter-* rules in fontconfig did you?

HTH

swimmer

----------

## PaulBredbury

 *^marcs wrote:*   

> fonts messed up in firefox after recent update?
> 
> ...
> 
> [ebuild   R    ] x11-libs/cairo-1.10.2-r2::lcd-filtering  USE="X glib lcdfilter opengl svg xcb (-aqua) -cleartype -debug -directfb -doc (-drm) (-gallium) (-openvg) (-qt4) -static-libs" 23,007 kB

 

Try without the opengl USE flag. cairo 1.12.2's configure contains:

 *Quote:*   

> "'--- The OpenGL surface backend feature is still under active development and
> 
> --- is included in this release only as a preview. It does NOT fully work yet
> 
> --- and incompatible changes may yet be made to OpenGL surface backend
> ...

 

Anyway, fontconfig 2.9.0 works fine for me, with cairo 1.12.2 and the firefox 12.0 patch I mentioned earlier in this thread.

I compile cairo with:

```
--disable-static --disable-xlib-xcb --enable-tee --with-x
```

----------

## jcTux

 *swimmer wrote:*   

>  *^marcs wrote:*   I have reseted whole fontconfig configuration and applied again as described in wiki, also tried rebuilding firefox, no effect.
> 
> *edit*
> 
> Ive downgraded fontconfig-2.9.0 to fontconfig-2.8.0-r2 and it helped. 
> ...

 

You're wright.

11-lcdfilter-* was not activated.

----------

## PaulBredbury

 *jcTux wrote:*   

> 11-lcdfilter-* was not activated.

 

Er, what magic do you think it/they contain, that isn't already in Infinality's fontconfig file?

----------

## ppurka

 *PaulBredbury wrote:*   

>  *jcTux wrote:*   11-lcdfilter-* was not activated. 
> 
> Er, what magic do you think it/they contain, that isn't already in Infinality's fontconfig file?

 Without this enabled you get broken fonts as mentioned earlier in the page. If you follow these instructions then you will be stuck unless you notice that some of the filenames have changed.

----------

## bi3l

 *ppurka wrote:*   

> If you follow these instructions then you will be stuck unless you notice that some of the filenames have changed.

 

Fixed.

----------

## ppurka

 *bi3l wrote:*   

>  *ppurka wrote:*   If you follow these instructions then you will be stuck unless you notice that some of the filenames have changed. 
> 
> Fixed.

 Thanks  :Smile: 

----------

## angry_vincent

all ebuilds in lcd-filtering overlay should switch to virtual/pkgconfig dep instead of dev-util/pkgconfig, all ebuilds in gentoo tree migrated.

----------

## bi3l

 *angry_vincent wrote:*   

> all ebuilds in lcd-filtering overlay should switch to virtual/pkgconfig dep instead of dev-util/pkgconfig, all ebuilds in gentoo tree migrated.

 

Done.

----------

## PaulBredbury

Infinality has a new version out  :Smile: 

----------

## yngwin

Can someone enlighten me on the differences between the lcd-filtering overlay and MeisterP's infinality overlay? What would be reasons to choose one over the other?

Also, I'd like to see if it is feasible to get these patches into the official portage tree. Is anyone willing to work with me to maintain these?

----------

## poncho

 *yngwin wrote:*   

> Can someone enlighten me on the differences between the lcd-filtering overlay and MeisterP's infinality overlay? What would be reasons to choose one over the other?
> 
> Also, I'd like to see if it is feasible to get these patches into the official portage tree. Is anyone willing to work with me to maintain these?

 

The lcd-filtering overlay is patching media-libs/fontconfig and some fonts packages to apply the various infinality font settings. I (poncho aka MeisterP) made a media-libs/fontconfig-infinality package to install all configuration files into /etc/fonts/infinality/ and use an unpatched media-libs/fontconfig.

The reason for doing this was to follow infinality's rpm packages more closely and to have a live ebuild for https://github.com/Infinality/fontconfig-infinality.

If we want to have a fontconfig-infinality package in the tree, it would be worthwhile to replace the infctl tool (which manages symlinks in /etc/fonts/infinality/) with a proper eselect module.

If there are more questions concerning my overlay feel free to ask. And yes, I would be willing to (proxy?)maintain the packages with you.

----------

## PaulBredbury

 *yngwin wrote:*   

> get these patches into the official portage tree.

 

There'll be one less patch file required in future  :Smile: 

----------

## yngwin

 *PaulBredbury wrote:*   

>  *yngwin wrote:*   get these patches into the official portage tree. 
> 
> There'll be one less patch file required in future 

 

It's very good to see that he's working with the Freetype devs to get his patches in. Less work for us, indeed!

 *poncho wrote:*   

> I (poncho aka MeisterP) made a media-libs/fontconfig-infinality package to install all configuration files into /etc/fonts/infinality/ and use an unpatched media-libs/fontconfig.
> 
> The reason for doing this was to follow infinality's rpm packages more closely and to have a live ebuild for https://github.com/Infinality/fontconfig-infinality.
> 
> If we want to have a fontconfig-infinality package in the tree, it would be worthwhile to replace the infctl tool (which manages symlinks in /etc/fonts/infinality/) with a proper eselect module. 

 

This sounds like a reasonable approach to get this into portage. I will look at it in more detail over the coming days (quite busy with work atm), and see if I can convince the freetype and cairo maintainers to work with us.   :Razz: 

----------

## alexcortes

Hi,

Lcd-filtering overlay needs a update: there are freetype-2.4.10 in portage tree and the infinality patch.   :Smile: 

http://www.infinality.net/forum/viewtopic.php?f=2&t=79

EDIT: also libXft-2.3.1

Thanks!!!

----------

## bi3l

Done.

----------

## alexcortes

 *bi3l wrote:*   

> Done.

 

Really thanks!    :Very Happy: 

----------

## omidxo

Existing ubuntu patch is good enough.

http://i.imgur.com/eRim9.png

http://i.imgur.com/nLvOn.png

Show me any images with Infinality set, pls.

----------

## IvanMajhen

This is how it looks with default infinality freetype/fontconfig settings:

http://img442.imageshack.us/img442/1951/snimka1.png

http://img440.imageshack.us/img440/1761/snimka2m.png

Note that there are also different freetype seetings like: (freetype-2.4.10)

```
# Possible options: 

# 

# DEFAULT      - Use above settings.  A compromise that should please most people.

# OSX          - Simulate OSX rendering

# UBUNTU       - Simulate UBUNTU rendering

# LINUX        - Generic "Linux" style - no snapping or certain other tweaks

# WINDOWS      - Simulate Windows rendering

# WINDOWS7     - Simulate Windows rendering with normal glyphs

# WINDOWS7LIGHT- Simulate Windows 7 rendering with lighter glyphs

# WINDOWS      - Simulate Windows rendering

# VANILLA      - Just subpixel hinting

# CUSTOM       - Your own choice.  See below

# ----- Infinality styles -----

# CLASSIC      - Infinality rendering circa 2010.  No snapping.

# NUDGE        - CLASSIC with lightly stem snapping and tweaks

# PUSH         - CLASSIC with medium stem snapping and tweaks

# SHOVE        - Full stem snapping and tweaks without sharpening

# SHARPENED    - Full stem snapping, tweaks, and Windows-style sharpening

# INFINALITY   - Settings I use

# DISABLED     - Act as though running without the extra infinality enhancements (just subpixel hinting).
```

and fontconfig settings:

```
acer infinality# ./infctl.sh setstyle

Select a style:

1) debug       3) linux       5) osx2        7) win98

2) infinality  4) osx         6) win7        8) winxp

#? 

```

----------

## omidxo

Looks perfect!  Thanks for simple direction.

----------

## Hypnos

Using MeisterP's overlay, w/ infinality setting "Linux" and DejaVu fonts -- suitable replacement for ClearType, which I liked quite a bit.

Had to remember to enable infinality.conf with 'eselect fontconfig' .

----------

## Hypnos

One issue:  on dark backgrounds (e.g., my terminal) my lowercase "m"'s have a reddish tinge them, I suppose because the stems are thinner than my pixels.  However, I did not observe this with ClearType -- any solutions?

(See PNG image.)

----------

## PaulBredbury

 *Hypnos wrote:*   

> reddish tinge

 

You probably want a rule using e.g. (as a bit of it):

```
    <test name="pixelsize" compare="less_eq">

        <double>12</double>

    </test>

    <edit mode="assign" name="rgba">

        <const>none</const>

    </edit>
```

----------

## Hypnos

I added the following to /etc/fonts/local.conf:

```
<match target="font">

    <test name="pixelsize" compare="less_eq">

        <double>12</double>

    </test>

    <edit mode="assign" name="rgba">

        <const>none</const>

    </edit>

</match>
```

to no avail.  Logging out/in did not change the result.

During the day the problem is not as apparent; I'll check again tonight.  (In fact, during the day, the infinality font rendering is gorgeous.)

----------

## Hypnos

Also, tried the Ubuntu preset in 99lcdfilter.  Predictably, this one is more ClearType-like: less crisp/impressive, but also less apparent color fringing for white text on black backgrounds.  Still, I never noticed any color fringing with ClearType, whereas I do notice some on the Ubuntu preset.

Finally, while fonts in the main Skype window and chat windows are fine, in the menus they are gigantic.  I chalk this up to using precompiled 32-bit Qt emulation libraries inducing some incompatibility.

----------

## Hypnos

If I use the "Linux" settings in infinality config as well as in /etc/env.d/99lcdfilter, then in the latter set the following custom values:

```
INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=30

INFINALITY_FT_FRINGE_FILTER_STRENGTH=100
```

I cut most of the color fringing/harshness, at the cost of a little bit of crispness.

Easier on the eyes in artificial light, while still being more than adequate in sunlight.  

If I only set the fringe filter strength, I get bad glyph shapes.

YMMV.

********

EDIT:

Found the holy grail -- '"linux" eselect infinality setting, with "INFINALITY" presets in /etc/env.d/99lcdfilter .

Gorgeous rending of larger/bold text, ClearType-like readability of smaller text, and no color fringing in my terminals.

----------

## angry_vincent

app-text/poppler included in overlay but it's outdated, any particular reason?

----------

## angry_vincent

Another issue, in wiki suggested to set -cleartype flag, however in cairo and fontconfig ebuilds +cleartype IUSE is set. I think, it's better to make flag optional? And vice versa set +lcdfilter as it makes sense.

----------

## angry_vincent

Next issue, libXft-2.3.1 has no IUSE, lcdfilter is supposed to be there, no one bother about +cleartype, which is set in older revisions of libXft.

----------

## Hypnos

angry_vincent,

Are you sure you're looking at the right overlay?  I'm using fontconfig, libXft and poppler from the Gentoo tree, as they are most up-to-date; cairo is from infinality.  None of these ebuilds have either the lcdfilter or cleartype USE flags.  The only ebuild that should/needs to have lcdfilter enabled is freetype from infinality (required by the infinality cairo ebuild).

----------

## angry_vincent

it is what lcd-filtering providing, all issues about that overlay.

----------

## Hypnos

 *angry_vincent wrote:*   

> it is what lcd-filtering providing, all issues about that overlay.

 

Ah.  Anyway, as I described, the infinality overlay does not have these issues.

----------

## bi3l

 *angry_vincent wrote:*   

> Next issue, libXft-2.3.1 has no IUSE, lcdfilter is supposed to be there, no one bother about +cleartype, which is set in older revisions of libXft.

 

Fixed the wiki.

 *angry_vincent wrote:*   

> Another issue, in wiki suggested to set -cleartype flag, however in cairo and fontconfig ebuilds +cleartype IUSE is set. I think, it's better to make flag optional? And vice versa set +lcdfilter as it makes sense.

 

Ok, I'll change that.

 *angry_vincent wrote:*   

> app-text/poppler included in overlay but it's outdated, any particular reason?

 

No, it should be removed.

----------

## yngwin

I have added the ebuilds from MeisterP's infinality-overlay to the betagarden overlay (this is the official dev playground) for more exposure. I will discuss with the relevant package maintainers on getting these into the official tree.

----------

## yngwin

I have taken over maintainership of cairo, so the necessary patches have been applied to 1.10.2-r3 and 1.12.2-r2 in the official portage tree. So you can drop cairo from your overlays.

Next I want to apply the freetype patches, but I will probably "hide" them behind an "infinality" useflag, so as not to upset dev and users who prefer to keep vanilla freetype. Obviously I also will add fontconfig-infinality then, and MeisterP's eselect module. But first I would like to impove the latter, so users don't need to edit /etc/env.d/99lcdfilter by hand.

----------

## shad0w_GR

Is overlay down?I cannot since yesterday add locally the repo.

Edited: Seems that git wasnt pulled by layman.Now it is ok.

----------

## danilo2

Hi!

Thank you very much for this thread and all efforts putting in rendering beautifull ofnts in gentoo  :Smile: 

I'm a little bit confused right now. Could you please tell me where can I find a summary what should I do to get the best results?

It is really hard to read this thread from the very beginning.

I've found some sites like:

http://blog.segfault.co.in/?p=192

https://linuxtidbits.wordpress.com/2008/11/25/better-lcd-font-rendering/

(why there is -cleartype flag used ?)

maybe this manuals are describing the best way?:

http://gitorious.org/lcd-filtering/pages

thanks

----------

## Mr. Tao

I couldn’t  find MeisterP’s overlay in layman’s list of overlays, therefore I wrote local definition.

```
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE repositories SYSTEM "/dtd/repositories.dtd">

<repositories xmlns="" version="1.0">

   <repo quality="experimental" status="unofficial">

      <name><![CDATA[ infinality ]]></name>

      <description lang="en"><![CDATA[ MeisterP's Infinality patches overlay ]]></description>

      <homepage>https://github.com/MeisterP/infinality-overlay.git</homepage>

      <owner type="person">

         <email>poncho@spahan.ch</email>

         <name><![CDATA[ Poncho ]]></name>

      </owner>

      <source type="git">git://github.com/MeisterP/infinality-overlay.git</source>

      <feed>https://github.com/MeisterP/infinality-overlay/commits/master.atom</feed>

   </repo>

</repositories>
```

To use it, add something like file:///etc/layman/infinality-overlay.xml to overlays section of /etc/layman.cfg.

----------

## danilo2

Do we have to use MeisterP overlay or is it good to use one of these instructions:

http://blog.segfault.co.in/?p=192

https://linuxtidbits.wordpress.com/2008/11/25/better-lcd-font-rendering/

http://gitorious.org/lcd-filtering/pages

?

Additional - after following instruction in http://gitorious.org/lcd-filtering/pages something strange happened to my system. All fonts that was not supposed to be antialiased (like proggy, terminus etc) dissappeared from my system and were replaced by other fonts. (I cannot event find them in the font list)  :Sad: 

my eselect fontconfig list: http://bpaste.net/show/37306/

----------

## Hypnos

Here's how I got my font setup working with MeisterP's overlay:

1) Followed these instructions

2) Then I experimented with combinations of the "eselect infinality" setting and the style in /etc/env.d/99lcdfilter.  My best combination so far is "Linux" eselect plus the "infinality" style.  You may have to manually restart some applications (or log out/back in) in order to see the changes.

----------

## PaulBredbury

 *yngwin wrote:*   

> necessary patches have been applied

 

I wait years, bitching as appropriate, then ya spell my name wrong  :Mad: 

----------

## danilo2

1) Hypnos -> while emerging from this overlay I get circular dependency problem (which cannot besolved by disabling some use flags  :Sad: )

```
(media-libs/fontconfig-infinality-20120615::infinality-overlay, ebuild scheduled for merge) depends on

 (media-libs/freetype-2.4.10::infinality-overlay, ebuild scheduled for merge) (runtime)

  (media-libs/fontconfig-infinality-20120615::infinality-overlay, ebuild scheduled for merge) (runtime)

```

2) Do you know how can I fix my not antialiased fonts (the problem is described in my previous post)?

----------

## ppurka

 *PaulBredbury wrote:*   

>  *yngwin wrote:*   necessary patches have been applied 
> 
> I wait years, bitching as appropriate, then ya spell my name wrong 

   :Laughing: 

----------

## Hypnos

 *danilo2 wrote:*   

> 1) Hypnos -> while emerging from this overlay I get circular dependency problem (which cannot besolved by disabling some use flags )
> 
> ```
> (media-libs/fontconfig-infinality-20120615::infinality-overlay, ebuild scheduled for merge) depends on
> 
> ...

 

Since they are each run-time, not build-time, dependencies of one another, it's okay to instruct your package manager to ignore one of the dependencies to break the cycle and install them one by one .  I use Paludis, so invoked

```
#  cave-resolve -1x freetype fontconfig-infinality --no-dependencies-from fontconfig-infinality
```

 *Quote:*   

> 2) Do you know how can I fix my not antialiased fonts (the problem is described in my previous post)?

 

I bet the fonts are just there, just not enabled.  Your fontconfig list shows terminus.conf is there, but not activated.  I think if you successfully install MeisterP's package set, and select "linux" under "eselect infinality", the fonts will come back.  If not, you can try reinstalling the fonts.

If none of these work we'll have to investigate.

----------

## PaulBredbury

 *danilo2 wrote:*   

> All fonts that was not supposed to be antialiased (like proggy, terminus etc) dissappeared from my system and were replaced by other fonts.

 

You have 70-no-bitmaps.conf enabled. Proggy is a bitmap font. So tweak the rule so it doesn't apply to Proggy.

----------

## yngwin

 *PaulBredbury wrote:*   

>  *yngwin wrote:*   necessary patches have been applied 
> 
> I wait years, bitching as appropriate, then ya spell my name wrong 

 

My apologies. Should be fixed now.

----------

## danilo2

thank you! I disabled the rule "70-no-bitmaps.conf " and now the bitmap fonts are available (I hope this does not break any antialiasing or something).

Hypnos -> thank you  :Smile:  Could you tell me please if configuring everything as described in yours link should I keep the ~/.fonts.conf file and if having lcd-filtering toolchain breaks something?

----------

## Hypnos

 *danilo2 wrote:*   

> Hypnos -> thank you  Could you tell me please if configuring everything as described in yours link should I keep the ~/.fonts.conf file and if having lcd-filtering toolchain breaks something?

 

I would move my ~/.fonts.conf while plaing with the infinality settings.  Then, after you've optimized those settings, you can reintroduce a ~/.fonts.conf to tweak the rendering.

I'm not sure what you mean by "lcd-filtering toolchain" -- you mean from the lcd-filtering overlay? I wouldn't mix and match without knowing exactly what patches go in the packages.  Before following MeisterP's instructions, replace your packages from lcd-filtering overlay with the packages from the main Portage tree.  revdep-rebuild, log out/back in and make sure everything functions normally.  Then, follow MeisterP's instruction to get his ebuild set working.

----------

## yngwin

Okay, it is done: infinality patched packages are all in the official portage tree now!

You will need to get these versions:

media-libs/freetype-2.4.10-r1 with USE=infinality (this should pull in the fontconfig and eselect packages)

media-libs/fontconfig-infinality-20120619

app-admin/eselect-infinality-1

app-admin/eselect-lcdfilter-1

x11-libs/cairo-1.12.2-r3 (or 1.10.2-r3 if you want to stay with the old version for some reason)

I will be maintaining these packages, so if there are any issues or updates, let me know.

----------

## alexcortes

Hello,

After updating from lcd-filtering overlay to official portage tree version, I got this message (when I open a terminal):

```
-bash: /usr/lib/ft-settings.sh: No such file or directory
```

Thanks!!!   :Smile: 

----------

## mrpdaemon

yngwin, thanks for all the hard work. I'd like to upgrade to the portage versions (using the lcdfilter overlay right now), but the issue from bug #428358 is holding me back (bad performance with cairo-1.12 without gradients patch). It would be awesome if we could push that patch to the portage version to make things smooth again.

----------

## yngwin

 *mrpdaemon wrote:*   

> bug #428358 is holding me back (bad performance with cairo-1.12 without gradients patch). It would be awesome if we could push that patch to the portage version to make things smooth again.

 

I just did. Get 1.12.2-r3 please.

I also changed the useflag on freetype from lcdfilter to infinality due to bug #428548.

I have updated my post above for clarity.

----------

## yngwin

 *alexcortes wrote:*   

> After updating from lcd-filtering overlay to official portage tree version, I got this message (when I open a terminal):
> 
> ```
> -bash: /usr/lib/ft-settings.sh: No such file or directory
> ```
> ...

 

I take it something in your bash profile is calling that. It's a file that is installed by the lcd-filtering overlay only. You should remove whatever wants to call that, and use eselect-lcdfilter instead.

----------

## alexcortes

Oh, I've looked at bash* but I miss one.   :Cool: 

Thanks!!!

----------

## comprookie2000

I just gave it a go and it did improve my fonts alot. I want to thank everyone  :Smile:  Here are my Notes

Looks like we need to put together a wiki entry if there is not one already.

----------

## Ant P.

Looks interesting. I have two serious problems after installing though:

.pfb fonts no longer work at all.

urxvt is now completely unreadable (and it's even worse than in those old screenshots) because these patches require libXft >= 2.3.

----------

## ppurka

 *Ant P. wrote:*   

> Looks interesting. I have two serious problems after installing though:
> 
> .pfb fonts no longer work at all.
> 
> urxvt is now completely unreadable (and it's even worse than in those old screenshots) because these patches require libXft >= 2.3.
> ...

 I too had spaced out fonts in urxvt. They got fixed (immediately) after I set eselect fontconfig, infinality, and lcdfilter.

----------

## ^marcs

I'm definitely noticing performance drop after installing cairo-1.12.2-r3, most notably in firefox - for the moment I have reverted to -r2 and everything is working fine as it used to.

PS. Thanks for getting those patches into main tree

----------

## Ant P.

 *ppurka wrote:*   

> I too had spaced out fonts in urxvt. They got fixed (immediately) after I set eselect fontconfig, infinality, and lcdfilter.

 

Can you post `for i in fontconfig infinality lcdfilter; do eselect $i list | grep '*'; done`? I've tried a bunch of settings, even with infinality turned off, and got nowhere. The only thing that's worked for me is libXft-2.2.

----------

## ppurka

Here you go:

```
~» for i in fontconfig infinality lcdfilter; do

for... eselect $i list | grep '*'

for... done

Available fontconfig .conf files (* is enabled):

  [2]   10-autohint.conf *

  [5]   10-sub-pixel-rgb.conf *

  [9]   11-lcdfilter-default.conf *

  [13]  20-unhint-small-dejavu-sans.conf *

  [14]  20-unhint-small-dejavu-sans-mono.conf *

  [15]  20-unhint-small-dejavu-serif.conf *

  [16]  20-unhint-small-vera.conf *

  [18]  30-metric-aliases.conf *

  [19]  30-urw-aliases.conf *

  [20]  40-nonlatin.conf *

  [21]  45-latin.conf *

  [22]  49-sansserif.conf *

  [23]  50-user.conf *

  [24]  51-local.conf *

  [25]  52-infinality.conf *

  [26]  57-dejavu-sans.conf *

  [27]  57-dejavu-sans-mono.conf *

  [28]  57-dejavu-serif.conf *

  [29]  60-latin.conf *

  [36]  65-nonlatin.conf *

  [38]  70-no-bitmaps.conf *

  [41]  90-synthetic.conf *

  [2]   infinality *

  [3]   infinality *

```

----------

## mwhitlock

I've been using the "lcd-filtering" overlay for years, but the latest update forced me off of it and back onto the vanilla Portage version of FreeType. The rendering of DejaVu Sans Mono in Konsole became unbearable (for me) after the latest update (to freetype-2.4.10 with +lcdfilter). I also tried freetype-2.4.10-r1 with +infinality, and it was different, but still not usable.

For the benefit of all who wish to compare, I took screen shots of the same directory listing in Konsole, perfectly aligned to the exact pixel. I recommend opening these images in separate tabs and flipping back and forth between the tabs to compare.

http://www.mattwhitlock.com/freetype-2.4.10-r1_-infinality.png — okay; like it was before 2.4.10

Baseline for comparison. Has a yellowish tinge, but the letter forms are nice and consistent.

http://www.mattwhitlock.com/freetype-2.4.10_+lcdfilter.png — unusable

A great many glyphs are squished horizontally, notably the 'P'. Some glyphs look better, notably the 'w'. However, in glyphs that have "curly tails," such as '2', '6', '9', 'J', 'S', 'e', etc., the tails seem to disappear into nothing rather than coming to a nice defined end. It's as though FreeType is hinting the tips down to a single subpixel rather than leaving them at a full pixel width. Imagine a sharp, pointy end versus a flat, butt end. The 'e' looks like it has a severe "overbite."

http://www.mattwhitlock.com/freetype-2.4.10-r1_+infinality.png — unusable

This is even worse. Some glyphs are no longer square, notably the 'u'. The vertical strokes now seem thicker than the curved parts of the glyphs, notably on the 'J' and the 'p'.

I'll keep the yellow tinge if it means I can keep glyphs with consistent stroke thickness and tails that reach all the way to the edge of the glyph's bounding box rather than trailing off prematurely.

Note: This post is not meant to disparage the hard work of the people making these patches or maintaining the overlays. I just don't like the latest results of their efforts. Matter of taste.Last edited by mwhitlock on Tue Jul 31, 2012 6:12 pm; edited 1 time in total

----------

## PaulBredbury

 *mwhitlock wrote:*   

> squished horizontally, notably the 'P'

 

This is probably INFINALITY_FT_STEM_ALIGNMENT_STRENGTH - try setting that to 0.

----------

## mwhitlock

 *PaulBredbury wrote:*   

>  *mwhitlock wrote:*   squished horizontally, notably the 'P' 
> 
> This is probably INFINALITY_FT_STEM_ALIGNMENT_STRENGTH - try setting that to 0.

 

The "freetype-2.4.10-r1_+infinality.png" that I posted is with all Infinality settings disabled.

```
# eselect fontconfig disable 52-infinality.conf

# rm /etc/env.d/99lcdfilter

# env-update

# /etc/init.d/xdm restart
```

```
$ echo "*$INFINALITY_FT_STEM_ALIGNMENT_STRENGTH*"

**
```

----------

## PaulBredbury

 *mwhitlock wrote:*   

> rm /etc/env.d/99lcdfilter

 

I don't think that's what Infinality intended, so I doubt it gives optimum results. Heck, ya need to check the sourcecode to see what "fallback" configuration values are used.

Infinality does *not* auto-detect your eyesight and monitor condition - ya need to configure it yourself.

----------

## danilo2

 *Hypnos wrote:*   

> 
> 
> ```
> #  cave-resolve -1x freetype fontconfig-infinality --no-dependencies-from fontconfig-infinality
> ```
> ...

 

Is it possible in gentoo's emerge? I connot find any option allowing to disable dependencies form some packages.

----------

## mwhitlock

A general observation: a huge glaring problem that I see with this method of configuring the Infinality feature set is that it operates outside of Fontconfig, so there is no way to specify Infinality settings on a font-by-font basis. For example, I can't set INFINALITY_FT_STEM_ALIGNMENT_STRENGTH only for font family "DejaVu Sans Mono" at normal or lighter weight and 12 pt or smaller size. If Infinality were configured via Fontconfig, as "lcdfilter" is, such font matching-specific overrides would be possible.

But this is a moot point for me, as even by tweaking/discarding the global Infinality settings, I can't figure out how to make FreeType with "+infinality" render my terminal font the same as FreeType with "-infinality", even when I've disabled all Infinality-provided Fontconfig tweaks and have omitted all INFINALITY_* environment variables. My understanding is that omitting the environment variables is supposed to make FreeType use its default behavior, but in fact the resulting rendering is very different.

----------

## Hypnos

 *danilo2 wrote:*   

> Is it possible in gentoo's emerge? I connot find any option allowing to disable dependencies form some packages.

 

Maybe use /etc/portage/profile/package.provided ?  See "man portage"

----------

## PaulBredbury

 *mwhitlock wrote:*   

> If Infinality were configured via Fontconfig, as "lcdfilter" is, such font matching-specific overrides would be possible.

 

I have pointed that out previously in this thread.

 *Quote:*   

> render my terminal font the same as FreeType with "-infinality"

 

I suggest using Infinality's own forum.

----------

## IvanMajhen

Does somebody know how to setup this:

http://aur.archlinux.org/packages.php?ID=26641&comments=all&detail=1

I patched poppler and rebuilded okular, but after that okular won't open pdf files. I'm not happy how fonts look in pdf files.

Acroread look much better.

----------

## omidxo

 *mwhitlock wrote:*   

> My understanding is that omitting the environment variables is supposed to make FreeType use its default behavior, but in fact the resulting rendering is very different.

 

Numerous switches bewildered me just like opening a Pandora's box.

----------

## PaulBredbury

 *mrpdaemon wrote:*   

> bad performance with cairo-1.12 without gradients patch

 

Nvidia 304.30 sounds promising:

 *Quote:*   

> Fixed a problem where RENDER Glyphs operations would exhibit severe performance issues in certain cases, such as when used with gradients by Cairo and Chromium.

 

Except that 304.30 makes SDL-based games all blue  :Exclamation: 

----------

## alexcortes

When '52-infinality.conf' is enabled the fonts seems very tiny on some programs like conky and xchat. I need to change the font size from 9 to 13 to take the normal/old 9 size.

I don't know if it's a bug or purposeful.   :Question: 

```
 [1]   10-autohint.conf *

  [4]   10-sub-pixel-rgb.conf *

  [8]   11-lcdfilter-default.conf *

  [11]  20-fix-globaladvance.conf *

  [12]  20-unhint-small-dejavu-sans-mono.conf *

  [13]  20-unhint-small-dejavu-sans.conf *

  [14]  20-unhint-small-dejavu-serif.conf *

  [15]  20-unhint-small-vera.conf *

  [17]  30-metric-aliases.conf *

  [18]  30-urw-aliases.conf *

  [19]  31-cantarell.conf *

  [20]  40-nonlatin.conf *

  [21]  45-latin.conf *

  [22]  49-sansserif.conf *

  [23]  50-user.conf *

  [24]  51-local.conf *

  [25]  52-infinality.conf *

  [29]  58-corefonts.conf *

  [30]  59-google-droid-sans-mono.conf *

  [31]  59-google-droid-sans.conf *

  [32]  59-google-droid-serif.conf *

  [33]  60-latin.conf *

  [39]  65-fonts-persian.conf *

  [41]  65-nonlatin.conf *

  [42]  69-unifont.conf *

  [43]  70-no-bitmaps.conf *

  [45]  80-delicious.conf *

  [47]  90-synthetic.conf *

```

----------

## mwhitlock

 *alexcortes wrote:*   

> When '52-infinality.conf' is enabled the fonts seems very tiny on some programs like conky and xchat. I need to change the font size from 9 to 13 to take the normal/old 9 size.
> 
> I don't know if it's a bug or purposeful.  

 

When I was glancing through the Infinality installation (before I ultimately decided to abandon it), I noticed that Infinality can force a DPI for font rasterization that differs from the DPI advertised by the X server.  The X server by default will calculate its DPI as a function of your monitor's resolution and physical size, which it retrieves from the monitor by EDID. So if your X server is running at a DPI much different than the font DPI forced by Infinality, then your fonts will end up rasterizing at a noticeably different size than they would if FreeType were using the X server's DPI.

----------

## PaulBredbury

If you have e.g. this rule:

```
   <match target="pattern">

      <edit name="dpi" mode="assign">

         <double>72</double>

      </edit>

   </match>
```

Then delete it - that's my advice.

----------

## alexcortes

 *PaulBredbury wrote:*   

> If you have e.g. this rule:
> 
> ```
>    <match target="pattern">
> 
> ...

 

Without that rule the issue is solved, but the fonts seems more sharpen at all. So, I'll look what is better...

EDIT: I'm using 15.6 display with 1366x768 native resolution.

```
x11-drivers/nvidia-drivers-302.17-r1  USE="acpi (multilib) -tools"
```

Thanks!   :Very Happy: 

----------

## bi3l

I finally had some time to review the integration of the fontconfig scripts from infinality in gentoo. Here are a few comments :

 Configuring the fonts is really too complicated

3 eselect scripts (fontconfig, infinality, lcdfilter) is too much. For me, there should be only 2 : one to configure fontconfig (which already exists) and one to configure freetype (the lcdfilter one, but the name is misleading).

 Custom configurations are overridden by infinality ones

Because of the precedence order, some settings from ~/.fonts.conf and /etc/fonts/local.conf are overridden by settings from infinality's scripts.

 Some fontconfig scripts are now useless

Settings from fontconfig's 10-* scripts are completely overridden by settings from infinality's 50-base-rendering-*.

 Some infinality scripts are mostly empty (42-repl-global.conf and 65-override.conf)

 Some scripts are duplicated between infinality and fontconfig (31-cantarell.conf and 20-fix-cantarell.conf)

All in all, I don't like the way the scripts have been integrated in gentoo. For sure, it's easily maintainable because it strictly follows what's provided by infinality but it makes configuring the fonts a bigger mess than it was. What I suggest is not to have 2 sets of scripts (fontconfig's and infinality's) but only the fontconfig one with the inifinality scripts correctly integrated to it. For this purpose, some of the scripts should be removed, some should be added to the fontconfig ebuild, some others should be added to the liberation-fonts, dejavu, corefonts ebuilds, ...

----------

## Small_Penguin

+1

It's complicated and unclear the way it is now. I'm unsure what I'm using right now and what will happen when I change things using eselect fontconfig.

For some reason, now I get ugly fonts in the GUI of some java applications, like the menu and other widgets in tvbrowser though the tv guide looks fine. It was looking good before.

Edit: How about a wiki guide for eselect fontconfig that tells you what to do to correctly configure infinality instead of the other two eselect modules?

----------

## alexcortes

IMO if there are just one separated script with the options that are now on lcdfilter script and when selecting one of that it's just auto change the options needed on the others scripts would be the more simple way at user side, but may not at dev side.

Thanks!  :Smile: 

----------

## ppurka

Printing with cups was failing with an error from ghostscript.

```
D [19/Aug/2012:17:27:22 +0800] [Job 83] Start rendering...

D [19/Aug/2012:17:27:22 +0800] [Job 83] Set job-printer-state-message to "Start rendering...", current level=INFO

D [19/Aug/2012:17:27:22 +0800] [Job 83] Processing page 1...

D [19/Aug/2012:17:27:22 +0800] [Job 83] Set job-printer-state-message to "Processing page 1...", current level=INFO

D [19/Aug/2012:17:27:22 +0800] [Job 83] Error: /invalidfont in /findfont

D [19/Aug/2012:17:27:22 +0800] [Job 83] Operand stack:

D [19/Aug/2012:17:27:22 +0800] [Job 83] F14572_0   1   1   --nostringval--   Helvetica

D [19/Aug/2012:17:27:22 +0800] [Job 83] Execution stack:

D [19/Aug/2012:17:27:22 +0800] [Job 83] %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1882   1   3   %oparray_pop   1881   1   3   %oparray_pop   1865   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1840   5   4   %oparray_pop

D [19/Aug/2012:17:27:22 +0800] [Job 83] Dictionary stack:

D [19/Aug/2012:17:27:22 +0800] [Job 83] --dict:1166/1684(ro)(G)--   --dict:0/20(G)--   --dict:84/200(L)--   --dict:67/75(L)--

D [19/Aug/2012:17:27:22 +0800] [Job 83] Current allocation mode is local

D [19/Aug/2012:17:27:22 +0800] [Job 83] Last OS error: 2

D [19/Aug/2012:17:27:22 +0800] [Job 83] GPL Ghostscript 9.05: Unrecoverable error, exit code 1

D [19/Aug/2012:17:27:22 +0800] [Job 83] Rendering completed

D [19/Aug/2012:17:27:22 +0800] [Job 83] Set job-printer-state-message to "Rendering completed", current level=INFO

D [19/Aug/2012:17:27:22 +0800] [Job 83] prnt/hpcups/HPCupsFilter.cpp 528: cupsRasterOpen failed, fd = 0

D [19/Aug/2012:17:27:22 +0800] [Job 83] prnt/backend/hp.c 839: ERROR: null print job total=0

D [19/Aug/2012:17:27:22 +0800] [Job 83] End of messages

```

The advice in this post helped me in getting rid of the error. It requires one to enable Type 1 fonts by commenting out a section of /etc/fonts/infinality/infinality.conf

----------

## Hypnos

Yup, same error when dealing with PostScript output from older applications, and same fix (had to do "fc-cache -f" as root for the change to take effect).

----------

## ^marcs

 *PaulBredbury wrote:*   

>  *mrpdaemon wrote:*   bad performance with cairo-1.12 without gradients patch 
> 
> Nvidia 304.30 sounds promising:
> 
>  *Quote:*   Fixed a problem where RENDER Glyphs operations would exhibit severe performance issues in certain cases, such as when used with gradients by Cairo and Chromium. 
> ...

 

Now nvidia 304* is in ~arch, any noticeable changes on that problem?

----------

## Ant P.

I finally got around to trying those settings... but urxvt's still broken for me. It looks like at least it's not just me either.

The one thing really annoying me is I've got libXft 2.3 on another machine and urxvt works fine there. The useflags are identical, I've even tried copying the config from that *exactly* including matching the user and local.conf and .Xresources, and nothing changed.

Edit

OK, I changed the USE to rxvt-unicode[+alt-font-width,-vanilla] and now the text's legible again. I'm not entirely comfortable with having to use different USEflags on different installs to get the same behaviour, but at this point I've given up trying to look for logical explanations.

----------

## yngwin

 *bi3l wrote:*   

> I finally had some time to review the integration of the fontconfig scripts from infinality in gentoo. Here are a few comments :
> 
>  Configuring the fonts is really too complicated
> 
> 3 eselect scripts (fontconfig, infinality, lcdfilter) is too much. For me, there should be only 2 : one to configure fontconfig (which already exists) and one to configure freetype (the lcdfilter one, but the name is misleading).
> ...

 

Thanks, that is some good feedback. I'm all for improving the user experience. I decided to keep the infinality and lcdfilter (I'm open to renaming this) eselect modules separate for maximum flexibility (which after all is The Gentoo Way). But if there are better ways of doing things, please come with specific improvement proposals, and we can probably work something out.

(If anyone was wondering why I was unresponsive this month: I was on holiday.)

----------

## Ant P.

Word of warning, I updated chromium 21 -> 22 days ago and it's absolutely wrecked font rendering. Looks like they screwed up gamma correction or something; dark text on light looks anorexic and washed out, and light text on dark looks too emboldened.

----------

## PaulBredbury

Firefox 15 needs cairo patched, to compile with --enable-system-cairo. Again.

----------

## inch

I emerged freetype with the infinality flag and it works. However, where is the configuration file "infinality.sh"?

----------

## PaulBredbury

LFS have updated the cairo patch for cairo 1.12.4, to work with firefox 16.0.1 compiled with --enable-system-cairo  :Smile: 

For cairo 1.12.4, there's also these 2 upstream patches to include - here's a patch file which includes them both.

Edit: cairo 1.12.6 is out, with bugfixes.Last edited by PaulBredbury on Mon Oct 22, 2012 10:44 pm; edited 1 time in total

----------

## yngwin

Thanks! I hope to find some time within the next few days to bump cairo and look into its open issues.

----------

## _______0

hey,

useiing open sauce radeon here and my fonts look like arse. With nvidia blobs fonts look beautiful outta box. With nouveau and open sauce radeon fonts look absolutely awfull. Why is that?

To illustrate the problem. htop on nvidia blob fonts are neatly compact, like with proper spacing. When I use nouveau or rad op sauce htop on urxvt characters are all spaced out making htop mad huge. I think is a combination of larger space between characters and characters themeselves taking more pixels.

Inconsolata used to look lovely with nvidia blob now with radeon I was forced to change it.

Also as I type now in the browser fonts have a bluish offset. This bluish offset is also present in urxvt.

Where to start troubleshooting this problem??? What are the commands I can try to get immediate results??

It's clearly seen on the character "m" on the terminal.

thx!!

Also, dunno whether has to do with fonts or what but before adding:

```

URxvt*depth: 32
```

my terminal was awfully slow, dmesg was like line per line and when compiling and having the terminal in fullscreen would bring my system down to halt. Now dmesg is instant. When I would list a folder with many files in colors moving the cursor on the terminal with arrows would be painfully slow and X cpu usage shoot thru the roof!! In general was any terminal activity that would slow down X, such as scrolling ncmpcpp songs list.

Now the only slow down I've experienced is when the terminal is filled with colored names and then I have to move the cursor on the promp, X cpu usage jumps to almos 50% usage. Scrolling ncmpcpp songs list with down/up arrows also result in 50% cpu usage.

UPDATE!!

```
Xft.autohint:               0

Xft.dpi:                    96

Xft.antialias:              1

#Xft.rgba:                   rgb

Xft.hinting:                true

Xft.hintstyle:              hintslight

Xft.lcdfilter:              lcddefault

```

now trying with commented line.

```
#Xft.rgba:                   rgb
```

But that still isn't related with the bluish offset on the browser :/

Anybody know how to find out my subpixel RGB structure??

----------

## _______0

..Last edited by _______0 on Tue Oct 16, 2012 2:36 am; edited 2 times in total

----------

## PaulBredbury

 *

----------

## _______0

 *PaulBredbury wrote:*   

> 
> 
> Probably your DPI (dots per inch) setting was correct with the Nvidia blob, and wrong with Radeon - Google it.

 

good call. but google what exactly???

thnx in advanced.

----------

## PaulBredbury

I notice that Gentoo and Arch both compile cairo with  --disable-xlib-xcb, due to mysterious crashing in Gnome.

In cairo 1.12.4, 1.12.6 and current git, I get occasional font corruption on a line of text, which usually makes the font look slightly bolder (appears often on this page), but it's fixed if I instead compile with --enable-xlib-xcb  :Smile: 

Edit: LFS' cairo-1.12.4-expose_snapshot-1.patch still works with cairo 1.12.6 and current git.

Edit2: Bah, my solution slows down firefox's rendering, so I'll stick with cairo 1.12.2 for now, as with Debian and Ubuntu.

Edit3: Firefox's rendering seems better (no slowdown), with cairo git upto this commit.

Edit4: Nah, still got occasional font corruption with cairo git - I'll stick with cairo 1.12.2

Edit5: cairo 1.12.10 has same problem, so I'm still sticking with cairo 1.12.2

Edit6: Hooray, finally fixed, I think by firefox 21  :Very Happy: 

Edit7: This is using cairo from git, rather than cairo 1.12.14. I tried cairo 1.12.14 briefly, and it seemed to have a bit of text corruption, whereas a git checkout has been perfect.

----------

## _______0

google what???

 :Question: 

----------

## _______0

damn! too many steps to get fonts right :/

basically all is controlled via these two??

```
eselect infinality

eselect lcdfilter
```

how do changes take effect?

what do you reccomend for 1080p monitor?

thanks

----------

## Hypnos

 *_______0 wrote:*   

> what do you reccomend for 1080p monitor?

 

I like the eselect settings:

infinality = linux

lcdfilter = infinality

But, most people use:

infinality = infinality

lcdfilter = infinality

----------

## PaulBredbury

Infinality has a 2013-01-04 release, based on freetype 2.4.11 - seems good, as initial impression  :Smile: 

I didn't notice a difference to the parameters in infinality-settings.sh

The patches keep coming in freetype git also.

----------

## _______0

hat's off!! great job infinality, your work has decreased my glasses prescription.

This guy singlehandedly fix the state of fonts in linux?? Now radeon is able to render fonts same as nvidia blobz oO

I had another question what are the tools to make a font?? I know inkscape has an option for crafting fonts, but I missing the step where it converts to ttf, otf, bitmap, etc.

----------

## alexcortes

Hello,

I don't know if it is expected (or I did something wrong) but i get this warnings when I run fc-cache:

```
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.

Fontconfig warning: "/etc/fonts/infinality/conf.d/41-repl-os-linux.conf", line 16: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/41-repl-os-linux.conf", line 29: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/41-repl-os-linux.conf", line 39: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/41-repl-os-linux.conf", line 48: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/41-repl-os-linux.conf", line 60: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/41-repl-os-linux.conf", line 71: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/41-repl-os-linux.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/41-repl-os-linux.conf", line 92: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/60-group-non-tt-fonts.conf", line 483: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/60-group-tt-fonts.conf", line 262: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/62-tt-monospace-rendering.conf", line 27: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/62-tt-traced-bitmap-rendering.conf", line 21: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/62-tt-traced-bitmap-rendering.conf", line 50: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/80-selective-rendering-inf-win-lin.conf", line 16: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/80-selective-rendering-inf-win-lin.conf", line 31: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/80-selective-rendering-inf-win-lin.conf", line 102: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/80-selective-rendering-inf-win-lin.conf", line 119: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/80-selective-rendering-inf-win-lin.conf", line 138: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/infinality/conf.d/80-selective-rendering-inf-win-lin.conf", line 158: Having multiple values in <test> isn't supported and may not work as expected

Fontconfig warning: "/etc/fonts/conf.d/59-google-droid-sans.conf", line 61: Having multiple values in <test> isn't supported and may not work as expected
```

```
Available fontconfig .conf files (* is enabled):

  [1]   10-autohint.conf *

  [2]   10-no-sub-pixel.conf

  [3]   10-sub-pixel-bgr.conf

  [4]   10-sub-pixel-rgb.conf *

  [5]   10-sub-pixel-vbgr.conf

  [6]   10-sub-pixel-vrgb.conf

  [7]   10-unhinted.conf

  [8]   11-lcdfilter-default.conf *

  [9]   11-lcdfilter-legacy.conf

  [10]  11-lcdfilter-light.conf

  [11]  20-unhint-small-dejavu-sans-mono.conf *

  [12]  20-unhint-small-dejavu-sans.conf *

  [13]  20-unhint-small-dejavu-serif.conf *

  [14]  20-unhint-small-vera.conf *

  [15]  25-unhint-nonlatin.conf

  [16]  30-metric-aliases.conf *

  [17]  30-urw-aliases.conf *

  [18]  40-nonlatin.conf *

  [19]  45-latin.conf *

  [20]  49-sansserif.conf *

  [21]  50-user.conf *

  [22]  51-local.conf *

  [23]  52-infinality.conf *

  [24]  57-dejavu-sans-mono.conf

  [25]  57-dejavu-sans.conf

  [26]  57-dejavu-serif.conf

  [27]  59-google-droid-sans-mono.conf *

  [28]  59-google-droid-sans.conf *

  [29]  59-google-droid-serif.conf *

  [30]  60-latin.conf *

  [31]  60-liberation.conf *

  [32]  62-croscore-arimo.conf

  [33]  62-croscore-cousine.conf

  [34]  62-croscore-symbolneu.conf

  [35]  62-croscore-tinos.conf

  [36]  63-source-pro.conf *

  [37]  65-fonts-persian.conf

  [38]  65-khmer.conf

  [39]  65-nonlatin.conf *

  [40]  69-unifont.conf *

  [41]  70-no-bitmaps.conf *

  [42]  70-yes-bitmaps.conf

  [43]  80-delicious.conf *

  [44]  90-synthetic.conf *

  [45]  99pdftoopvp.conf
```

@Hypnos, very nice indeed:

 *Quote:*   

> I like the eselect settings:
> 
> infinality = linux
> 
> lcdfilter = infinality

 

Thanks!!!   :Smile: 

----------

## poncho

media-libs/fontconfig-infinality needs a version bump to work with media-libs/fontconfig-2.10.2

see http://www.infinality.net/forum/viewtopic.php?f=2&t=79

and https://github.com/Infinality/fontconfig-infinality/blob/master/infinality/CHANGELOG

edit:

and this https://bugs.gentoo.org/show_bug.cgi?id=456652Last edited by poncho on Sun Feb 10, 2013 11:29 pm; edited 1 time in total

----------

## alexcortes

 *poncho wrote:*   

> media-libs/fontconfig-infinality needs a version bump to work with media-libs/fontconfig-2.10.2
> 
> see http://www.infinality.net/forum/viewtopic.php?f=2&t=79
> 
> and https://github.com/Infinality/fontconfig-infinality/blob/master/infinality/CHANGELOG

 

Thanks!   :Laughing: 

----------

## wvmmhxkh

Sooo, it's been what, half a year since infinality ebuild have been updated? The strange thing, to me, is that git repo seems fairly maintained and not abandoned at all. Seeing how old versions have some annoying bugs should we switch to overlay?

----------

## Heimfrost

I have the problem, that with fontconfig-2.9 and greater from lcd-filtering overlay or gentoo, "Webdings" font in my .conkyrc isn't displayed any longer. Has anyone the same problem or a solution?

----------

## PaulBredbury

A bit of debugging:

```
$ fc-match Webdings

webdings.ttf: "Webdings" "Normal"

pango-view --font "Webdings 10" --dpi 96 --text "the quick brown fox jumps over the lazy dog. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG."
```

Works fine for me, with fontconfig 2.10.2

----------

## Heimfrost

With fontconfig <2.9:

```
fc-match Webdings

webdings.ttf: "Webdings" "Regular"
```

pango-view shows me the correct Webdings symbols of "the quick brown fox jumps over the lazy dog. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG."

with fontconfig =2.9.0::lcd-filtering:

```
fc-match Webdings

webdings.ttf: "Webdings" "Normal"
```

pango-view shows me "the quick brown fox jumps over the lazy dog. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG." with no Webding font symbols

----------

## PaulBredbury

Sounds like bug in fontconfig 2.9

So, try 2.10.2

----------

## Heimfrost

Same with 2.10.2.

----------

## AustinMatherne

I just finished reading both this entire thread, and the previous one dating back to 2006.

Firstly, I'd like to thank Infinality, PaulBredbury, bi3l, yngwin, and the many others that have helped us get to where we are today.

Now, what I'd like to do is summarize the current state of affairs, clear up any misconceptions I might still have, and then stick it all in this post so others can more easily improve and customize their fonts by simply following a how-to. If anyone would like to add and/or modify anything below, please let me know.

Initial Setup:

Enable the infinality use flag on freetype so it will bring in the patches and eselect-infinality and fontconfig-infinality packages.

```

echo "media-libs/freetype infinality -bindist" >> /etc/portage/package.use

```

Emerge freetype with the new use flags applied.

```

emerge -av --oneshot media-libs/freetype

```

Set your preferred styling. Use the list functionality in eselect to see what options are available other than infinality, such as linux, osx, win7, etc. Style descriptions are in /etc/fonts/infinality/infinality.conf.

```

eselect infinality set infinality

eselect lcdfilter set infinality

```

Enable the infinality fonts configuration.

```

eselect fontconfig enable 52-infinality.conf

```

Extra Credit:

Put the DPI value of your display in /etc/fonts/infinality/infinality.conf using this tool (PPI == DPI) to calculate the DPI of your display. Override the generic value of 75 set by infinality.

```

...

<match target="pattern">

  <edit name="dpi" mode="assign">

    <double>75</double>

  </edit>

</match>

...

```

Setup .Xresources for applications that still use libXft. Use the tool above to claculate your display's DPI and this tool to figure out the correct rgba setting for your display (which will most likely be "rgb").

```

echo "Xft.dpi: 75" >> ~/.Xresources

echo "Xft.autohint: 0" >> ~/.Xresources

echo "Xft.lcdfilter: lcddefault" >> ~/.Xresources

echo "Xft.hintstyle: hintfull" >> ~/.Xresources

echo "Xft.hinting: 1" >> ~/.Xresources

echo "Xft.antialias: 1" >> ~/.Xresources

echo "Xft.rgba: rgb" >> ~/.Xresources

```

Things To Watch Out For:

If you are running a Desktop Environment (KDE, Gnome, etc) it may be writing settings in ~/.fonts.conf or ~/.fonts.conf.d/. You can prevent these files from being read by running:

```

eselect fontconfig disable 50-user.conf

```

Setting an incorrect DPI or rgba value can make your fonts look weird. Make sure you set them to their correct values.Last edited by AustinMatherne on Sat Mar 16, 2013 8:15 am; edited 2 times in total

----------

## AustinMatherne

Something I'm not sure about yet. Does enabling configuration files such as 10-autohint.conf interfere with infinality? My understanding is that it should, since it applies autohinting to all fonts, while infinality intelligently only targets certain fonts? If that's correct, then eselect fontconfig should only be used to enable 52-infinality, while everything else should be left alone?

----------

## PaulBredbury

 *AustinMatherne wrote:*   

> interfere with infinality?

 

Look at the numbers in the filenames - that's the precedence order.

Personally, my /etc/fonts/local.conf has this near the top:

```
    <match>

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

        <edit mode="assign" name="autohint"><bool>true</bool></edit>

        <edit mode="assign" name="hintstyle"><const>hintslight</const></edit>

        <edit mode="assign" name="hinting"><bool>true</bool></edit>

        <edit mode="assign" name="antialias"><bool>true</bool></edit>

        <edit mode="assign" name="lcdfilter"><const>lcddefault</const></edit>

    </match>
```

I don't even have 10-autohint.conf, but of course, it would be overruled by the above.

----------

## poncho

 *AustinMatherne wrote:*   

> Setup .Xresources for applications that still use libXft. Use the tool above to claculate your display's DPI and this tool to figure out the correct rgba setting for your display (which will most likely be "rgb").
> 
> ```
> 
> echo "Xft.dpi: 75" >> ~/.Xresources
> ...

 

fontconfig-infinality installs /etc/X11/Xresources. I don't think ~/.Xresources is necessary.

 *AustinMatherne wrote:*   

> If anyone would like to add and/or modify anything below, please let me know.

 

We could make a page on wiki.gentoo.org.  I moved your post to my sandbox.

You can have a look/edit here: https://wiki.gentoo.org/wiki/User:Poncho/Sandbox

----------

## AustinMatherne

 *PaulBredbury wrote:*   

> Look at the numbers in the filenames - that's the precedence order.

 

That's what I thought; however, if I put a DPI rule in /etc/fonts/local.conf with 51-local.conf enabled by eselect, it doesn't take effect. I have to overwrite the DPI value in /etc/fonts/infinality/infinality.conf for it to do anything. Do you know if the infinality config is doing something special that's preventing local.conf from taking precedence? Just to make sure I'm not doing something completely stupid, this is my /etc/fonts/local.conf file.

```
<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

<match target="pattern">

  <edit name="dpi" mode="assign">

    <double>108.79</double>

  </edit>

</match>

</fontconfig>
```

 *poncho wrote:*   

> fontconfig-infinality installs /etc/X11/Xresources. I don't think ~/.Xresources is necessary.

 

Thanks, and good catch. It would still appear to me that ~/.Xresources should be set with the users correct DPI setting, along with the rbga value if it isn't rgb.

Edit:

PaulBredbury, did you mean that the file name 20-* takes precedence over 10-*? That would contradict what I've read elsewhere, but it would explain my inability to set DPI in local.conf.

----------

## PaulBredbury

 *AustinMatherne wrote:*   

> file name 20-* takes precedence over 10-*?

 

Yes. Which is the same as in Udev.

conf.d/README in fontconfig-2.10.2.tar.bz2 says:

```
The files are loaded in numeric order, the structure of the configuration

has led to the following conventions in usage:

 Files begining with:   Contain:

 

 00 through 09      Font directories

 10 through 19      system rendering defaults (AA, etc)

 20 through 29      font rendering options

 30 through 39      family substitution

 40 through 49      generic identification, map family->generic

 50 through 59      alternate config file loading

 60 through 69      generic aliases, map generic->family

 70 through 79      select font (adjust which fonts are available)

 80 through 89      match target="scan" (modify scanned patterns)

 90 through 99      font synthesis
```

Easy evidence is this test file:

```
<?xml version='1.0'?>

<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>

<fontconfig>

   <match>

      <edit mode="assign" name="antialias"><bool>false</bool></edit>

   </match>

   

</fontconfig>
```

As /etc/fonts/conf.d/91-test.conf , fonts become ugly as expected, but as 11-test.conf, the rule is overriden by /etc/fonts/local.conf (via 51-local.conf)  :Smile: 

I've corrected the Arch wiki.

----------

## AustinMatherne

Thanks, that clears up quite a bit. Since 52-infinality is going to take precedence over both 50-user and 51-local, what do you think would be the best way to change the DPI setting? As I see it, there are three options.

1. Modify /etc/fonts/infinality/infinality.conf directly. This seems like a bad idea for maintainability.

2. Move 51-local.conf to 53.local.conf, allowing it to override infinality. I don't particularly like this option either, since 51-local may be reintroduced by whichever package is responsible for creating it, and if two files both import the same thing, the second import is ignored (in this case, 53-local.conf).

3. Create an entirely new file, say /etc/fonts/infinality-override.conf and import it with another new file, 53-infinality-override.conf. I don't like introducing my own files into /etc, but I think this option is the least likely to break.

Thoughts?

----------

## PaulBredbury

DPI is strange, and I wouldn't change it, unless it's obviously wrong.

Roughly, I think the precedence order should probably be:

Infinality

system ("local")

user

So then DPI would be set, if appropriate to be set, in system ("local").

Which contradicts the current fontconfig defaults of 50-user.conf and 51-local.conf  :Sad: 

Fontconfig's DPI setting is just one value, whereas in xorg.conf it's x & y. Which kinda shows that it's a bit of a joke calculation - but it can affect font appearance.

----------

## AustinMatherne

Interesting. Turns out DPI is a lot more complicated than I thought. It appears that the users correct DPI needs to be either detected by Xorg or manually set in it's configuration. But fontconfig is better off using a standard DPI of 96 (or 72 in some cases), because some applications expect it to be one of those and scale accordingly.

Given that infinality sets sane defaults depending on the user's selected styling (infinality, linux, OSX, OSX2, win7, winxp, win98) for rgba, autohint, hitstyle, hinting, antialias, and lcdfilter, unless the user has a good reason, it doesn't appear that anything should be changed beyond enabling infinality and selecting a styling. The README indicates as much.

 *Quote:*   

> The local.conf is now obsolete and completely replaced by this configuration.

 

So what about configuration files that are installed for specific fonts? Let's take the DejaVu fonts as an example, they install the files below. Should they be enabled, or do they interfere with infinality in some way?

From what I can tell, the 20-*s are probably a good idea, but the 50-*s will override the order of preferred fonts set by infinality. So I should stick something in the wiki explaining the option and why the user might want to enable them.

20-unhint-small-dejavu-sans-mono.conf

20-unhint-small-dejavu-sans.conf

20-unhint-small-dejavu-serif.conf

57-dejavu-sans-mono.conf

57-dejavu-sans.conf

57-dejavu-serif.conf

----------

## PaulBredbury

 *AustinMatherne wrote:*   

> fontconfig is better off using a standard DPI

 

No, that's the wrong conclusion. People have widescreen monitors these days, e.g. mine has DPI 131x119 - let's not add distortion by assuming for the old-style sake of simplicity that a rectangle is a square  :Wink:   The font-rendering calculations probably should be a bit smarter.

The filename numbering is a bit of a mess. The default fontconfig rules are assuming default-style freetype rendering, rather than the superior Infinality rendering, so they may not even be appropriate. In which case, having 50-base-rendering.conf, rather than 10-base-rendering.conf, sensibly overrules e.g. 20-unhint-small-vera.conf   :Laughing: 

----------

## AustinMatherne

 *PaulBredbury wrote:*   

> No, that's the wrong conclusion. People have widescreen monitors these days, e.g. mine has DPI 131x119 - let's not add distortion by assuming for the old-style sake of simplicity that a rectangle is a square   The font-rendering calculations probably should be a bit smarter.

 

So I shouldn't use the default DPI in infinality.conf, nor should I overwrite it. Am I correct in assuming that means the DPI should not be set in fontconfig at all and simply left to Xorg to figure out? If that's the case, the DPI rule in infinality.conf should be deleted.

 *PaulBredbury wrote:*   

> In which case, having 50-base-rendering.conf, rather than 10-base-rendering.conf, sensibly overrules e.g. 20-unhint-small-vera.conf  

 

I can't test this until later because I'm not in front of my computer. Are you saying that a file numbered 20-* will be overridden by a file numbered 50-* from another directory which is read from an include statement in a file numbered 52-*?

Thanks again. I really do appreciate you taking the time to answer my questions.

----------

## PaulBredbury

 *AustinMatherne wrote:*   

> simply left to Xorg to figure out?

 

Yes. Unless Xorg gets it wrong, which can happen if it can't read the EDID.

 *Quote:*   

> will be overridden

 

Depends what the rules are. If 50-blah says set hinting (a single variable) unconditionally to true, it doesn't matter what 20-blah sets hinting to.

Unless 30-blah tests the value of hinting and sets some other variable from it - but that would be weird  :Wink: 

----------

## AustinMatherne

 *PaulBredbury wrote:*   

> Yes. Unless Xorg gets it wrong, which can happen if it can't read the EDID.

 

Unfortunately, I know all too well about corrupt EDID. I'll stick something in the wiki about testing and setting the correct display dimensions in xorg.conf.d/. I'm assuming this applies to Xresources, as well? Or are there legacy issues that would result in treating Xresources differently than fontconfig?

----------

## PaulBredbury

Nightmorph's blog post (edit: No proper URL anymore) is depressingly simplistic, but it does highlight again that even devs recoil in horror from the XML nighmare that is fontconfig configuration  :Sad: 

So, as KISS examples, here is what I use:  /etc/fonts/local.conf and /etc/env.d/infinality-settings.sh

For Arch Linux, use bohoomil's configuration and free fonts.Last edited by PaulBredbury on Sun Mar 16, 2014 9:50 am; edited 2 times in total

----------

## papu

i am configuring this stuff :

without infinality: http://i.minus.com/ibca2AMAW8WZ0V.png

with infinality there are a glitch: http://i.minus.com/iwORHnzKCAoGv.png

configuration:

eselect fontconfig list 

```
Available fontconfig .conf files (* is enabled):

  [1]   10-autohint.conf

  [2]   10-no-sub-pixel.conf

  [3]   10-sub-pixel-bgr.conf

  [4]   10-sub-pixel-rgb.conf *

  [5]   10-sub-pixel-vbgr.conf

  [6]   10-sub-pixel-vrgb.conf

  [7]   10-unhinted.conf

  [8]   11-lcdfilter-default.conf *

  [9]   11-lcdfilter-legacy.conf

  [10]  11-lcdfilter-light.conf

  [11]  20-unhint-small-vera.conf *

  [12]  25-unhint-nonlatin.conf

  [13]  30-metric-aliases.conf *

  [14]  30-urw-aliases.conf *

  [15]  40-nonlatin.conf *

  [16]  45-latin.conf *

  [17]  49-sansserif.conf *

  [18]  50-user.conf *

  [19]  51-local.conf *

  [20]  52-infinality.conf *

  [21]  60-latin.conf *

  [22]  60-liberation.conf *

  [23]  62-croscore-arimo.conf

  [24]  62-croscore-cousine.conf

  [25]  62-croscore-symbolneu.conf

  [26]  62-croscore-tinos.conf

  [27]  65-fonts-persian.conf *

  [28]  65-khmer.conf

  [29]  65-nonlatin.conf *

  [30]  69-unifont.conf *

  [31]  70-no-bitmaps.conf

  [32]  70-yes-bitmaps.conf

  [33]  80-delicious.conf *

  [34]  90-synthetic.conf *

  [35]  99pdftoopvp.conf
```

eselect lcdfilter list

```
Available styles:

  [1]   custom

  [2]   default

  [3]   infinality *

  [4]   infinality-classic

  [5]   infinality-nudge

  [6]   infinality-push

  [7]   infinality-sharpened

  [8]   infinality-shove

  [9]   ipad

  [10]  linux

  [11]  nyx

  [12]  osx

  [13]  ubuntu

  [14]  vanilla

  [15]  windows-7

  [16]  windows-7-light

  [17]  windows-xp

  [18]  windows-xp-light

```

eselect infinality list 

```
Available styles:

  [1]   debug

  [2]   infinality *

  [3]   linux

  [4]   nyx

  [5]   osx

  [6]   osx2

  [7]   win7

  [8]   win98

  [9]   winxp
```

emerge --info

thanks you  :Smile: 

----------

## comprookie2000

Post the output;

```

 # locale

LANG=en_US.UTF-8

LC_CTYPE="en_US.UTF-8"

LC_NUMERIC="en_US.UTF-8"

LC_TIME="en_US.UTF-8"

LC_COLLATE="en_US.UTF-8"

LC_MONETARY="en_US.UTF-8"

LC_MESSAGES="en_US.UTF-8"

LC_PAPER="en_US.UTF-8"

LC_NAME="en_US.UTF-8"

LC_ADDRESS="en_US.UTF-8"

LC_TELEPHONE="en_US.UTF-8"

LC_MEASUREMENT="en_US.UTF-8"

LC_IDENTIFICATION="en_US.UTF-8"

LC_ALL=

```

```

 # cat /etc/env.d/02locale

LANG="en_US.UTF-8"

```

----------

## papu

~ $ locale

```

LANG=ca_ES.utf8

LC_CTYPE="ca_ES.utf8"

LC_NUMERIC="ca_ES.utf8"

LC_TIME="ca_ES.utf8"

LC_COLLATE=POSIX

LC_MONETARY="ca_ES.utf8"

LC_MESSAGES="ca_ES.utf8"

LC_PAPER="ca_ES.utf8"

LC_NAME="ca_ES.utf8"

LC_ADDRESS="ca_ES.utf8"

LC_TELEPHONE="ca_ES.utf8"

LC_MEASUREMENT="ca_ES.utf8"

LC_IDENTIFICATION="ca_ES.utf8"

LC_ALL=
```

~ $ cat /etc/env.d/02locale 

```

# Configuration file for eselect

# This file has been automatically generated.

LANG="ca_ES.utf8"
```

~ $ eselect locale list

```

Available targets for the LANG variable:

  [1]   C

  [2]   POSIX

  [3]   ca_ES.utf8 *

  [4]   en_US.utf8

  [ ]   (free form)
```

thanks,   :Razz: 

----------

## Kiwon Um

 *Ant P. wrote:*   

> Looks interesting. I have two serious problems after installing though:
> 
> .pfb fonts no longer work at all.
> 
> urxvt is now completely unreadable (and it's even worse than in those old screenshots) because these patches require libXft >= 2.3.
> ...

 

For using the pfb fonts, comment the "Type 1" configuration part in the infinality.conf file.

----------

## _______0

what's the best Monitor settings? My monitor has different modes

user

movie

text

photo

sRGB

which one would help for better font looking?

thanks

----------

## PaulBredbury

For freetype 2.4.12, here's the patches that are working well for me:

freetype-2.4.12-git20130513.patch   - made by me, to add some post-2.4.12 fixes from git

freetype-2.4.12-pkgconfig.patch   - from Fedora

freetype-entire-infinality-patchset-20130514-01.patch   - from Infinality

freetype-2.4.12-20130612-fixes.patch  - more git fixes

----------

## shad0w_GR

Hello, i am using infinality patches with the following selections: 

infinality: linux

lcdfilter: infinality

I have errors with cups - "Filters failed". Also i have a problem with ps2pdf, 

```
ps2pdf cdemu.ps cdemu.pdf

Error: /invalidfont in /findfont

Operand stack:

   Times-Italic@0   --nostringval--   Times-Italic

Execution stack:

   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1836   3   4   %oparray_pop

Dictionary stack:

   --dict:1169/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--   --dict:59/120(L)--

Current allocation mode is local

Last OS error: No such file or directory

Current file position is 5696

GPL Ghostscript 9.06: Unrecoverable error, exit code 1

```

Without infinality i dont have any problem, but rendering sucks. Anyone with the same issue?

Edited: I found a way to solve this, allowing Type1 fonts, which are disabled by default in infinality.conf.

I found this suggestion here.

----------

## PaulBredbury

 *shad0w_GR wrote:*   

> Type1 fonts, which are disabled by default in infinality.conf.

 

I suggest you report that on the Gentoo bugzilla. Disabling Postscript fonts sounds too extreme to be the default, and probably too extreme to be even a USE-flag option.

Edit: Here's the bug report.

----------

## toofy

sorry to resurrect an old thread, but im curious if any of you have successfully installed freetype 2.5 yet? apparently the new engine was created by adobe and google and is super sexy. i want to give it a shot, but i have no clue how to create ebuilds yet and was curious if any of you have got it up and running.

t

----------

## PaulBredbury

 *toofy wrote:*   

> freetype 2.5

 

See thread for Infinality patch.

The interest in Adobe's CFF is surprisingly low, since we already have Infinality, and they currently can't be used together, and Adobe's CFF only improves OpenType fonts.

----------

## ^marcs

Hello,

I'm having a problem with infinality patches, maybe indirectly. When I'm drawing a white text (other color but black will trigger this too) on a transparent background, some border pixel, that normaly have some alpha due to antialiasing, are having a weired colors. When I disable infinality rules in fontconfig (eselect fontconfig) all is working as expected.

Here is an example, upper text is painted while infinality was turned on, and lower while its turned off. (recommended to view this in picture browser that clearly shows transparent areas)

https://dl.dropboxusercontent.com/u/6883398/both.png

Easy way to reproduce:

1. create new image in GIMP with background set as "Transparent".

2. pick Text tool, select white color and draw some text over the picture.

Anyone else have this?

----------

## poncho

 *^marcs wrote:*   

> Anyone else have this?

 

The report about this issue at infinality.net mentions some workaround:

Font rendering Gimp 2.8

----------

## ^marcs

Thanks for link poncho.

I have removed suggested fragment from the fontconfig conf file - that fixed it all right, but pretty much ruined whole configuration in the process. 

At least I know someone is aware of this problem. 

I think I'll drop infinality patches for now and try to get vanilla configuration info usable state.

----------

## dannymichel

I've been fiddling with the Infinality setting for quite some time.

No matter what I do, the fonts render square.

Can I please pay someone to make Helvetica look exactly like this?

[IMG]http://i.imgur.com/u44Nk5Q.png[/IMG]

----------

## PaulBredbury

 *dannymichel wrote:*   

> fonts render square.

 

I would recompile in the correct order:  freetype pixman harfbuzz fontconfig cairo pango

bohoomil has some great (Arch Linux) threads, for font libs and free good-looking fonts.

freetype is continually being improved, so I'm using a git checkout with these patches:

infinality-2.5.patch (from bohoomil's repo)

freetype-2.4.12-pkgconfig.patch

----------

## dannymichel

 *PaulBredbury wrote:*   

>  *dannymichel wrote:*   fonts render square. 
> 
> I would recompile in the correct order:  freetype pixman harfbuzz fontconfig cairo pango
> 
> bohoomil has some great (Arch Linux) threads, for font libs and free good-looking fonts.
> ...

 I installed Infinality using apt-get.

----------

## MattM

It didn't take me too long to switch successfully over to using infinality despite my being finicky with fonts and already having a good setup which rendered fine via nvidia-

- eselect infinality set linux produces a much better result than set infinality

- disabling everything else in eselect fontconfig is OK and seems to be necessary to get the best rendering

- disabling the dpi and type1 in infinality.conf also helps

All the normal websites seem to render fine in firefox...only issue at the moment is that the default body text on some sites is slightly smaller than it was before. I guess I can just bump up minimum font size somewhere.

----------

## PaulBredbury

 *MattM wrote:*   

> disabling the dpi and type1 in infinality.conf also helps

 

Got an example? bohoomil reckons that type 1 fonts generally render better.

----------

## dannymichel

 *MattM wrote:*   

> It didn't take me too long to switch successfully over to using infinality despite my being finicky with fonts and already having a good setup which rendered fine via nvidia-
> 
> - eselect infinality set linux produces a much better result than set infinality
> 
> - disabling everything else in eselect fontconfig is OK and seems to be necessary to get the best rendering
> ...

 

I want to do what you did.

i can select Linux style by doing sudo bash /etc/fonts/infinality/infctl.sh setstyle

then i can disable everything by editing sudo -H gedit /etc/profile.d/infinality-settings.sh 

am i correct? How do I disable everything? using USE_STYLE="DISABLED"?

That still hints my fonts.

how do i "disabling the dpi and type1 in infinality.conf also helps"?

----------

