# [HOWTO]New freetype subpixel font rendering for lcd monitors

## boniek

Disclaimer:

I cannot be held responsible if any of this blows your system up. All of this is provided with best intentions from my side. All credit goes to Freetype team - thanks guys!

Link:

http://wiki.gentoo-xeffects.org/Font_Rendering <--currently offline

----------

## Fukai

Hi,

Can you post screenshot of the new spr (comparing it to the old)?

Thanks for the tip.

----------

## boniek

Sure thing. 85 dpi, subpixel aa, light hinting in both pictures:

old spr

new spr

85dpi, subpixel aa, full hinting:

new spr + bci - this rendering mode is superb

ct by ms windows (for comparision purposes, thanks to my friend marcin for providing me with this screenshot  :Very Happy:  ):

ms cleartype

All this makes sense only on lcd monitors so don't bother on crt. To enable bci disable bindist use flag on freetype.

----------

## PaulBredbury

Thanks, now my fonts look even nicer  :Very Happy: 

The nvidia drivers like to think that the DPI of my monitor is 95x96, which results in badly-formed fonts (some lines are too thin, some are too fat). I fix that by putting in xorg.conf, within Section "Monitor":

```
Option "DPI"   "96 x 96"
```

----------

## glowworm

Wow. Thanks alot for the overlay, the difference is phenomenal.

----------

## trinity

Yeah it's cool! Very nice!

I have another old pc with a Slackware distro and I'd like to apply this thing, but I really don't know how to do it. Can you give me some hints?

Thank!!

----------

## boniek

I'm sorry I'm gentoo zealot and I know nothing about slack  :Sad: 

Installing from source the old way (./configure, make, make install) should be easy though. Just read ebuilds and things should be pretty clear as how to do it.

----------

## PaulBredbury

 *trinity wrote:*   

> but I really don't know how to do it. Can you give me some hints?

 

Can U be any more vague as to what you've tried, how they worked, what situation you're at, and what you're capable of figuring out for yourself?

----------

## boniek

My overlay is now a part of xeffects overlay.

```
emerge -av layman && layman -ka xeffects
```

to get all files you need for this howto.

----------

## H3g3m0n

Just checking if this is correct, did i miss any steps, i can't see the actually guide I'm guessing the most of it was removed when it was merged into xeffects?

```

layman -a xeffects

euse --enable newspr

echo "media-libs/freetype ~amd64" >> /etc/portage/packages.keywords

echo "media-libs/fontconfig ~amd64" >> /etc/portage/packages.keywords

echo "media-libs/freetype" >> /etc/portage/packages.unmask

emerge -va freetype fontconfig libXft cairo

```

Does anyone know the best options for the /etc/font.conf file? I'm just using the lcd example in http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts but that guide doesn't seem to reliable.

For starters it says to disable the bindist flag to enable the bytecode which seems wrong to me, I would change it but im not 100% sure (Although i did check the ebuild). Also my fonts have a yellow halo around them after following the guide (also green, purple and blue depending on the size) but i think thats the old sub pixel rendering screwing up (changing from RGB mode seemed to help) hopefully the new SPR will fix my problems.Last edited by H3g3m0n on Fri Nov 03, 2006 12:28 pm; edited 1 time in total

----------

## PaulBredbury

 *H3g3m0n wrote:*   

> it says to disable the bindist flag to enable the bytecode which seems wrong to me

 

It is correct. No normal user would have "bindist" set anyway. Its purpose is to lessen the potential of being sued by SCO wannabees.

```
grep bindist /usr/portage/profiles/use.*

/usr/portage/profiles/use.desc:bindist - Flag to enable or disable options for prebuilt (GRP)  packages (eg. due to licensing issues)
```

----------

## boniek

Yes wiki is right. I have corrected my ebuilds in overlay and updated howto above. Now to get bci you have to disable bindist. Sorry for the confusion.

----------

## neuron

 *H3g3m0n wrote:*   

> Just checking if this is correct, did i miss any steps, i can't see the actually guide I'm guessing the most of it was removed when it was merged into xeffects?
> 
> ```
> 
> layman -a xeffects
> ...

 

it's package.keywords and package.unmask, not packages  :Wink: 

 *PaulBredbury wrote:*   

>  *H3g3m0n wrote:*   it says to disable the bindist flag to enable the bytecode which seems wrong to me 
> 
> It is correct. No normal user would have "bindist" set anyway. Its purpose is to lessen the potential of being sued by SCO wannabees.
> 
> ```
> ...

 

and the default is having it off, set bindist and let the patent trouble begin  :Smile: . *I'm wrong here, if your reading this thread, ignore me  :Razz: *Last edited by neuron on Fri Nov 03, 2006 5:43 pm; edited 1 time in total

----------

## PaulBredbury

Let's be clear on what bindist does, and whether it should be off or on  :Wink: 

In /usr/portage/media-libs/freetype/freetype-2.2.1.ebuild

```
# disable BCI when distributing binaries (patent issues)

use bindist || epatch "${FILESDIR}"/${PN}-2-enable_bci.patch
```

English translation: Enable BCI ("bytecode interpreter") if bindist is unset.

This means that BCI is disabled on the LiveCD (which contains pre-compiled binaries), because BCI has potential patent issues.

As the opposite, we as users have bindist unset, because we want BCI on because it's good stuff, so that we can compile it in ourselves.

Clarification: "unset" and "not set" mean exactly the same thing.Last edited by PaulBredbury on Fri Nov 03, 2006 5:36 pm; edited 1 time in total

----------

## boniek

 *PaulBredbury wrote:*   

> Let's be clear on what bindist does, and whether it should be off or on 
> 
> In /usr/portage/media-libs/freetype/freetype-2.2.1.ebuild
> 
> ```
> ...

 

Yup. He is right. This applies (starting today) to this overlay too   :Cool: 

----------

## neuron

 *PaulBredbury wrote:*   

> Let's be clear on what bindist does, and whether it should be off or on 
> 
> In /usr/portage/media-libs/freetype/freetype-2.2.1.ebuild
> 
> ```
> ...

 

Thanks for clearing that up, as license trouble = usually defaults to off  :Wink: 

----------

## neuron

hm, when changing font config in gnome 2.16 I dont get a .fontconfig directory, nor does it create a ~/.fonts.conf like previus versions did.  And I can see noticable differences when changing the options in gnome terminal, and other gnome apps, but not in x-chat and firefox.

Anyone know what the "correct" way of doing this is?  I'm thinking of just making my own fonts.conf like I had before and removing the gnome settings, don't know where they are stored now though :/ (gconf maybe?)

// it's in /desktop/gnome/font_rendering

----------

## Bloodsurfer

Thanks for this howto, it's very nice and works like a charm.

I didn't know fonts can look this good  :Very Happy: 

----------

## Crono81

I think that this method creates a problem with the bold fonts. They appear TOO bold.

Just check the "WEB" link at the top of your Yahoo screenshots (compare with the Windows one), or check the "Web" word on the homepage of Google.

----------

## PaulBredbury

To fix bold fonts, add to ~/.fonts.conf e.g.:

```
   <match target="font">

      <test name="weight" compare="more"><const>medium</const></test>

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

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

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

   </match>
```

----------

## Crono81

That helps out a bit but i don't think it's an antialias problem: if i totally remove antialias, hinting, ecc... i still see bold fonts too bold. I think it's a rendering or font (Tahoma) problem. Do you know a way to reduce the... bolding effect? Something like a match, test on the bold fonts, and make them not-so-bold instead of bold   :Laughing: 

The fact is that i can't remember how the fonts were before. Probably they were so ugly that i didn't notice it, but there must be a way to reduce the bolding effect.

----------

## bssteph

I just wanted to pipe in and say that this is really snazzy. Thanks!

----------

## nosebleed

Gah, maybe I'm doing something wrong, but these fonts actually look WORSE than the ones I was using with freetype 2.2.1 and the patches I pulled off of bugs.gentoo.org...

----------

## boniek

Screenshots? If your fonts don't look as good as in "after" screenshot then obviously you did something wrong   :Wink:  . If they look exactly the same then use what YOU like best. I'm not saying my overlay will satisfy everyone - I did it because I liked the effect and tought some people might like it too. Patches from gentoo's bugzilla and mine are very likely to come from exactly the same source so I don't think this is the problem.

----------

## Crono81

no other ways to fix the bold fonts? They are not supposed to look that way, and it's not an antialias problem :\ In fact, if you disable AA they look even bolder   :Confused: 

----------

## boniek

I have submitted bug here: http://savannah.nongnu.org/bugs/index.php?18374

We will se what happens next  :Wink: 

----------

## nosebleed

 *boniek wrote:*   

> Screenshots? If your fonts don't look as good as in "after" screenshot then obviously you did something wrong   . If they look exactly the same then use what YOU like best. I'm not saying my overlay will satisfy everyone - I did it because I liked the effect and tought some people might like it too. Patches from gentoo's bugzilla and mine are very likely to come from exactly the same source so I don't think this is the problem.

 

http://nosebleed.info/etc/screens/spr-screen.jpg -- maybe it is just a matter or personal taste... I'm also using autohinting here, and your after screen looked exactly like the sub-pixel rendering with autohinting DISABLED. However, even when I enabled autohinting on the xeffects builds, the fonts didn't look as good as mine do (i.e. check out some of the fonts, and the e for Bitstream Vera Sans at 10pt 96dpi)

----------

## boniek

Set everything like in point 5 of the guide and rm -rf ~/.fontconfig/

Maybe try to run firefox with: MOZ_DISABLE_PANGO=1 firefox (I don't think disabling pango will help, but it will not hurt to try  :Wink:  )

Your fonts as provided in screenshot looks definetly different from my after screenshot and to me they look a lot worse ( e.g. check Autos link on the left - to me its almost not readable  :Wink:  ).

----------

## nosebleed

 *boniek wrote:*   

> Set everything like in point 5 of the guide and rm -rf ~/.fontconfig/
> 
> Maybe try to run firefox with: MOZ_DISABLE_PANGO=1 firefox (I don't think disabling pango will help, but it will not hurt to try  )
> 
> Your fonts as provided in screenshot looks definetly different from my after screenshot and to me they look a lot worse ( e.g. check Autos link on the left - to me its almost not readable  ).

 

Well, it's not just firefox, everything looks the same in every app. Also, my fonts get those annoying red marks around them in spr mode... which I can't stand. With the version I'm using they appear rarely, if at all...

And "Autos" probably looks like that because I don't have autohinting disabled for bold fonts, but it looks fine to ME. What do you think of the non-bolded fonts? Anyway, like I said, it's just a matter of taste, I guess.

EDIT: Here's a screenshot with autohinting disabled for bold fonts: http://nosebleed.info/etc/spr-screen2.png

----------

## boniek

Yes, you should stick with what your eyes are telling you is the best. YMMV  :Wink: 

Non-bold fonts have too much grey/blue/whatever fringing to my taste. It is strange that you actually had to disable autohinting to get identical bold fonts as I have and you mention red artifacts... none of this is present in my setup so if you followed steps exactly as they are written, there is not much I can do to help you. And if you like your current config then there is no need to help at all. Just enjoy it  :Wink: 

As for latest news concerning ebuild starting from 26.11.2006 snapshot there is new use flag called demos. It installs testing programs from ft2demos when enabled.

----------

## AaronPPC

My fonts look great!  Thanks boniek!

----------

## nosebleed

 *boniek wrote:*   

> Yes, you should stick with what your eyes are telling you is the best. YMMV 
> 
> Non-bold fonts have too much grey/blue/whatever fringing to my taste. It is strange that you actually had to disable autohinting to get identical bold fonts as I have and you mention red artifacts... none of this is present in my setup so if you followed steps exactly as they are written, there is not much I can do to help you. And if you like your current config then there is no need to help at all. Just enjoy it 
> 
> As for latest news concerning ebuild starting from 26.11.2006 snapshot there is new use flag called demos. It installs testing programs from ft2demos when enabled.

 

Thanks, I just noticed that when I updated the overlay, I'm going to try it your way to see if it works better for me. Thanks.

EDIT: FYI, cairo 1.2.6 is out if you intend on updated that ebuild in your overlay  :Wink: 

----------

## boniek

I will do so when new cairo will hit ~arch. I believe that less hardmasked packages in our systems is better for our sanity  :Wink: 

----------

## yagami

well , it is nice ( the newspr ) , but its very very slow rendering text !

----------

## boniek

Could you post more details? It's all snappy here (athlon xp 1700+, radeon 9500 on floss drivers, xorg 7.1, gnome 2.16).

----------

## yagami

with subpixel font rendering , i can see the fonts being drawn ( in menu's and etc )

without it , they are instant and cant be seen being drawn.

i have an nvidia 6600 gt , with nvidia drivers

----------

## boniek

It seem's like nvidia driver problem to me if you have RENDER acceleration enabled already.

http://www.nvnews.net/vbulletin/showthread.php?t=44317 guys there are having similar problems. If that is the case then I can't really help you, and you should nag Nvidia about it  :Wink: 

----------

## deno

mxhost d3n # layman -a xeffects

* Overlay "xeffects" does not exist!

?

----------

## nesl247

 *deno wrote:*   

> mxhost d3n # layman -a xeffects
> 
> * Overlay "xeffects" does not exist!
> 
> ?

 

Make sure you have layman -L.. Other than that, the only thing to fix it would be to change the contact attribute check to be off.

----------

## deno

Thanks, now it is working.

----------

## deno

one more question. how to set smoothing mode to subpixel, hinting mode to medium or full and subpixel order to rgb?

this is my .font.conf file:

?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

 <match target="font" >

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

   <const>none</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>hintmedium</const>

  </edit>

 </match>

 <match target="font" >

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

   <bool>true</bool>

  </edit>

 </match>

</fontconfig>

does it look ok?

----------

## deno

...eh, i have just noticed that it returned to defaults except 4. line.

----------

## deno

i think that i have enabled newspr use flag but when i run 

mxhost d3n # emerge -pv cairo

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

Calculating dependencies... done!

[ebuild   R   ] x11-libs/cairo-1.2.4  USE="X directfb png -doc -glitz -pdf -svg" 0 kB

Total size of downloads: 0 kB

mxhost d3n # emerge -pv freetype

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

Calculating dependencies... done!

[ebuild   R   ] media-libs/freetype-2.1.10-r2  USE="zlib -bindist -doc" 0 kB

dont't see that such flag exists.

----------

## boniek

All packages (revelant to this topic) are ~arch, and freetype is M~arch. Unmask freetype in /etc/portage/package.unmask and, if you are using stable tree, set appropriate keywords for corresponding packages in /etc/portage/package.keywords (more details about how to use portage is found here). Also remember to add

```
source /usr/portage/local/layman/make.conf
```

line at the end of your /etc/make.conf to make overlays added by layman visible to emerge.

 *deno wrote:*   

> one more question. how to set smoothing mode to subpixel, hinting mode to medium or full and subpixel order to rgb?

 

In Gnome it is in System/Preferences/Font.

----------

## boniek

Nvidia has problems with performance and antialiased font rendering:

http://lists.freedesktop.org/archives/xorg/2006-December/020265.html

Updated guide a bit to reflect this and added other small things.

----------

## deno

Hm in KDE is no such option to set smoothing mode to subpixel, or at least I can't see it. BUT   :Very Happy:  this is much much better. thanks!

----------

## Bloodsurfer

 *deno wrote:*   

> Hm in KDE is no such option to set smoothing mode to subpixel, or at least I can't see it. 

 

Yes there is, you have to look in your control center under "appearance" and "fonts" or something similar (I use german language and can't give you the exact translation, but it should be something like that). There you can enable it.

----------

## m42

In kde, go to the control center. Look under "Appearance & Themes>Fonts" Then click configure next to "Use anti-aliasing fonts". You can enable it from there.

And thanks boniek, these fonts really do look alot better!

----------

## deno

 *m42 wrote:*   

> In kde, go to the control center. Look under "Appearance & Themes>Fonts" Then click configure next to "Use anti-aliasing fonts". You can enable it from there.
> 
> And thanks boniek, these fonts really do look alot better!

 

Anti aliasing fonts... Is that the same as seting smoothing mode to subpixel? If yes, thanks, I did it.

----------

## peka

Thank You boniek!  :Smile: 

----------

## optics

thanks for this.. things certainly look different... i'm not sure whether it is better yet.

it really would be nice if someone could post relevant

/etc/fonts/local.conf

 ~/.fonts.conf

that would help immensely

----------

## PraetorX

I've got the fonts done, now what theme are you using for firefox?   :Razz: 

----------

## boniek

 *optics wrote:*   

> thanks for this.. things certainly look different... i'm not sure whether it is better yet.
> 
> it really would be nice if someone could post relevant
> 
> /etc/fonts/local.conf
> ...

 

Can't help you with that, because none of these files are present in my system.

 *PraetorX wrote:*   

> I've got the fonts done, now what theme are you using for firefox?

 

It's [gperfection].

edit: url update

----------

## optics

how about /etc/fonts/fonts.conf ?

----------

## boniek

Attention!

Some big changes to the freetype ebuild. There is no newspr use flag anymore and instead there are 3 new available:

> filter_default - gives same effect as old newspr,

> filter_light - bit different, less blurry but slightly more color artifacts,

> filter_legacy - it's filter used by libXft and Cairo, high contrast but sometimes a lot of color fringing

Attention!

As always choose what you like most  :Smile: 

----------

## boniek

 *optics wrote:*   

> how about /etc/fonts/fonts.conf ?

 

```

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<!-- /etc/fonts/fonts.conf file to configure system font access -->

<fontconfig>

<!--

        DO NOT EDIT THIS FILE.

        IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.

        LOCAL CHANGES BELONG IN 'local.conf'.

        The intent of this standard configuration file is to be adequate for

        most environments.  If you have a reasonably normal environment and

        have found problems with this configuration, they are probably

        things that others will also want fixed.  Please submit any

        problems to the fontconfig bugzilla system located at fontconfig.org

        Note that the normal 'make install' procedure for fontconfig is to

        replace any existing fonts.conf file with the new version.  Place

        any local customizations in local.conf which this file references.

        Keith Packard

-->

<!-- Font directory list -->

        <dir>/usr/share/fonts</dir>

        <dir>/usr/local/share/fonts</dir> <dir>/usr/X11R6/lib/X11/fonts</dir>

        <dir>~/.fonts</dir>

<!-- Font cache directory list -->

        <cachedir>/var/cache/fontconfig</cachedir>

        <cachedir>~/.fontconfig</cachedir>

<!--

  Accept deprecated 'mono' alias, replacing it with 'monospace'

-->

        <match target="pattern">

                <test qual="any" name="family">

                        <string>mono</string>

                </test>

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

                        <string>monospace</string>

                </edit>

        </match>

<!--

  Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'

-->

        <match target="pattern">

                <test qual="any" name="family">

                        <string>sans serif</string>

                </test>

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

                        <string>sans-serif</string>

                </edit>

        </match>

<!--

  Accept deprecated 'sans' alias, replacing it with 'sans-serif'

-->

        <match target="pattern">

                <test qual="any" name="family">

                        <string>sans</string>

                </test>

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

                        <string>sans-serif</string>

                </edit>

        </match>

<!--

  Load local system customization file

-->

        <include ignore_missing="yes">conf.d</include>

        <config>

<!--

  These are the default Unicode chars that are expected to be blank

  in fonts.  All other blank chars are assumed to be broken and

  won't appear in the resulting charsets

 -->

                <blank>

                        <int>0x0020</int>       <!-- SPACE -->

                        <int>0x00A0</int>       <!-- NO-BREAK SPACE -->

                        <int>0x00AD</int>       <!-- SOFT HYPHEN -->

                        <int>0x034F</int>       <!-- COMBINING GRAPHEME JOINER -->

                        <int>0x0600</int>       <!-- ARABIC NUMBER SIGN -->

                        <int>0x0601</int>       <!-- ARABIC SIGN SANAH -->

                        <int>0x0602</int>       <!-- ARABIC FOOTNOTE MARKER -->

                        <int>0x0603</int>       <!-- ARABIC SIGN SAFHA -->

                        <int>0x06DD</int>       <!-- ARABIC END OF AYAH -->

                        <int>0x070F</int>       <!-- SYRIAC ABBREVIATION MARK -->

                        <int>0x115F</int>       <!-- HANGUL CHOSEONG FILLER -->

                        <int>0x1160</int>       <!-- HANGUL JUNGSEONG FILLER -->

                        <int>0x1680</int>       <!-- OGHAM SPACE MARK -->

                        <int>0x17B4</int>       <!-- KHMER VOWEL INHERENT AQ -->

                        <int>0x17B5</int>       <!-- KHMER VOWEL INHERENT AA -->

                        <int>0x180E</int>       <!-- MONGOLIAN VOWEL SEPARATOR -->

                        <int>0x2000</int>       <!-- EN QUAD -->

                        <int>0x2001</int>       <!-- EM QUAD -->

                        <int>0x2002</int>       <!-- EN SPACE -->

                        <int>0x2003</int>       <!-- EM SPACE -->

                        <int>0x2004</int>       <!-- THREE-PER-EM SPACE -->

                        <int>0x2005</int>       <!-- FOUR-PER-EM SPACE -->

                        <int>0x2006</int>       <!-- SIX-PER-EM SPACE -->

                        <int>0x2007</int>       <!-- FIGURE SPACE -->

                        <int>0x2008</int>       <!-- PUNCTUATION SPACE -->

                        <int>0x2009</int>       <!-- THIN SPACE -->

                        <int>0x200A</int>       <!-- HAIR SPACE -->

                        <int>0x200B</int>       <!-- ZERO WIDTH SPACE -->

                        <int>0x200C</int>       <!-- ZERO WIDTH NON-JOINER -->

                        <int>0x200D</int>       <!-- ZERO WIDTH JOINER -->

                        <int>0x200E</int>       <!-- LEFT-TO-RIGHT MARK -->

                        <int>0x200F</int>       <!-- RIGHT-TO-LEFT MARK -->

                        <int>0x2028</int>       <!-- LINE SEPARATOR -->

                        <int>0x2029</int>       <!-- PARAGRAPH SEPARATOR -->

                        <int>0x202A</int>       <!-- LEFT-TO-RIGHT EMBEDDING -->

                        <int>0x202B</int>       <!-- RIGHT-TO-LEFT EMBEDDING -->

                        <int>0x202C</int>       <!-- POP DIRECTIONAL FORMATTING -->

                        <int>0x202D</int>       <!-- LEFT-TO-RIGHT OVERRIDE -->

                        <int>0x202E</int>       <!-- RIGHT-TO-LEFT OVERRIDE -->

                        <int>0x202F</int>       <!-- NARROW NO-BREAK SPACE -->

                        <int>0x205F</int>       <!-- MEDIUM MATHEMATICAL SPACE -->

                        <int>0x2060</int>       <!-- WORD JOINER -->

                        <int>0x2061</int>       <!-- FUNCTION APPLICATION -->

                        <int>0x2062</int>       <!-- INVISIBLE TIMES -->

                        <int>0x2063</int>       <!-- INVISIBLE SEPARATOR -->

                        <int>0x206A</int>       <!-- INHIBIT SYMMETRIC SWAPPING -->

                        <int>0x206B</int>       <!-- ACTIVATE SYMMETRIC SWAPPING -->

                        <int>0x206C</int>       <!-- INHIBIT ARABIC FORM SHAPING -->

                        <int>0x206D</int>       <!-- ACTIVATE ARABIC FORM SHAPING -->

                        <int>0x206E</int>       <!-- NATIONAL DIGIT SHAPES -->

                        <int>0x206F</int>       <!-- NOMINAL DIGIT SHAPES -->

                        <int>0x3000</int>       <!-- IDEOGRAPHIC SPACE -->

                        <int>0x3164</int>       <!-- HANGUL FILLER -->

                        <int>0xFEFF</int>       <!-- ZERO WIDTH NO-BREAK SPACE -->

                        <int>0xFFA0</int>       <!-- HALFWIDTH HANGUL FILLER -->

                        <int>0xFFF9</int>       <!-- INTERLINEAR ANNOTATION ANCHOR -->

                        <int>0xFFFA</int>       <!-- INTERLINEAR ANNOTATION SEPARATOR -->

                        <int>0xFFFB</int>       <!-- INTERLINEAR ANNOTATION TERMINATOR -->

                </blank>

<!--

  Rescan configuration every 30 seconds when FcFontSetList is called

 -->

                <rescan>

                        <int>30</int>

                </rescan>

        </config>

</fontconfig>

```

----------

## neuron

 *boniek wrote:*   

> Attention!
> 
> Some big changes to the freetype ebuild. There is no newspr use flag anymore and instead there are 3 new available:
> 
> > filter_default - gives same effect as old newspr,
> ...

 

compiled latest version with filter_default, and they changed from the newspr I had before.  Got considerably worse.

Tried updating fc-cache/removing .fontconfig, and we'll see if it gets better.  But I could have sworn my fonts were nicer before  :Razz: 

----------

## boniek

 *neuron wrote:*   

> 
> 
> compiled latest version with filter_default, and they changed from the newspr I had before.  Got considerably worse.
> 
> Tried updating fc-cache/removing .fontconfig, and we'll see if it gets better.  But I could have sworn my fonts were nicer before 

 

That's why there are older ebuilds in overlay as well. If you have doubts take screenshot with newer version, compile older version and take screenshot as well and compare  :Smile:  There is no difference here between newspr and filter_default (and there shouldn't be because the only difference between these is the name  :Smile:  )

----------

## neuron

 *boniek wrote:*   

>  *neuron wrote:*   
> 
> compiled latest version with filter_default, and they changed from the newspr I had before.  Got considerably worse.
> 
> Tried updating fc-cache/removing .fontconfig, and we'll see if it gets better.  But I could have sworn my fonts were nicer before  
> ...

 

I had some problems when I emerged the new version, but I cleared my .fontconfig directory, reset the settings (to the exact same I had before), and logged out and in again, and it seems good again now  :Smile: 

----------

## ahubu

I'm both having problems with the boldy bold fonts, as well as with the "after" shot not looking as good as on your pictures.  I did follow the guide, and I did try all what has been suggested.

I'm using the filter_default, and I'm that particular screenshot I cannot see color-artifacts, yet with me they are often visible, combined with a "over-sharpened" look (like I took a screenshot, loaded it in The Gimp and used the sharpen filter). It looks like this only occurs with the firefox(-bin) browser, both the menus and the content. If you look at the gnome-panel, that looks fine.

Also very small fonts, as you can see on the screenshot, are pretty blurry. (the openbox menu has blurry fonts, certainly blurrier than before the switch). Does this have anything to do with small fonts shouldn't be anti-aliased?

I did try this before without the updated ebuilds, and it was even worse than now, so you did help me a bunch already.  :Smile: 

edit: the firefox thing is already solved. Turns out to be the fault of running firefox-bin, that one uses different rendering settings, apparently. Now using Bon Echo (firefox home-compiled) and the fonts are great! However, I'd like to know how to get the same result with the firefox-bin. I tried to play with the font settings in about:config, but that doesn't make it as good as this).

edit2: incredible, I must be tired. After restarting openbox, the fonts are fine. And all small fonts in all applications are rendered perfectly. The only thing that still stands, is the boldness, as someone remarked earlier. I feel it is indeed excessive, and it makes the characters vague.

----------

## neuron

for those having ugly fonts with firefox-bin, try firefox, helped a LOT for me (and I had tweaked firefox-bin for ages too, since I'm on amd64).

Also, getting this error every time I  start.. well, pretty much everything:

```

Fontconfig warning: line 32: unknown element "cachedir"

Fontconfig warning: line 33: unknown element "cachedir"

Fontconfig warning: "/etc/fonts/conf.d/80-delicious.conf", line 18: invalid match target "scan"

```

It's not really a problem though, more of an annoyance  :Razz:  (it's on console, so I rarly notice).

----------

## boniek

Sorry for late reply  :Smile: 

Yes bold fonts do look strange for me too. It would be helpful if you could post your comments about it in savannah bug here:

http://savannah.nongnu.org/bugs/index.php?18374

About fontconfig problem - I have no idea :p I don't have such warnings here (media-libs/fontconfig-2.4.2 -doc -xml)

cat /etc/fonts/conf.d/80-delicious.conf

```

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<!-- /etc/fonts/conf.d/60-delicious.conf -->

<fontconfig>

<!-- Fix-ups for Delicious family -->

<!-- Delicious 'heavy' variant says its Medium weight -->

<match target="scan">

        <test name="family">

                <string>Delicious</string>

        </test>

        <test name="style">

                <string>Heavy</string>

        </test>

        <edit name="weight">

                <const>heavy</const>

        </edit>

</match>

</fontconfig>

```

You may try disabling pango for firefox-bin like this: MOZ_PANGO_DISABLE=1 firefox-bin (may or may not help  :Smile:  ). I don't really know if firefox-bin is using static versions of libXft, cairo or freetype. If so that is the problem and you should stick to source ebuild.

----------

## neuron

compiling with -xml removed the error from most programs (it's compiled with xml in my emul-* libraries though, so I'm still getting it on 32bit apps :p ).

And I'll try the pango thing, that didn't even occur to me  :Razz: , most of the fonts are identical though, just some fonts on 32bit show up really horrible for some reason.

----------

## AaronPPC

Is it me or is the kerning a bit wider after the latest revision?

----------

## boniek

Please provide screenshots from after and befre update so I can be sure that this is a real issue  :Smile: 

----------

## peka

If this is a little off topic - I apologize.

I'm using layman for the first time and only for xeffects.

After syncing recently I've noticed this:

```
# dep -k libwnck

x11-libs/libwnck:

       |                           s    

       |                   p       p    

       |                   p       a   x

       |                   c       r   8

       |                   -       c   6

       | a a             p m     s -   -

       | l m   h i m m   p a s   p f   f

       | p d a p a 6 i p c c 3   a b x b

       | h 6 r p 6 8 p p 6 o 9 s r s 8 s

       | a 4 m a 4 k s c 4 s 0 h c d 6 d

-------+-----------------------------v--

2.14.2 | + + + + +     + +     + +   +  

2.14.2 | ~ ~ ~ ~ ~   ~ ~ ~       ~   ~   /usr/portage/local/layman/xeffects

2.16.1 | ~ ~ ~ ~ ~     ~ ~     ~ ~   ~  

2.16.1 | ~ ~ ~ ~ ~     ~ ~       ~   ~   /usr/portage/local/layman/xeffects

2.16.2 > ~ + ~ ~ ~     + +     ~ +   +  

2.16.2 | ~ ~ ~ ~ ~     ~ ~     ~ ~   ~   /usr/portage/local/layman/xeffects
```

i.e. libwnck is stable in portage and ~ masked in overlay for the same version.

Is a general rule for all overlay packages to be ~ masked? Or they are different despite the same version number?

Is it possible to have the same ~arch keywords in layman overlay packages as in portage?

Right now, unless I remove libwnck from local overlay directory I get "blocking" message for libwnck.

----------

## boniek

Please contact nesl247 with problems concerning overlay.

----------

## kfiaciarka

Hi,

I've tried your howto, now my fonts look much better:)

----------

## Vlad.Sharp

Thanks for the howto, it's very good  :Very Happy: 

The only problem I've had (for a month now, with different openoffices) is openoffice looks ugly...

http://www.vladsharp.com/images/oo2.1/fonts_2.png

in contrast to Firefox

http://www.vladsharp.com/images/oo2.1/fonts_3.png

I've even filed a bug about it recently: http://qa.openoffice.org/issues/show_bug.cgi?id=72945

Specifically, OpenOffice crashes X etc. when I try to select fonts. Anyone else having this issue?

----------

## peka

Yeap, OO menu titles look bad.

But I can't get it to crash playing with fonts as you say in your bug report.

----------

## Vlad.Sharp

 *peka wrote:*   

> Yeap, OO menu titles look bad.
> 
> But I can't get it to crash playing with fonts as you say in your bug report.

 

I compiled OpenOffice 2.1 from scratch (too a good few hours) and the fonts seem fine now. I think it's because OO-2.1 still depends on freetype internals that it bundles with itself.

----------

## boniek

Welcome in New Year  :Smile: 

I have just uploaded new freetype snapshot and bumped cairo to 1.3.10 - enjoy!

OO fonts looks fugly here as well, can't do much about it.

 *kfiaciarka wrote:*   

> Dziêki boniek  Co tam s³ychaæ na UG?

 

P: Zbliża się sesja, życz mi powodzenia!   :Cool: 

E: Exam session is coming, wish me luck!  :Cool: 

----------

## Vlad.Sharp

 *boniek wrote:*   

>  OO fonts looks fugly here as well, can't do much about it.
> 
> 

 

I fixed the problem by compiling openoffice from source - it seems that it links to the proper libraries now and so the fonts look fine. I'll post a screenie soon.

Edit: Here's how fonts look now - and strange fonts that could well have caused the problems: http://www.openoffice.org/nonav/issues/showattachment.cgi/41925/strange_fonts.png

----------

## vampares

 *Vlad.Sharp wrote:*   

> I fixed the problem by compiling openoffice from source 

  ahahhahaha   :Laughing: 

I always edit {$S}include/freetype/config/ftoption.h 

#define TT_CONFIG_OPTION_UNPATENTED_HINTING > 

#undef TT_CONFIG_OPTION_UNPATENTED_HINTING

so it doesn't look like shit.

I also notice #define FT_OPTIMIZE_MEMORY is enabled in 2.2.1.  I'm not going to even try it if it breaks all that stuff.  But someday. . .

----------

## anli

After switching to xeffects/freetype almost all looks nice now (KDE, Firefox, ...) for me. Thanks!

The only problem - qt4 apps has very blurry fonts.

Any tricks?

----------

## dylan_stark

Is there any way to do this without using portage overlay??

----------

## cato`

You can copy the ebuilds and patches from http://svn.gentoo-xeffects.org/xeffects/trunk/ to your local overlay.

----------

## vithar

 *boniek wrote:*   

> 85dpi, subpixel aa, full hinting:
> 
> new spr + bci - this rendering mode is superb

 

Can you tell me which font do you use in menu?

----------

## boniek

In Firefox's menu? It's Bitstream Vera Sans Roman from media-fonts/ttf-bitstream-vera (with X useflag turned on).

----------

## swaun

Has this been tested to work with Freetype 2.3.0?  I see a media-libs/freetype-2.3.0_p20070120 package that's hard-masked in portage right now.

Actually, a more appropriate question...

Most of the ebuilds in the xeffects layman package are marked ~x86.  Which ones should I add to my package.keywords file?  The most recent?   That's what I did here, to get the latest Cairo (1.3.10), libXft (2.1.12), and Freetype (2.3.0_p20070120).  I unmasked these specific versions.

Was that the intent?  Should I just add "ACCEPT_KEYWORDS=~x86" to my /usr/portage/local/layman/make.conf?  I assume that would "unmask" all of the layman builds, but preserve the ~x86 mask on the Portage tree.  

Is this all correct?

----------

## vithar

 *boniek wrote:*   

> In Firefox's menu? It's Bitstream Vera Sans Roman from media-fonts/ttf-bitstream-vera (with X useflag turned on).

 

Thanks, I like this font.

----------

## boniek

 *swaun wrote:*   

> Has this been tested to work with Freetype 2.3.0?  I see a media-libs/freetype-2.3.0_p20070120 package that's hard-masked in portage right now.
> 
> Actually, a more appropriate question...
> 
> Most of the ebuilds in the xeffects layman package are marked ~x86.  Which ones should I add to my package.keywords file?  The most recent?   That's what I did here, to get the latest Cairo (1.3.10), libXft (2.1.12), and Freetype (2.3.0_p20070120).  I unmasked these specific versions.
> ...

 

Freetype 2.3.0 is only available from xeffects overlay at the moment, so yes, it has been tested with 2.3.0  :Smile: 

As long as you are using ebuilds from xeffects overlay, any combination of package versions will work. I recommend most recent ones for obvious reasons  :Smile: 

As for unmasking, all packages needed for this guide are ~arch and freetype is additionally hard masked. If you are on ~arch all you have to do is to add media-libs/freetype to /etc/portage/package.unmask and you are ready to go as far as unmasking goes - portage will "automagically" pick-up all needed ebuilds by itself if you have xeffects overlay present in your system.

----------

## swaun

 *boniek wrote:*   

>  *swaun wrote:*   
> 
> Should I just add "ACCEPT_KEYWORDS=~x86" to my /usr/portage/local/layman/make.conf?  I assume that would "unmask" all of the layman builds, but preserve the ~x86 mask on the Portage tree.  
> 
> Is this all correct? 
> ...

 

In general, I don't want to run ~arch....  I'm willing to do that with the packages that I've specifically overlaid, however.  Will "ACCEPT_KEYWORDS=~x86" in /usr/portage/local/layman/make.conf allow me run ~arch ONLY on the "layman" packages?

----------

## Shelf

I've done everything mentioned here and I have perfect fonts now.. but only in qt apps and thunderbird (I don't use firefox, but it seems that the same thing will happen there too) o_O. I've tried everything I could imagine (overriding settings via gtkrc, or xrdb), but in qt apps/thunderbird fonts still look whole lot smoother than in gtk apps. Just a quick screenie to illustrate my point: http://i13.tinypic.com/40mpdg7.png. Menus in thunderbird look way better than in, say, thunar and it drives me crazy.

Any help would be appreciated.

Edit: Whoops, sorry, it was purely my problem (I forgot to clear fontconfig), sorry.

----------

## PaulBredbury

 *swaun wrote:*   

> Will "ACCEPT_KEYWORDS=~x86"

 

Interesting question, in the layman context. However, I don't think it's a good idea to tempt fate like that, and ACCEPT_KEYWORDS simply should not be tampered with, in the hope that it will work in the right places, and not work in the wrong places  :Wink: 

/etc/portage/package.keywords is exactly where the "unstable" assignations should go.

----------

## Maedhros

Wow, my fonts are looking great now. Thanks!   :Very Happy: 

----------

## anli

 *anli wrote:*   

> After switching to xeffects/freetype almost all looks nice now (KDE, Firefox, ...) for me. Thanks!
> 
> The only problem - qt4 apps has very blurry fonts.
> 
> Any tricks?

 

Well... It seems I'm alone here with my problem   :Shocked: 

Please, can anybody verify qt4 apps have the same font rendering quality as other (qt3, gtk2, ...) apps?

----------

## boniek

Can you please give me more details (such as steps to reproduce problem, including problematic application name and version and qt version)?

----------

## anli

 *boniek wrote:*   

> Can you please give me more details (such as steps to reproduce problem, including problematic application name and version and qt version)?

 

All qt4 apps I have have this issue, for example:

SIR: http://www.kde-apps.org/content/show.php?content=35325 (last version, manually installed)

QLoud: http://gaydenko.com/qloud/ (last version from 'proaudio' overlay or manually, as I'm an author)

qmpdclient (from portage, v.1.0.6)

mscore (from SVN tree)

...

This is small screenshot to illustrate:

http://img506.imageshack.us/img506/4695/qt4fontsrz4.png

You see firefox, qamix (qt3) a and SIR (qt4).

Qt v.4.2.2 is in use on ~amd64 arch.Last edited by anli on Tue Feb 06, 2007 8:00 pm; edited 1 time in total

----------

## boniek

I can't reproduce your problem. Fonts in QMPDClient [look] ok to me (qt-4.2.2, qmpdclient-1.0.7, ~x86). Try troubleshotting steps from guide and restart X.

edit: url update

----------

## anli

 *boniek wrote:*   

> I can't reproduce you problem. Fonts in QMPDClient look ok to me.

 

Can it be arch-related issue? I'm on ~amd64.

Or - must I try to rebuild something X/font/qt-related? (have tried to rebuild qt4 itself already)

USE-flags?

I see, my question are too common. Probably you can shortly point me some ways where to dig in.

(OT: which window decoration do you use?   :Cool:  )

----------

## anli

 *anli wrote:*   

> ... where to dig in...

 

One thought is: I have set an anti-aliasing via KDE Control Center. Probably I must use something at X level.

----------

## boniek

I doubt it is arch related. I don't really know how this looks in kde, but you have to (well you don't, but I recommend it for best effect  :Smile:  ) set font related settings exactly like [that] (I know this is Gnome screenshot but in KDE it should be similar).

Info on revelant packages (please note that I don't have kde installed at all, only qt):

```

* media-libs/freetype-2.3.0_p20070127::x-xeffects {:2} [R] -bindist demos -doc filter_default -filter_legacy -filter_light zlib <media-libs/fontconfig-2.4.2::installed, x11-libs/cairo-1.3.12::x-xeffects, 3 more>

* x11-libs/libXft-2.1.12::x-xeffects {:0} [R] -debug newspr <virtual/xft-7.0::installed>

* x11-libs/qt-4.2.2 {:4} [R] -accessibility -cups dbus -debug -doc -examples -firebird -gif -glib jpeg -mng -mysql -nas -nis -odbc opengl -pch png -postgres -qt3support -sqlite -sqlite3 -xinerama zlib input_devices: -wacom

* x11-libs/cairo-1.3.12::x-xeffects {:0} [R] X -debug -directfb -doc glitz newspr svg -xcb

```

My gtk theme uses x11-themes/gtk-engines-rezlooks (sunrise overlay). Gtk theme is Rezlooks-Graphite and metacity theme is Gilouche-OB (both can be found [here]).

edit: url update

----------

## anli

 *boniek wrote:*   

> I doubt it is arch related. I don't really know how this looks in kde, but you have to (well you don't, but I recommend it for best effect  ) set font related settings exactly like that (I know this is Gnome screenshot but in KDE it should be similar).

 

I have the same settings except for "Full" is replaced by "Slight" (with "Full" all looks like qt4 on example reffed above). At any case, anybody can use gnome, kde, fluxbox and so on. And some of wms may not have 'control center' at all. So, I think, there must be some way to set all these font anti-aliasing settings at X level. Am I wrong?

----------

## boniek

Try to create .fonts.conf in your home directory with following contents:

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

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

    <match target="font">

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

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

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

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

    </match>

</fontconfig>

```

and see if it helps. BTW it won't work with slight. It must be either Medium or Full to enable new method of subpixel rendering. After any change remember to remove ~/.fontconfig directory.

EDIT: updated .fonts.conf a bit

----------

## anli

Aha, I see, thanks! - KDE Control Center creates and edits just this file (~/.fonts.conf). I'll play with it.

----------

## anli

After digging in '/etc/fonts/conf.avail' I have found '10-autohint.conf' file (well, it wasn't too hard to find this file as it's first one   :Wink:  ), and soft-link to this file was not added inside '/etc/fonts/conf.d' dir. OK, I have inserted these lines from '10-autohint.conf' file

```
 <match target="font" >

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

   <bool>true</bool>

  </edit>

 </match>
```

into '~/.fonts.conf' file inside <fontconfig> element... Magic! Qt4 apps fonts look as they must to look!

(BTW, KDE Control Center keeps my <match> element intelligently). Now '~/.fonts.conf' file looks like this:

```

<?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="autohint" >

   <bool>true</bool>

  </edit>

 </match>

 <match target="font" >

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

   <bool>true</bool>

  </edit>

 </match>

</fontconfig>
```

Thanks again for help and inspiration!

----------

## boniek

Well, thanks for providing desktop agnostic way to enable new spr. I will add it to the guide shortly.

----------

## anli

BTW, it seems like "Slight' nevertheless does work some way for me. At least I see difference after changing "RGB" to "BGR". To check my eyes, I have started the same qt3 application with "Slight"-"RGB" (above) and "Slight"-"BGR" (below) at the same time:  http://img127.imageshack.us/img127/766/qt3slightwa3.png  After zooming in the picture I have decided I can believe my eyes  :Smile: 

With "Medium" and "Full" settings chars seem "too separated" to my taste (along with every single char looks nice).Last edited by anli on Tue Feb 06, 2007 7:59 pm; edited 1 time in total

----------

## boniek

Yes, it seems problem with slight was fixed some time ago in cvs  :Smile: 

----------

## IvanMajhen

My fonts looks great now!

But I have problem with openoffice. They doesn't look like in kde or gtk. Like they aren't fully hinted or something.

I have checked use system fonts in options --> view, but they don't look like they should.

Openoffice is compiled, with binary looked even worse. 

Is there any patch for ooffice?

http://shrani.si/files/snapshot2sw56.png

----------

## boniek

Yeah, OpenOffice looks pretty bad compared to what can be done with this new freetype rendering mode. Unfortunately I'm not aware of any patch to remedy that.

----------

## vicaya

freetype 2.2.1-r1 got unmasked in portage, accidentally upgraded. Disatrous results in kde, the arial font is badly rendered, smaller, blurrier, fatter, so does bitstream vera  sans mono. Just awful. Looks fine in firefox-bin (probably different set of libs) 

reverting back to 2.1.10-r2 solved the font problems.

----------

## Phenax

2.3.1 is out in ~amd64, it looks a bit better than the previous 2.2* version.

----------

## boniek

I'm a bit puzzled about last two posts. Were they merged from another topic? They don't fit here at all  :Smile: 

BTW You can use freetype-2.3.1 from portage with this guide as well. Just remember not to enable bindist useflag and you are all set (you will still need cairo and libXft from overlay though).

----------

## indanet

Hi!

I want to use freetype 2.3.1 from portage.  Is there a better way than putting "=media-libs/freetype-2.3.1" in portage.keywords?  The next time freetype is upgraded in portage and freetype-2.3.1 is removed, it will try to downgrade to the then stable version.  If I put "media-libs/freetype" in portage.keywords, portage will always install the overlay's latest freetype version...

I need a way to say "unmask this package only for the portage repository".

Regards

indanet

EDIT: Fixed typos which made the whole post useless, thanks Paul!Last edited by indanet on Fri Feb 09, 2007 1:41 pm; edited 1 time in total

----------

## PaulBredbury

 *indanet wrote:*   

> portage will always install the overlay's latest freetype version

 

You're getting = and >= confused.

----------

## m.s.w

I tell you what. It seems that all the things you are talking here is totally dependent on what is "good" or "bad" for individual person.

I have tested all possible combinations (filter_default, *_legacy *_light   X   hintmedium, *full, *slight) and all of this sucks a lot.

The best fonts I have are with freetype-2.1. The color (how much black black color is), the bold fonts (bold is bold, not totally bold, and regular is regular not bold as it is with some fonts), the hinting (no blue colors on the edge of some fonts, on webpages, for example the best test was documentation for fontconfig in html format that we all have in /usr/share/doc/fontconfig-**/html), the spacing of the letters (the freetype makes lots of fonts to have too big letter spacing.)

So in my opinion, freetype-2.1 is great. The two next versions sucks.

Best Regards,

m.s.w

----------

## boniek

Here is my version. Could you please post yours?

----------

## m.s.w

http://mkm-online.homelinux.org/linux/freetype-2.1_hintfull.jpg

To jest najlepszy widok ze wszystkich przetestowanych.

freetype-2.1

hintfull

EDIT: Sorry about the language. It was not intentional  :Smile: 

Translation:

This is the best look among all tested.

Pozdrawiam,

m.s.w

----------

## boniek

https://boniek.homelinux.org/~boniek/desktop/Screenshot-fonts-conf.png

Font size simialiar to yours. Bold fonts are bit bolder, spacing seems the same. IMO it looks really good (well bold fonts are too bold obviously, but it doesn't concern me as much). I like your screenshot too. It's different but nice nonetheless. Use whatever suits your taste  :Smile: 

PS. please write in english - this is english forum.

----------

## m.s.w

OK, I have to agree, that your screen is better. But the problem is that I culdn't get my fonts look like your screens shows. So obviously there has to be something that this mini HOWTO doesn't cover, but is cuicial for the fonts to work good.

I don't know what is it. In the mean time - as you said - I use whatever suits best. 

Regards,

m.s.w

----------

## boniek

I have just simplified guide as much as possible (well at least I think so  :Wink:  ). I corrected .fonts.conf - it was WRONG before. We have to set autohinting to FALSE to use BCI (and we want to use it  :Wink:  ). For people that couldn't get it to work - please try new guide and report back any problems.

----------

## Bartmanw

After a recent re-emerge of many packages (such as upgrade to Xorg 7), my fonts were not anti-aliased.  I applied this guide, and then the fonts were good only in some applications, in particular the KDE ones.  This is a screenshot of Firefox (left) and Konqueror (right).  As you can see, the fonts in Firefox are not anti-aliased at all.  Any idea what causes this difference?  Are there any other packages which I should re-emerge apart from the 3 mentioned?

http://cage.ugent.be/~jdemeyer/badfonts.png

----------

## albright

 *Quote:*   

> As you can see, the fonts in Firefox are not anti-aliased at all

 

To be honest, I think your problem is with your font settings in

firefox preferences. Tell it to use bitstream vera sans and tell firefox

*not* to let web pages choose their own fonts. That worked for

me anyway.

----------

## boniek

Try forcing fonts in firefox to something else (Edit/Preferences/Content/Advanced/Fonts for Western/) e.g. serif/Verdana/Verdana/Bitstream Vera Sans Mono and uncheck "Allow pages to choose their own fonts". See if that helps.

EDIT: albright was faster  :Smile: 

----------

## Bartmanw

 *albright wrote:*   

> To be honest, I think your problem is with your font settings in
> 
> firefox preferences. Tell it to use bitstream vera sans and tell firefox
> 
> *not* to let web pages choose their own fonts. That worked for
> ...

 

I tried that, but that didn't fix it.  The font changed, but it's still aliased.  By the way, the bad fonts are not just in firefox.  They are basically like that in every application except for the KDE ones (in KDE the fonts *do* look very good indeed).

Note that some packages on my system might be outdated, so it could very well be that I have to update a particular package.  I would just like to avoid "emerge -uD world" unless necessary.

----------

## Bartmanw

While playing around and trying some things, I discovered the pango-view program.  I displayed the text "Hello World" with 4 different backends.  This is the result:

http://cage.ugent.be/~jdemeyer/pango-view.png

----------

## boniek

Your screenshot should look like [this] - xft and cairo should look identical. Please post result of running following command:

```
emerge -pv x11-libs/cairo x11-libs/libXft media-libs/freetype
```

----------

## devsk

is it possible to set a system wide backend? I am seeing colored characters in my firefox text and pango-view text if I use xft backend. The cairo backend is the sharpest and that's what I want to use. How do I do that?

----------

## boniek

Again xft and cairo should look identical as provided in screenshot in my previous post. They should look identical if both cairo and libXft were emerged with newspr use flag. Unfortunately it is not possible to set system wide backend (it all depends on a way application was coded). Closest to what you have in mind is to use DE such as Gnome and only use apps that are written using libs provided by that particular DE.

----------

## kamracik

what should i write when layman ask me for a user and password??

----------

## boniek

Currently xeffects overlay is unavailable. Please be patient.

----------

## m.s.w

 *boniek wrote:*   

>  We have to set autohinting to FALSE to use BCI (and we want to use it  ). For people that couldn't get it to work - please try new guide and report back any problems.

 

OK, That was it - autohint=false.

And now, everything is nice.

Thank you.

m.s.w

----------

## Bartmanw

 *boniek wrote:*   

> Your screenshot should look like [this] - xft and cairo should look identical. Please post result of running following command:
> 
> ```
> emerge -pv x11-libs/cairo x11-libs/libXft media-libs/freetype
> ```
> ...

 

Here it is:

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

Calculating dependencies... done!

[ebuild   R   ] x11-libs/cairo-1.3.12  USE="X newspr -debug -directfb -doc -glitz -svg -xcb" 0 kB [1]

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

[ebuild   R   ] media-libs/freetype-2.3.1_p20070207  USE="filter_default zlib -bindist -demos -doc -filter_legacy -filter_light" 0 kB [1]

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

Portage overlays:

 [1] /usr/portage/local/layman/xeffects
```

----------

## kamracik

ok now i made all this and it looks really nice  :Smile:  with small exception..

http://www.ftims.com/screen.png

http://www.ftims.com/screen2.png (it's error 404, this file exist  :Very Happy: )

http://www.ftims.com/screen4.png (small blue inscription on left)

try all things here i think, combine diffrent values in fontconfig but nothing helps for that cases :/

----------

## renrutal

Umm, the move from freetype 2.2 to 2.3 changed the looks a bit. The fonts are bolder now.

I didn't like it much(but it does look good), so I found a "fix": Change the font hinting to Full.

In KDE it can be found in Control Center > Look & Themes (I'm translating from Portuguese) > Fonts > |Check| Anti-aliasing > Hinting: Full

----------

## boniek

Filter flags are gone now. Installing without bindist gives us bci and default filter. Updated guide to reflect this.

 *kamracik wrote:*   

> ok now i made all this and it looks really nice  with small exception..
> 
> http://www.ftims.com/screen.png
> 
> http://www.ftims.com/screen2.png (it's error 404, this file exist )
> ...

 

Please don't mess with fontconfig. Force fonts in your browser for Central European to something else. About this "inscription". Are you talking about "expanded!" thing? It is just the way this font looks.

 *Bartmanw wrote:*   

> 
> 
> Here it is:
> 
> ```
> ...

 

Looks OK. Try recompiling everything that depends on cairo, libXft and freetype.

----------

## nesl247

boniek, please contact via irc. I want to get you setup on the xeffects wiki so you can post the guide there. Just like to keep all xeffects documentation in the same spot.

----------

## kamracik

thx boniek  :Wink:  i didnt think about it  :Smile:  simply changed font to Times New Roman and everything back to normal  :Smile: 

----------

## Kate Monster

My fonts look great now. Thank you   :Smile: 

Nice avatar btw.

----------

## peka

I got lost  :Sad: 

After some recent update to freetype (withdrawn use flags) or something else my fonts look bad again.

Which freetype version is recommended?

----------

## anli

 *peka wrote:*   

> I got lost 
> 
> After some recent update to freetype (withdrawn use flags) or something else my fonts look bad again.
> 
> Which freetype version is recommended?

 

Not sure it is a reason. I was forced to mask last cairo 1.3.14 from official portage tree as xeffects SVN is not available for me during last days.

----------

## boniek

Peka, this happened because you installed cairo from portage instead of overlay just as anli said. I have just updated cairo in overlay to 1.3.14. Sorry for delay.

----------

## anli

 *boniek wrote:*   

> I have just updated cairo in overlay to 1.3.14. Sorry for delay.

 

I have this reply:

svn up

svn: PROPFIND request failed on '/xeffects/trunk'

svn: PROPFIND of '/xeffects/trunk': 500 Internal Server Error (http://svn.gentoo-xeffects.org)

Few messages ago you have written to be patient. I still am  :Smile: 

----------

## boniek

Anli, xeffects overlay changed its address to svn://svn.gentoo-xeffects.org/xeffects/trunk. Remove your local tree and check it out again but from new address this time.

----------

## peka

 *boniek wrote:*   

> Peka, this happened because you installed cairo from portage instead of overlay just as anli said. I have just updated cairo in overlay to 1.3.14. Sorry for delay.

 

No harm done  :Smile: 

Cheers Mate!

----------

## anli

 *boniek wrote:*   

> Anli, xeffects overlay changed its address to svn://svn.gentoo-xeffects.org/xeffects/trunk. Remove your local tree and check it out again but from new address this time.

 

Thanks! - updating just now.

----------

## roderick

Ok,

Anyone here have ghostscript/cups support with media-fonts/gnu-gs-fonts-std installed?

I tried to rebuild my font cache (fc-cache) and this package causes fc-cache to hang and drive the CPU though the roof. I unmerged it and fc-cache worked fine.

The problem is it appears to be a dep of any of the ghostscript builds in portage.

If I leave it installed, I cannot run kdm as kdm_greet stalls (looks like it wants to rebuild the font cache at some point) and cpu goes to 100%.

Any ideas on why this particular font package is not liking fontconfig/freetype? 

I had everything working fine until upgrade to new freetype/cairo/libxft, so I assume it's related...

Any help would be appreciated as this is driving me mad.

----------

## boniek

Thanks for reporting. I can reproduce this problem on my machine. It seems to be bug in cvs version of freetype (not related to newspr patches). I will inform upstream about it. As a workaround use ebuild of freetype-2.3.1 from official portage tree.

----------

## boniek

I just changed KEYWORDS in ebuilds for snapshots of freetype to reflect their unstable nature. Now normally you should install freetype-2.3.1 from official portage (it is pretty stable and shouldn't give you any unexpected problems), but if you feel adventurous you may try snapshots.

----------

## boniek

As I'm happy Paludis user I have added Paludis specific info to the guide.

----------

## nesl247

boniek, contact me on irc so I can give you access to the wiki so we can put the documentation there.

----------

## boniek

Thanks to nesl247 guide moved to xeffects wiki. You can find it [here].

----------

## na641

Not sure if this is just me as these things vary from system to system but when i set "Font Hinting" to either medium or full the fonts look horrible!  Only slight hinting makes them look good.  I also agree that the 'bold' font is way too bold.  I hope this is fixed soon.

----------

## boniek

 *na641 wrote:*   

> Not sure if this is just me as these things vary from system to system but when i set "Font Hinting" to either medium or full the fonts look horrible!  Only slight hinting makes them look good.  I also agree that the 'bold' font is way too bold.  I hope this is fixed soon.

 

What kind of Desktop Environment you are using? What freetype, cairo, libXft versions? Please provide screen shots with full and slight hinting.

----------

## na641

 *boniek wrote:*   

>  *na641 wrote:*   Not sure if this is just me as these things vary from system to system but when i set "Font Hinting" to either medium or full the fonts look horrible!  Only slight hinting makes them look good.  I also agree that the 'bold' font is way too bold.  I hope this is fixed soon. 
> 
> What kind of Desktop Environment you are using? What freetype, cairo, libXft versions? Please provide screen shots with full and slight hinting.

 

I am using Xfce 4.4, here's the relevant package info:

```
[ebuild   R   ] media-libs/freetype-2.3.1  USE="zlib -bindist -doc" 0 kB 

[ebuild   R   ] x11-libs/cairo-1.3.14  USE="X glitz newspr svg -debug -directfb -doc -xcb" 0 kB [2] 

[ebuild   R   ] x11-libs/libXft-2.1.12  USE="newspr -debug" 0 kB [2] 

```

With fullhint

With slighthint

Notice the bold window title font, which looks like utter crap with full hinting.  Also, the console font looks much nicer with slight hint (especially the bold parts)

----------

## boniek

Forgot one thing. What fonts are you using (font size and DPI as well please)?

----------

## na641

 *boniek wrote:*   

> Forgot one thing. What fonts are you using (font size and DPI as well please)?

 

Sure thing. Dpi is 96x96.  Console font is consolas, titlebar font is HandelGotD.  Both font's are sized at 9pt.

----------

## boniek

This is how it looks for me:

HandelGotD:

https://boniek.homelinux.org/~boniek/desktop/handelgotd_full.png

https://boniek.homelinux.org/~boniek/desktop/handelgotd_slight.png

They look equally bad to me  :Smile: . Some font families seem to not play well with newspr. Looks like HandelGotD is one of them (another example would be DejaVu faimly).

Consolas:

https://boniek.homelinux.org/~boniek/desktop/full.png

https://boniek.homelinux.org/~boniek/desktop/slight.png

https://boniek.homelinux.org/~boniek/desktop/full_nobold.png

https://boniek.homelinux.org/~boniek/desktop/full_nobold_verasans.png

Personally I prefer full hinting, bitstream vera sans with bold disabled in terminal emulator  :Wink:  .

Bold fonts are Achilles' heel of freetype (they are just too bold). I don't know of any way to remedy this. Personally I just avoid bold fonts whenever I can.

----------

## PaulBredbury

Here's my ~/.fonts.conf, which displays bold well:

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

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

   <!-- Info at http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts -->

   <!-- Replace Courier 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>

   <!-- 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>

   <!-- hintnone, hintslight, hintmedium, hintfull -->

   <match target="font">

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

         <const>rgb</const>

      </edit>

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

         <bool>false</bool>

      </edit>

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

         <bool>true</bool>

      </edit>

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

         <bool>true</bool>

      </edit>

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

         <const>hintslight</const>

      </edit>

   </match>

   <!-- 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>

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

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

   </match>

   <!-- Reject bitmap fonts in favour of Truetype, Postscript, etc. -->

   <selectfont>

      <rejectfont>

         <pattern>

            <patelt name="scalable">

               <bool>false</bool>

            </patelt>

         </pattern>

      </rejectfont>

   </selectfont>

</fontconfig>
```

----------

## anli

 *boniek wrote:*   

> .. Some font families seem to not play well with newspr...

 

Can you list few fonts (mono and prop, unicoded) known to play well?   :Very Happy: 

Thanks in advance!

----------

## na641

 *boniek wrote:*   

> This is how it looks for me:
> 
> HandelGotD:
> 
> https://boniek.homelinux.org/~boniek/desktop/handelgotd_full.png
> ...

 

Could you tell me what font you use for your window titles (in the console screenshots)?

----------

## boniek

 *na641 wrote:*   

> Could you tell me what font you use for your window titles (in the console screenshots)?

 

It's good, old Sans Bold 8pt.

 *anli wrote:*   

> Can you list few fonts (mono and prop, unicoded) known to play well? 
> 
> Thanks in advance!

 

I didn't try a lot of fonts really. Just pick what looks best for you. Bitstream and Sans family are my personal favorites.

Look [here] for some samples.

 *PaulBredbury wrote:*   

> Here's my ~/.fonts.conf, which displays bold well:
> 
> ```
> ...
> ```
> ...

 

More of a workaround than a solution. It disables hinting (and newspr as well) for bold fonts. Do they look better? Thats highly subjective (as everything else here)  :Wink: 

----------

## m.s.w

I have to ask: where did you get "Bitstream Vera Roman" and other types from?

I have installed ttf-bitstream-vera ebuild, but there is no such a font....

m.s.w

----------

## boniek

 *m.s.w wrote:*   

> I have to ask: where did you get "Bitstream Vera Roman" and other types from?
> 
> I have installed ttf-bitstream-vera ebuild, but there is no such a font....
> 
> m.s.w

 

It's Bitstream Vera Sans Roman from media-fonts/ttf-bitstream-vera (with X useflag turned on).

----------

## vinboy

great

----------

## IvanMajhen

Boniek, is your interface font color black, or did you changed it to some lighter black?

If my fonts are for example #343434 they look much better. I'm using corefonts. Bitstream fonts doesn't look right for me, specialy in web.

----------

## na641

Hey Boniek, just thought you should know there is a new version of cairo in portage, version 1.3.16 which is greater than the 1.3.14 version in the overlay.

----------

## devsk

one very basic question: is the overlay still required to enjoy the new font rendering on LCDs? Are there some patches in overlay which are not in freetype-2.3.1 and cairo-1.3.16 in portage, and which affect the look of fonts.

----------

## roderick

Was updated (by yours truly) about 7 hours ago  :Smile: 

Re-sync your xeffects overlay to get the update to Cairo 1.3.16.

Cheers,

Rod.

----------

## boniek

 *na641 wrote:*   

> Hey Boniek, just thought you should know there is a new version of cairo in portage, version 1.3.16 which is greater than the 1.3.14 version in the overlay.

 

It's at 1.3.16 thanks to roderick  :Wink: 

 *devsk wrote:*   

> one very basic question: is the overlay still required to enjoy the new font rendering on LCDs? Are there some patches in overlay which are not in freetype-2.3.1 and cairo-1.3.16 in portage, and which affect the look of fonts.

 

You still need overlay for cairo and libXft as they need to be patched for all this to work.

 *IvanMajhen wrote:*   

> Boniek, is your interface font color black, or did you changed it to some lighter black?
> 
> If my fonts are for example #343434 they look much better. I'm using corefonts. Bitstream fonts doesn't look right for me, specialy in web.

 

That's how fonts look under Gnome for me (freetype applies a bit of gamma correction thats why they are not pitch black - I like this effect very much).

----------

## na641

 *roderick wrote:*   

> Was updated (by yours truly) about 7 hours ago 
> 
> Re-sync your xeffects overlay to get the update to Cairo 1.3.16.
> 
> Cheers,
> ...

 

Thanks once again for the update.

----------

## roderick

 *na641 wrote:*   

> Thanks once again for the update.

 

No problem.

I'm an update junkie, so I usually know when things need to be fixed pretty quickly.

-Rod

----------

## IvanMajhen

 *boniek wrote:*   

> 
> 
>  *IvanMajhen wrote:*   Boniek, is your interface font color black, or did you changed it to some lighter black?
> 
> If my fonts are for example #343434 they look much better. I'm using corefonts. Bitstream fonts doesn't look right for me, specialy in web. 
> ...

 

Hm... Don't understand. My fonts in yahoo look exactly like yours. But interface fonts are much blacker. If you didn't change interface color font, where this freetype gamma correction can be setup?

----------

## boniek

Which desktop environment are you using?

----------

## IvanMajhen

I'm using KDE with QTcurve. 

Here is screenshot how yahoo page looks: http://shrani.si/files/snapshot2uyzy.png.

It looks like yours, but yahoo looks good, because they don't use straight black fonts.

But for example, www.osnews.com fonts are very black: http://shrani.si/files/snapshot3uz25.png. 

It would be nice if they looked like fonts in your ui.

Could you post screenshot of osnews.com, i wanna see if your fonts are black like mine, or do they look like from your ui.

I can get my ui to look like yours if i change font color (in gtk and qt apps with qtcurve). 

But this doesn't apply to fonts colors in web. So if you are using that freetype gamma correction this should be 

system wide, right? And where and how to change it?

Thanks

----------

## boniek

[Here].

Gamma correction is done by freetype - it should be system wide unless DE screws with your fonts in some way.

----------

## m.s.w

Maybe it's OT, or irrelevant, but anyone knows how to make FF fully support nice fonts? For example here : http://www.regdeveloper.co.uk/2007/03/05/red_exadel/

I had no problems, util last update of cairo (previously I had cairo from xeffects, now regular from portage).

Regards,

m.s.w

----------

## IvanMajhen

I think you have different font color in gnome. UI fonts are not black.

Problems with black (not bold, but black) font is that they are not smooth like other fonts.

I changed gamma in kde, by value when they become smooth.

They had some weird colors around it, and they look ok now.

----------

## na641

 *IvanMajhen wrote:*   

> I think you have different font color in gnome. UI fonts are not black.
> 
> Problems with black (not bold, but black) font is that they are not smooth like other fonts.
> 
> I changed gamma in kde, by value when they become smooth.
> ...

 

Could you please post before and after shots to show the differences you speak of?  Also, could you please give us your new optimal gamma settings?  I think we would all appreciate this.

Oh well, I'm a gnome user anyway, so i'm not sure how simple it would be to change the gamma settings, if its possible at all through the gnome ui.

----------

## johoe

I stumbled in this thread, cause I never was satisfied with the fonts on my gnome desktop. Especially freetype 2.3.1 made things even worse. So I tried your docs and I must say my fonts never looked so pretty. Many thanks for this great work!

The only thing I'm wondering is, that I really notice no difference when using "Grayscale" or "Subpixel" smoothing. So I am not using your "newspr" feature, when I set "Greyscale" smoothing  - is this correct? Where are the differences, what should I use?

I am running gnome-desktop on gentoo. Setup is done as your docs suggest.

regards,

  johoe

----------

## boniek

New subpixel rendering is used only when subpixel smoothing is selected. 

[greyscale]

[subpixel]

There is subtle difference. Use what you like best.

----------

## IvanMajhen

 *na641 wrote:*   

>  *IvanMajhen wrote:*   I think you have different font color in gnome. UI fonts are not black.
> 
> Problems with black (not bold, but black) font is that they are not smooth like other fonts.
> 
> I changed gamma in kde, by value when they become smooth.
> ...

 

Screenshot doesn't take changed gamma setting. My old screenshots are now looking good with changed gamma. This only changes monitor settings. With black fonts i had some red,green... pixels around them. They are smooth now. Gamma is 1.40. I think that this is problem with my lcd, since all movies now looks brighter (before i had to change brightness in kmplayer)

----------

## boniek

 *roderick wrote:*   

> Ok,
> 
> Anyone here have ghostscript/cups support with media-fonts/gnu-gs-fonts-std installed?
> 
> I tried to rebuild my font cache (fc-cache) and this package causes fc-cache to hang and drive the CPU though the roof. I unmerged it and fc-cache worked fine.
> ...

 

Seems that it is fixed in FreeType 2.3.2 (WFM at least).

----------

## albright

Sorry if this has already been mentioned (the thread is too

long for me look through the whole thing  :Smile:  ) but it is very

important to get the proper dpi for your monitor.

My fonts were ok after following this guide, but I noticed  that

my nvidia card set the dpi at 96x95; changing display size

in xorg.conf (dropping the width number by 1 in the DisplaySize

paramter in the Monitor section) so that dpi became the

proper 96x96 made a HUGE difference to the quality of the

fonts (I guess being just one pixel off makes a big difference

to subpixel rendering).

Anyway, I thought I'd mention it as worth checking ...

----------

## boniek

 *albright wrote:*   

> Sorry if this has already been mentioned (the thread is too
> 
> long for me look through the whole thing  ) but it is very
> 
> important to get the proper dpi for your monitor.
> ...

 

Thanks  :Smile:  I have 96x96 already and didn't think of that issue before. I will add this info to the guide later.

EDIT: when changing to 85 dpi my fonts look still good so I don't think that DPI has anything to do with how fonts like except maybe their size  :Smile: 

----------

## prymitive

Hi,

I tried this ebuild (from xeffects overlay) but my fonts are now bigger than before, does anyone have this problem?

my freetype 2.1.10-r2 http://pcserwis.net/img/freetype-2.1.10.png

freetype 2.3.1_20070207 http://pcserwis.net/img/freetype-2.3.1_20070207.png

It seems that all freetype verions starting with 2.2 make my fonts looks bigger than with 2.1.10.

local.conf

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

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

        <!-- Info at http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts -->

        <!-- Replace Courier with a better-looking font -->

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

                <test name="family" qual="any">

                        <string>Courier</string>

                </test>

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

                        <string>Lucida Grande</string>

                </edit>

        </match>

        <match target="font">

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

                        <const>rgb</const>

                </edit>

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

                        <bool>true</bool>

                </edit>

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

                        <bool>true</bool>

                </edit>

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

                        <bool>true</bool>

                </edit>

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

                        <const>hintfull</const>

                </edit>

        </match>

        <!-- Disable autohint for bold fonts, otherwise they look *too* bold -->

        <match target="font">

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

                        <const>medium</const>

                </test>

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

                        <bool>false</bool>

                </edit>

        </match>

        <!-- Reject bitmap fonts in favour of Truetype, Postscript, etc. -->

        <selectfont>

                <rejectfont>

                        <pattern>

                                <patelt name="scalable">

                                        <bool>false</bool>

                                </patelt>

                        </pattern>

                </rejectfont>

        </selectfont>

</fontconfig>
```

----------

## IvanMajhen

 *albright wrote:*   

> Sorry if this has already been mentioned (the thread is too
> 
> long for me look through the whole thing  ) but it is very
> 
> important to get the proper dpi for your monitor.
> ...

 

What resolution are you using? 

I have 1280x800 and detected  dpi is 98x96. My fonts are looking great. Also tried 96x96 but i don't see any difference. I think that detected dpi is good, since it is widescreen.

----------

## boniek

 *prymitive wrote:*   

> ...

 

Read and follow the guide carefully. Come back when you do!

----------

## na641

the newest versions seem to be improving! Ive noticed much better font rendering, especially windows vista fonts (consolas, cambria, etc.) which previously really sucked.

----------

## albright

 *Quote:*   

> What resolution are you using? 
> 
>  I have 1280x800 and detected dpi is 98x96. My fonts are looking great. Also tried 96x96 but i don't see any difference. I think that detected dpi is good, since it is widescreen.

 

My res is (under twinview) 2560x1024 (really two 1280x1024). I *think*

I noticed a real difference, but this area is rife with subjectivity I must

admit  :Smile:  Especially improved were the color fringes that subpixel rendering

induces sometimes. Now the only bad character for me is the "=" sign

in some apps ...

----------

## prymitive

 *boniek wrote:*   

>  *prymitive wrote:*   ... 
> 
> Read and follow the guide carefully. Come back when you do!

 

```
acer prymitive # emerge -1pv libXft freetype

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

Calculating dependencies... done!

[ebuild   R   ] x11-libs/libXft-2.1.12  USE="newspr -debug" 0 kB [2]

[ebuild   R   ] media-libs/freetype-2.3.2  USE="zlib -bindist -doc" 0 kB [2]

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

Portage overlays:

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

 [2] /usr/portage/local/layman/xeffects

 [3] /usr/local/overlays/kadu

 [4] /usr/local/overlays/local
```

I've did all howto steps, results are the same, my Lucida Grande UI font is bigger than before.

----------

## na641

I've noticed some trends with this font rendering method.  With non native fonts (particularly vista and osx fonts), a majority of the time they are rendered HORRIBLY.  With full hinting turned on, HandelgotD, Lucida Grande, Calibri, etc. are completely messed up.  Sometimes they are rendered very strongly (bold) when they are set to 'normal' weight for some odd reason.  Sometimes when set to a 'light' version of the font, they are so light that they don't even render fully (parts of the fonts lines will be missing).  Sometimes they are rendered are strange heights. I have my theories, but i believe these issues are due to the fact that these fonts were designed with cleartype anti-aliasing in mind (especially the vista fonts), which is throwing off the new truetype renderer.

In an earlier post i stated that my fonts (which at the time were comprised of those listed above) looked best with slight hinting, and i believe this is why.  The hinting isn't as extreme, so the effect is minimal.  I still have my hinting set to slight, which is what i personally would recommend for those using fonts akin to the ones ive listed.

I will say however, that as each new version of freetype and related packages are released more and more of these issues are being corrected.  My favorite console font, Consolas (from vista), renders absolutely beautiful now with full hinting turned on, whereas previously it was one of the worst examples of not so nice rendering.  Very nice to see tangible differences with each new release.  Can't wait for the next one.

----------

## ehud

 *prymitive wrote:*   

> Hi,
> 
> I tried this ebuild (from xeffects overlay) but my fonts are now bigger than before, does anyone have this problem?
> 
> my freetype 2.1.10-r2 http://pcserwis.net/img/freetype-2.1.10.png
> ...

 

Same problem here.

----------

## na641

 *prymitive wrote:*   

>  *boniek wrote:*    *prymitive wrote:*   ... 
> 
> Read and follow the guide carefully. Come back when you do! 
> 
> ```
> ...

 

You didn't follow all the steps. your local.conf isn't right. also, your lucida grande ui is going to be larger even when you fix your local.conf

----------

## prymitive

 *na641 wrote:*   

>  *prymitive wrote:*    *boniek wrote:*    *prymitive wrote:*   ... 
> 
> Read and follow the guide carefully. Come back when you do! 
> 
> ```
> ...

 

I have local.conf with those settings. So there is no fix for that? I can set my font to size 8 (now 9) but then i will be smaller, I just want it to look like it rigth now.

----------

## BRPXQZME

 *IvanMajhen wrote:*   

> I have 1280x800 and detected dpi is 98x96. My fonts are looking great. Also tried 96x96 but i don't see any difference. I think that detected dpi is good, since it is widescreen.

 I'm thinking it's not the one dimension being off so much as the dimensions being mismatched and improper (perhaps the font was not designed to look good at 95 dpi?).

I've been using this for a few days now, and after chucking most of my bitmap fonts (actually, almost all of them) I have almost everything looking pretty nicely antialiased.  I also changed the main fonts from Bitstream Vera to DejaVu (the hinting is better on certain bits).  I did have trouble with certain sizes of a certain font at 98x98 dpi, so I added a section to .fonts.conf that forced autohinting.

```
<!-- This font looks awful at certain sizes -->

 <match target="font">

         <test name="family">

                 <string>Trebuchet MS</string>

         </test>

         <test name="pixelsize" compare="more_eq">

                 <double>12.5</double>

         </test>

         <test name="pixelsize" compare="less">

                 <double>16.5</double>

         </test>

         <edit name="autohint">

                 <bool>true</bool>

         </edit>

 </match>
```

Likewise, if bitmapped fonts tee you off when you're reading, say, Japanese, you can fix that by adding a rule that sets "embeddedbitmap" to false, so that the embedded bitmap in whatever font won't get used.

(Please update the ebuild to match the version number in portage! Thanks.)

----------

## boniek

 *BRPXQZME wrote:*   

> (Please update the ebuild to match the version number in portage! Thanks.)

 

There is no need. You can and should use freetype from portage. Only thing you need from overlay is cairo and libXft with newspr use flag turned on.

As for fonts being bigger after enabling new subpixel rendering - I can do nothing about it. If it bothers you and you consider it a regression/bug, report it upstream.

----------

## GoofyX

Latest revision (583) from xeffects overlay has an updated ebuild for freetype, which fails to emerge because of digest error:

```
>>> Downloading 'http://manta.univ.gda.pl/~rbonieck/freetype-2.3.2_p20070330.tar.gz'

--00:09:40--  http://manta.univ.gda.pl/~rbonieck/freetype-2.3.2_p20070330.tar.gz

           => `/usr/portage/distfiles/freetype-2.3.2_p20070330.tar.gz'

Resolving manta.univ.gda.pl... 153.19.7.200

Connecting to manta.univ.gda.pl|153.19.7.200|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 1588243 (1.5M) [application/x-gzip]

100%[============================================================================>] 1588243      107.05K/s    ETA 00:00

00:09:55 (105.50 KB/s) - `/usr/portage/distfiles/freetype-2.3.2_p20070330.tar.gz' saved [1588243/1588243]

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

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

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

 * checking freetype-2.3.2_p20070330.tar.gz ;-) ...                                                               [ !! ]

!!! Digest verification failed:

!!! /usr/portage/distfiles/freetype-2.3.2_p20070330.tar.gz

!!! Reason: Failed on RMD160 verification

!!! Got: 7ecc122583f21339d15f976f75b6903ea46e554c

!!! Expected: ead9ff98ceef3e7541206b760be07dfdbffcba84
```

----------

## boniek

Right. Sorry for that. Should be fixed in r585.

----------

## depontius

I just stumbled onto this thread while chasing down a locking problem with xcb, which I put on several systems yesterday. I've read the guide, and have a few thoughts:

 *boniek wrote:*   

> All packages (revelant to this topic) are ~arch, and freetype is M~arch. Unmask freetype in /etc/portage/package.unmask and, if you are using stable tree, set appropriate keywords for corresponding packages in /etc/portage/package.keywords (more details about how to use portage is found here). Also remember to add
> 
> ```
> source /usr/portage/local/layman/make.conf
> ```
> ...

 

First, in the guide rather than simply setting the 3 packages to ~arch in /etc/portage/package.keywords, could you be more specific about the levels? For one thing, in my package.keywords I will install a ~arch to get a specific version to get a specific feature or bugfix, and as soon as that feature or bugfix is stable, I'd just as soon stay stable. So for instance I have a few lines from my package.keywords:

```
<net-fs/openafs-1.4.3 ~x86

<net-fs/openafs-kernel-1.4.3 ~x86

=app-portage/porthole-0.5.0 ~x86
```

I wanted the feature set of openafs-1.4.2 and was willing to go ~arch to get it. But once I had those features I'd rather stay stable. In fact I'm now running openafs-1.4.4, so I could and should remove these lines. For some reason I wanted exactly porthole-0.5.0, so I should really take a look at this. But whenever some later version of porthole goes stable, this line will become removable, as well.

In addition, there have been several people in this thread surprised by new ebuilds becoming available, upgrading, and disturbing their font tuning. By limiting ~arch to a specific range in package.keywords the "surprise effect" and loss of tuning can be reduced.

One other suggestion... To configure the font hinting once installation is done, you suggest either using a desktop applet or setting up $HOME/.fonts.conf. These changes can be made available system-wide for us non-GNOME, non-KDE folks using "/etc/fonts/local.font". (This is a little of The Gentoo Way, as the real file is "/etc/fonts/fonts.conf", which is auto-created.

Oh, I do run some overlays, but tend to try and minimize what I use from them, as well as trying to minimize use of ~arch. More overlays and more ~arch can make the wife, kids, and mother unhappy. On a work machine, stability is valued above all, but sometimes we still want/need a little ~arch even there.

----------

## boniek

 *depontius wrote:*   

> 
> 
> First, in the guide rather than simply setting the 3 packages to ~arch in /etc/portage/package.keywords, could you be more specific about the levels?
> 
> 

 

Levels? I don't understand what you mean by that here. All ~arch packages will stay that way. Cairo and libXft are patched by unofficial code so there is no way for them to ever become stable (proper way of doing all this newspr stuff in cairo is planned for cairo 1.6, dunno about libXft).

 *depontius wrote:*   

> 
> 
> In addition, there have been several people in this thread surprised by new ebuilds becoming available, upgrading, and disturbing their font tuning. By limiting ~arch to a specific range in package.keywords the "surprise effect" and loss of tuning can be reduced.
> 
> 

 

Agreed. I will change guide and add info about masking higher version stuff than is currently available from overlay.

 *depontius wrote:*   

> 
> 
> One other suggestion... To configure the font hinting once installation is done, you suggest either using a desktop applet or setting up $HOME/.fonts.conf. These changes can be made available system-wide for us non-GNOME, non-KDE folks using "/etc/fonts/local.font". (This is a little of The Gentoo Way, as the real file is "/etc/fonts/fonts.conf", which is auto-created.
> 
> 

 

You mean 

```
 # cp ~/.fonts.conf /etc/fonts/local.font
```

?

 *depontius wrote:*   

> 
> 
> Oh, I do run some overlays, but tend to try and minimize what I use from them, as well as trying to minimize use of ~arch. More overlays and more ~arch can make the wife, kids, and mother unhappy. On a work machine, stability is valued above all, but sometimes we still want/need a little ~arch even there.

 

All this stuff is as minimal as possible. Ebuilds are directly derived from the ones from official portage tree. That being said this is just a hack and as long  it stays this way it may break things and it will never become stable.

----------

## depontius

 *boniek wrote:*   

>  *depontius wrote:*   
> 
> First, in the guide rather than simply setting the 3 packages to ~arch in /etc/portage/package.keywords, could you be more specific about the levels?
> 
>  
> ...

 

Here's what I have:

```
hostname ~ # emerge -pv freetype libXft cairo

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

Calculating dependencies... done!

[ebuild   R   ] media-libs/freetype-2.1.10-r3  USE="zlib -bindist -doc" 1,023 kB 

[ebuild   R   ] x11-libs/libXft-2.1.12  USE="-debug" 255 kB 

[ebuild   R   ] x11-libs/cairo-1.2.6  USE="X svg -debug -directfb -doc -glitz" 2,904 kB 

Total: 3 packages (3 reinstalls), Size of downloads: 4,182 kB
```

On the other hand, if I go for ~x86 I get:

```
hostname ~ # ACCEPT_KEYWORDS="~x86" emerge -pv freetype libXft cairo

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

Calculating dependencies... done!

[ebuild  N    ] x11-libs/xcb-util-0.2  USE="-debug" 250 kB 

[ebuild     U ] media-libs/freetype-2.3.3 [2.1.10-r3] USE="zlib -bindist -debug% -doc" 1,417 kB 

[ebuild   R   ] x11-libs/libXft-2.1.12  USE="-debug" 255 kB 

[ebuild     U ] x11-libs/cairo-1.4.2 [1.2.6] USE="X svg xcb%* -debug -directfb -doc -glitz" 3,009 kB 

Total: 4 packages (2 upgrades, 1 new, 1 reinstall), Size of downloads: 4,930 kB
```

Things jump several versions. To do your font work, do I really need the newest, or do I need something between the newest and what I've got now? (Or do I need an overlay because something just isn't in regular portage, at all?)

 *boniek wrote:*   

>  *depontius wrote:*   
> 
> One other suggestion... To configure the font hinting once installation is done, you suggest either using a desktop applet or setting up $HOME/.fonts.conf. These changes can be made available system-wide for us non-GNOME, non-KDE folks using "/etc/fonts/local.font". (This is a little of The Gentoo Way, as the real file is "/etc/fonts/fonts.conf", which is auto-created.
> 
>  
> ...

 

Yes. A trivial point, but still useful, especially with someone not used to The Gentoo Way. If someone simply edited /etc/fonts/fonts.conf he/she might be surprised to find settings disappearing after a boot when local.font is used to regenerate fonts.conf. (Of course they'd deserve it for not reading the signs, "Do not edit by hand, this is auto-generated. Edit local.font instead," or something like that.)

----------

## GoofyX

OK, there's a glitch here. The official portage tree has qt-3.3.8-r2 as stable, though xeffects has it marked as testing.

```
eix -e qt

[I] x11-libs/qt

     Available versions:  

   (3)   3.3.4-r8 3.3.6-r4 ~3.3.6-r5 ~3.3.6-r5[1] ~3.3.8 ~3.3.8[1] ~3.3.8-r1 ~3.3.8-r1[1] 3.3.8-r2 ~3.3.8-r2[1]

   (4)   4.1.4-r2 4.2.2 ~4.2.3 4.2.3-r1

     Installed versions:  3.3.8-r2(3)(12:47:51 ìì 13/04/2007)(cups -debug -doc examples -firebird gif -immqt -immqt-bc -ipv6 mysql -nas -nis odbc opengl -postgres sqlite -xinerama)

           4.2.3-r1(4)(09:59:34 ìì 11/04/2007)(-accessibility cups dbus -debug -doc examples -firebird gif -glib -input_devices_wacom jpeg -mng mysql -nas -nis odbc opengl -pch png -postgres -qt3support sqlite -sqlite3 -xinerama zlib)

     Homepage:            http://www.trolltech.com/

     Description:         The Qt toolkit is a comprehensive C++ application development framework.

[1] /usr/portage/local/layman/xeffects
```

Because qt-unixODBC-3.3.8 depends on qt-3.3.8-r2 and because the overlay has higher priority than the official tree, qt cannot upgrade and thus, it blocks qt-unixODBC-3.3.8 which is marked stable.

Could you please fix this?

----------

## boniek

 *depontius wrote:*   

> Things jump several versions. To do your font work, do I really need the newest, or do I need something between the newest and what I've got now? (Or do I need an overlay because something just isn't in regular portage, at all?) 

 

Of course you don't need newest stuff. Keep in mind that you may want newest versions because of speed improvements, bug and security fixes (this is especially true in case of freetype). If you still want to use older versions of packages remember that xeffects is available through git so you can get older ebuilds by checking out appropriate revision - as long as cairo/libXft have newspr use flag it will work, as for freetype I strongly recommend using latest version from portage (a lot of bug fixes!). I'm trying to keep font related ebuilds as up-to-date as possible because that way works best for me.

 *GoofyX wrote:*   

> ...

 

Thanks for report, but please note that this is support topic for font related ebuilds from xeffects overlay and not for overlay itself. Please inform [nesl247] or [roderick] about your problem.

----------

## GoofyX

 *boniek wrote:*   

> Thanks for report, but please note that this is support topic for font related ebuilds from xeffects overlay and not for overlay itself. Please inform [nesl247] or [roderick] about your problem.

 

Thanks, I will do so.

----------

## roderick

I updated the KEYWORDS in the xeffects ebuild. Should be all ok now.  :Smile: 

----------

## GoofyX

 *roderick wrote:*   

> I updated the KEYWORDS in the xeffects ebuild. Should be all ok now. 

 

Thanks, it's fine now.  :Smile: 

----------

## boniek

Please mask all higher than 1.4.2 cairo versions till overlay update.

EDIT: cairo 1.4.4 in overlay.

----------

## chalex20

Portage has had freetype 2.3.3 for some time already. Are there any plans to include it into the xeffects overlay?

----------

## jorges

Hi,

I followed this guide and I like the results, but there is something annoying me: color fringes around fonts edges. See example

I've read this thread from beginning to end and it seems people are not having this issue. What could be wrong in my case? My LCD monitor? I tried adjusting gamma, but the effect is still there, quite visible on some cases. I tried also playing with dpi settings, same results. Note I say some cases. Sometimes text is rendered beautifully, others not. The appearance of the effect seems related to the font size. The problem doesn't seem to be tied to any specific app. as I see it on xterms, user interface, firefox, mousepad, etc.

I've been playing with settings and versions for the last two days, and I feel lost. Any hints are appreciated. 

My setup: amd64, freetype-2.3.3 (portage, -bindist), cairo-1.4.4 (xeffects, newspr), libXft-2.1.12 (xeffects, newspr), xfce4

jorges

----------

## PaulBredbury

 *chalex20 wrote:*   

> Portage has had freetype 2.3.3 for some time already. Are there any plans to include it into the xeffects overlay?

 

There's no point in duplicating the same ebuild.

 *jorges wrote:*   

> The appearance of the effect seems related to the font size.

 

Use ~/.fonts.conf to customize the font settings.

----------

## jorges

 *PaulBredbury wrote:*   

>  *jorges wrote:*   The appearance of the effect seems related to the font size. 
> 
> Use ~/.fonts.conf to customize the font settings.

 

Hey, it's you again! Since my posts in this thread, I reinstalled everything as per this guide (that's why I post here now), I am also using the .fonts.conf you posted. Do you mean to add something else to it?

jorges

----------

## PaulBredbury

Yes, use a rule like in /etc/fonts/conf.avail/65-fonts-persian.conf to turn off, for large fonts, whatever's causing the undesired effect. E.g.:

```
<match target="font">

    <test name="size" compare="more_eq"><double>24</double></test>

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

</match>
```

Then close & restart firefox, to see the effect.

----------

## jorges

 *jorges wrote:*   

> Hi,
> 
> I followed this guide and I like the results, but there is something annoying me: color fringes around fonts edges. See example
> 
> I've read this thread from beginning to end and it seems people are not having this issue. What could be wrong in my case? My LCD monitor? I tried adjusting gamma, but the effect is still there, quite visible on some cases. I tried also playing with dpi settings, same results. Note I say some cases. Sometimes text is rendered beautifully, others not. The appearance of the effect seems related to the font size. The problem doesn't seem to be tied to any specific app. as I see it on xterms, user interface, firefox, mousepad, etc.
> ...

 

I solved the problem. I had mozilla-firefox-bin installed, which probably wasn't using the right libraries. I did test with mozilla-firefox at a given moment, but for some reason I saw no improvements then (maybe I have to learn when it is better to shutdown the laptop and get some sleep). Thanks to those that tried to help. 

jorges

----------

## santaclaws

Hi there..

I do have two problems.

First it concerns opera and xeffects.

Everything that is posted with the 'code' feature in this forum - I mean the green letters - is displayed really really ugly. The rest is ok.

Any hint?

Second it concerns the choice of wallpapers with xfce 4.4.1

When I use the Tango iconset everything works properly. The wallpaper switch is fast. But if I use my favorite iconset Dropline cpu load rises up to 100 % and it is nearly impossible to change the wallpaper with the xfce background option.

Any hint?

Here is my xorg.conf

```

Section "ServerLayout"

   Identifier   "X.Org Configured"

   Screen   0   "Screen0" 0 0

   InputDevice   "Keyboard0" "CoreKeyboard"

# PS/2 Mouse not detected

# Serial Mouse not detected

   InputDevice   "USB Mouse" "AlwaysCore"

#No Synaptics touchpad found

EndSection

Section "ServerFlags"

   Option   "AllowMouseOpenFail" "true"

   

EndSection

Section "Files"

   FontPath   "/usr/share/fonts/util"

   FontPath   "/usr/share/fonts/encodings"

   FontPath   "/usr/share/fonts/misc"

   FontPath   "/usr/share/fonts/local"

   FontPath   "/usr/share/fonts/terminus"

   FontPath   "/usr/share/fonts/corefonts"

   FontPath   "/usr/local/share/fonts"

   FontPath   "/usr/share/fonts"

   FontPath   "/usr/share/fonts/default"

   FontPath   "/usr/share/fonts/TTF"

   FontPath   "/usr/share/fonts/arphicfonts"

   FontPath   "/usr/share/fonts/jisx0213"

   FontPath   "/usr/share/fonts/shinonome"

   FontPath   "/usr/share/fonts/baekmuk-fonts"

   FontPath   "/usr/share/fonts/kacst-fonts"

   FontPath   "/usr/share/fonts/sgi-fonts"

   FontPath   "/usr/share/fonts/unfonts"

   FontPath   "/usr/share/fonts/default/ghostscript"

   FontPath   "/usr/share/fonts/xfonts-cronyx-100dpi:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-75dpi:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-misc:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-100dpi"

   FontPath   "/usr/share/fonts/xfonts-cronyx-75dpi"

   FontPath   "/usr/share/fonts/xfonts-cronyx-misc"

   FontPath   "/usr/share/fonts/xfonts-cronyx-cp1251-100dpi:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-cp1251-75dpi:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-cp1251-misc:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-cp1251-100dpi"

   FontPath   "/usr/share/fonts/xfonts-cronyx-cp1251-75dpi"

   FontPath   "/usr/share/fonts/xfonts-cronyx-cp1251-misc"

   FontPath   "/usr/share/fonts/xfonts-cronyx-isocyr-100dpi:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-isocyr-75dpi:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-isocyr-misc:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-isocyr-100dpi"

   FontPath   "/usr/share/fonts/xfonts-cronyx-isocyr-75dpi"

   FontPath   "/usr/share/fonts/xfonts-cronyx-isocyr-misc"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8r-100dpi:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8r-75dpi:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8r-misc:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8r-100dpi"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8r-75dpi"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8r-misc"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8u-100dpi:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8u-75dpi:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8u-misc:unscaled"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8u-100dpi"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8u-75dpi"

   FontPath   "/usr/share/fonts/xfonts-cronyx-koi8u-misc"

EndSection

Section "Module"

   Load   "ddc"

   Load   "vbe"

   Load   "GLcore"

   Load   "dbe"

   Load   "dri"

   Load   "extmod"

   Load   "glx"

   Load   "bitmap"

   Load   "speedo"

   Load   "type1"

   Load   "freetype"

   Load   "record"

EndSection

Section "InputDevice"

   Identifier   "Keyboard0"

   Driver   "kbd"

   Option  "XkbLayout" "de" #de,us

   Option  "XkbVariant" "nodeadkeys"

   Option  "CoreKeyboard"

   Option  "XkbRules"   "xorg"

   Option  "AutoRepeat" "500 30"

   Option   "XkbModel" "pc105"

   #Option   "XkbOptions" "grp:toggle,grp_led:scroll,grp:alt_shift_toggle"

   #Option   "XkbVariant" "winkeys"

EndSection

Section "InputDevice"

   Identifier   "Serial Mouse"

   Driver   "mouse"

   Option   "Protocol" "Microsoft"

   Option   "Device" "/dev/ttyS0"

   Option   "Emulate3Buttons" "true"

   Option   "Emulate3Timeout" "70"

   Option   "SendCoreEvents"  "true"

EndSection

Section "InputDevice"

   Identifier   "PS/2 Mouse"

   Driver   "mouse"

   Option   "Protocol" "IMPS/2"

   Option   "Device" "/dev/misc/psaux"

   Option   "Emulate3Buttons" "true"

   Option   "Emulate3Timeout" "70"

   Option   "SendCoreEvents"  "true"

   Option   "ZAxisMapping" "4 5"

EndSection

Section "InputDevice"

   Identifier   "USB Mouse"

   Driver   "mouse"

   Option   "Device" "/dev/input/mice"

   Option   "SendCoreEvents" "true"

   Option   "Protocol" "IMPS/2"

   Option   "ZAxisMapping" "4 5"

   Option   "Buttons" "5"

EndSection

Section "InputDevice"

   Identifier   "Synaptics"

   Driver   "synaptics"

   Option   "Protocol" "event"

   Option   "Device" ""

   Option   "LeftEdge" "1900"

   Option   "RightEdge" "5400"

   Option   "TopEdge" "1900"

   Option   "BottomEdge" "4000"

   Option   "FingerLow" "25"

   Option   "FingerHigh" "30"

   Option   "MaxTapTime" "180"

   Option   "MaxTapMove" "220"

   Option   "VertScrollDelta" "100"

   Option   "MinSpeed" "0.02"

   Option   "MaxSpeed" "0.10"

   Option   "AccelFactor" "0.0010"

   Option   "SHMConfig" "on"

EndSection

# Auto-generated by mkxf86config

Section "Monitor"

   Identifier   "Monitor0"

   HorizSync    30.0 - 60.0

   VertRefresh  60.0 - 60.0

   Option         "dpms" "1"

   Gamma 1.5 1.6 1.6

   Option       "UseEdidDpi"   "false"

   DisplaySize 270 203

   Option "DPI"  "96 x 96"

EndSection

Section "Device"

   ### Available Driver options are:-

   # sw_cursor is needed for some ati and radeon cards

   #Option     "sw_cursor"

   #Option     "hw_cursor"

   #Option     "NoAccel"

   Option     "ShowCache"

   Option     "ShadowFB"

   Option     "UseFBDev"

   Option     "Rotate"

   Identifier  "Card0"

   # The following line is auto-generated by x11-misc/mkxf86config

   Driver      "i810"

   VendorName  "Intel"

   BoardName   "Intel Corporation 82815 CGC "

   BusID       "PCI:0:2:0"

   VideoRam        16384

   Option          "NoAccel"       "false"

   Option          "DRI"           "true"

   Option     "RenderAccel"   "true"

EndSection

Section "Screen"

   Identifier   "Screen0"

   Device   "Card0"

   Monitor   "Monitor0"

   DefaultColorDepth 24

   SubSection "Display"

      Viewport   0 0

      Depth   16

      Modes "1024x768" "800x600" "640x480"

   EndSubSection

   SubSection "Display"

      Viewport   0 0

      Depth   24

      Modes "1024x768" "800x600" "640x480"

   EndSubSection   

EndSection

Section "DRI"

   Mode 0666

EndSection

```

And here is my  ~/.fonts.conf (I tried PaulBredburies version from here https://forums.gentoo.org/viewtopic-t-553246-highlight-.html)

```

<?xml version="1.0"?> 

<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> 

<fontconfig> 

   <!-- Info: 

   http://forums.gentoo.org/viewtopic-t-511382.html 

   http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts 

   http://wiki.archlinux.org/index.php/XOrg_Font_Configuration 

   --> 

   <!-- Reject bitmap fonts in favour of Truetype, Postscript, etc. --> 

   <selectfont> 

      <rejectfont> 

         <pattern> 

            <patelt name="scalable"> 

               <bool>false</bool> 

            </patelt> 

         </pattern> 

      </rejectfont> 

   </selectfont> 

   <!-- Replace Courier with a better-looking font --> 

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

      <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> 

   <!-- Replace Courier New with a better-looking font --> 

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

      <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> 

   <!-- hintnone, hintslight, hintmedium, hintfull --> 

   <!-- Keep autohint off --> 

   <match target="font"> 

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

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

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

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

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

   </match> 

   <!-- 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> 

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

   </match> 

</fontconfig>

```

Suggestions welcome   :Very Happy: 

----------

## boniek

 *santaclaws wrote:*   

> Hi there..
> 
> I do have two problems.
> 
> First it concerns opera and xeffects.
> ...

 

Please provide screenshot  :Smile:  (it should look like [this] with fonts forced to verdana/bitstream vera sans mono)

BTW If you want support follow guide closely (e.g. use hintfull instead of hintslight).

----------

## PaulBredbury

 *santaclaws wrote:*   

> Everything that is posted with the 'code' feature in this forum - I mean the green letters - is displayed really really ugly.
> 
> ...
> 
>    <!-- Replace Courier with a better-looking font --> 
> ...

 

Don't forget that those rules are useless if the replacement fonts aren't installed on your system.

With fonts, one person's ugly is another person's attractive - just as with women (ducks and runs).

Flick through the fonts you have installed, and choose ones that you like. Also check the font configuration in your browser very carefully.

I think a photograph of the screen is the best thing to show - the screen might be messing up perfectly good fonts, if e.g. the DPI setting is bad for the monitor.

----------

## Pajarico

boniek: I see there is a higher version on xeffects overlay than portage, should we upgrade? (if so, where can I fetch freetype-2.3.4_p20070414.tar.gz?)

EDIT Nevermind. Just sync'd portage and freetype-2.3.4 is on the tree. I guess 2.3.4 is higher than 2.3.4-p*?

----------

## PaulBredbury

emerge =freetype-2.3.4_p20070414

It is the latest version, and is higher than freetype-2.3.4

----------

## Pajarico

Ah, ok. I thought "p" stood for "pre", but I guess it means "patch"? Now I can access the file.

----------

## santaclaws

 *PaulBredbury wrote:*   

>  *santaclaws wrote:*   Everything that is posted with the 'code' feature in this forum - I mean the green letters - is displayed really really ugly.
> 
> ...
> 
>    <!-- Replace Courier with a better-looking font --> 
> ...

 

Here is a screenshot of my desktop:

http://senduit.com/fbe322

----------

## santaclaws

 *boniek wrote:*   

>  *santaclaws wrote:*   Hi there..
> 
> I do have two problems.
> 
> First it concerns opera and xeffects.
> ...

 

I followed the guide closely. 

http://wiki.gentoo-xeffects.org/Font_Rendering

And my problem only appears with opera. I tried out several versions of that browser and reinstalled it - but that gave me nothing.  :Sad: 

Firefox or seamonkey work perfectly. It is a really strange effect.

----------

## santaclaws

 *PaulBredbury wrote:*   

>  *santaclaws wrote:*   Everything that is posted with the 'code' feature in this forum - I mean the green letters - is displayed really really ugly.
> 
> ...
> 
>    <!-- Replace Courier with a better-looking font --> 
> ...

 

I do have Courier and CourierNew installed. 

A screenshot of my desktop is to be found above.

 *Quote:*   

> With fonts, one person's ugly is another person's attractive - just as with women (ducks and runs).

 

 :Laughing: 

----------

## bladus

Okay, i just installed everything and i'm amazed. Everything is so much more readable and easier on my eyes.

I didn't know how crappy my fonts looked before ... Thank you!

----------

## MartyMcFly

Yes, my fonts look pretty good now. But I still have a problem, there's like a tiny red halo sometimes, and maybe a little bit of yellow too (in sectors where black touches white... like white backgrounds with black letters)... do you know why could this be? I have a 19" LCD, the latest version of cairo, libXft and freetype, I followed the guide to the letter.

Thanks!

----------

## PaulBredbury

 *MartyMcFly wrote:*   

> tiny red halo sometimes, and maybe a little bit of yellow too

 

Try changing the "subpixel order" (rgb, etc.).

Otherwise, switch from subpixel smoothing to greyscale.

----------

## boniek

 *PaulBredbury wrote:*   

> 
> 
> Otherwise, switch from subpixel smoothing to greyscale.

 

You are effectively disabling newspr this way  :Wink: 

Like Paul said, try to change subpixel order to something else. Please post a screen shot.

----------

## |Quantum|

What does the overlay actually do ? All default versions in portage are higher.

Also I don't see this "newspr"-flag, even when I unmask all packages and use 

ACCEPT_KEYWORDS="~amd64" emerge -pv cairo

I watched a friend's laptop with Ubuntu. The fonts are small and gorgeous. My Gentoo-box has much bigger fonts and look ugly, even after I followed every possible font-howto.

Also I still have a kind of colored "fuzzyness" around the characters. Changing subpixel hinting types doesn't change anything or for worse.

----------

## hornett

I followed this guide before and it worked nicely, but I tried it on a fresh system, and it didn't make any difference.

As above, the newspr flag didn't seem to get applied during the build...

----------

## vonr

FYI, the cairo patch does not apply against the newest cairo version (1.4.8).

After some looking around, I found out that the guys from PLD Linux are actively maintaining the patches. You can find the cairo patch here. It applies fine against 1.4.8.

----------

## no_point

 *boniek wrote:*   

>  *santaclaws wrote:*   Hi there..
> 
> I do have two problems.
> 
> First it concerns opera and xeffects.
> ...

 

Hello, I have the same problem with Opera:

```
This font is not antialiased and looks ugly.
```

Could you tell me how did you force this font on your screenshot. I tried messing around with the settings in Tools->Preferences->Web Pages and Advanced->Fonts, but nothing seems to have effect.

EDIT: Nevermind. Added:

```
<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>

```

to my /etc/fonts/local.conf.

----------

## boniek

 *vonr wrote:*   

> FYI, the cairo patch does not apply against the newest cairo version (1.4..
> 
> After some looking around, I found out that the guys from PLD Linux are actively maintaining the patches. You can find the cairo patch here. It applies fine against 1.4.8.

 

Be aware that there are known problems with cairo-1.4.8.

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=243811

----------

## vonr

 *boniek wrote:*   

> Be aware that there are known problems with cairo-1.4.8.
> 
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=243811

 

They seem to be fixed in the ebuild though: see this bug. Anyway, I don't use OpenOffice, so I can't reproduce anything anyway.

----------

## TuxTom

Hey folks,

I updated cairo to 1.4.8 with newspr patch, it was available from XEffects-overlay this morning. It really destroyed part of my font-rendering (no more window titles, just squares), checking the logs showed some pango-warning about bad shape (can't remember exactly). Tried all kind of solution that was available on the web, but could only resolve it by masking cairo-1.4.8 and downgrading again.

Just in case anyone stumbles upon this problem....

Greets, Tuxtom

----------

## GoofyX

Thanks for the info!

That explains why Firefox is really screwed up. I will immediately downgrade.

----------

## vonr

 *TuxTom wrote:*   

> I updated cairo to 1.4.8 with newspr patch, it was available from XEffects-overlay this morning. It really destroyed part of my font-rendering (no more window titles, just squares), checking the logs showed some pango-warning about bad shape (can't remember exactly).

 

I had the same problem after I hand-modified this thread's patch to apply against 1.4.8. I guess something important changed in cairo-ft-font.c.

Try using the patch I mentioned earlier; it hasn't given me these problems.

----------

## boniek

I was aware of problems with cairo-1.4.8 so I did not update it in xeffects for that very reason. Someone did it for me though. Please mask it for now.

----------

## Vlad.Sharp

Please take a look at Cairo 1.4.8 breaks pango and all gtk apps. because cairo 1.4.8 seems to break even without xeffects patches.

----------

## roderick

Problem is fixed in xeffects overlay now.

I updated the patch. I must have missed something when I initially updated the patch for 1.4.8.

The patch posted earlier in this thread seems to work fine against 1.4.8, so I updated the overlay with that one.

Cheers.

----------

## TuxTom

Can anyone confirm, that the new patch fixes the problem? As Vlad stated above, cairo-1.4.8 seems to be broken even without the old x-effects patch, so the new patch would have to fix it in addition to providing newspr...

Sorry, I haven't got the time for a test myself at the moment.

[EDIT] OK, just took myself the time to try and.... it seems to work!

----------

## Vlad.Sharp

I can confirm, 1.4.8 cairo from xeffects now fixes it. Time to get newspr into portage   :Twisted Evil: 

----------

## Finswimmer

Hmm. Not working for me:

```
[09:09:15]|[tobi@tobi-rechner]|~

$emerge cairo libXft freetype -pv

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

Calculating dependencies... done!

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

[ebuild   R   ] x11-libs/libXft-2.1.12  USE="newspr -debug" 0 kB [3]

[ebuild   R   ] media-libs/freetype-2.3.4-r2  USE="X zlib -bindist -debug -doc" 0 kB

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

Portage overlays:

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

 [2] /usr/portage/local/layman/kde

 [3] /usr/portage/local/layman/xeffects

 [4] /usr/portage/local/layman/xeffects-experimental

 [5] /usr/local/portage

```

```
[09:10:42]|[tobi@tobi-rechner]|~

$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>

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

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

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

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

 </match>

</fontconfig>
```

I tried to get it to work yesterday for the first time.

Tobi

----------

## Vlad.Sharp

How **recent** is your checkout? try "svn up /usr/portage/local/layman/xeffects". You should be at revision 655...

----------

## Sappling

Wow, just wow.  This is absolutely incredible it's as if I just added $500 to my monitor value, subpixel rendering is a must have.

----------

## Finswimmer

 *Vlad.Sharp wrote:*   

> How **recent** is your checkout? try "svn up /usr/portage/local/layman/xeffects". You should be at revision 655...

 

```
$layman -S

* Running command "/usr/bin/svn update "/usr/portage/local/layman/nx""...

At revision 178.

* Running command "/usr/bin/svn update "/usr/portage/local/layman/kde""...

At revision 1108.

* Running command "/usr/bin/svn update "/usr/portage/local/layman/xeffects""...

At revision 655.

* Running command "/usr/bin/svn update "/usr/portage/local/layman/xeffects-experimental""...

At revision 655.

*

* Success:

* ------

*

* Successfully synchronized overlay "nx".

* Successfully synchronized overlay "kde".

* Successfully synchronized overlay "xeffects".

* Successfully synchronized overlay "xeffects-experimental".

```

Seems at it is at 655. I also reinstalled cairo and libXft.

 *Quote:*   

>  subpixel rendering is a must have.

 

Do I have to enable subpixel in a different way?

Tobi

----------

## Vlad.Sharp

Ok, now this is plain **weird**. I just copied some fonts from my windows box to a folder /usr/share/fonts/win (made readeable and put into xorg.conf) - restarted X - and now the rectangular boxes are back (and a warning about Tahoma, the usual Pango message...). If move the directory away (so that X doesn't know where it is) and restart X, the Gtk applications are back and rendering fonts as usual...

Edit: It seems it was a permissions and a fonts.dir issue. Needed to update font.dir by running mkfontdir and then adjusting permissions on the directory. But the symptoms were exactly the same... >_< Now that wasn't a cairo 1.4.8 issue  :Very Happy: 

----------

## Finswimmer

```
[17:53:26]|[tobi@tobi-rechner]|~

$firefox

No running windows found

(Gecko:1796): Pango-WARNING **: shape engine failure, expect ugly output. the offending font is 'Bitstream Vera Sans Not-Rotated 9.9990234375'

(Gecko:1796): Pango-WARNING **: shape engine failure, expect ugly output. the offending font is 'Bitstream Vera Sans Oblique Not-Rotated 9.9990234375'

(Gecko:1796): Pango-WARNING **: shape engine failure, expect ugly output. the offending font is 'Verdana Bold Not-Rotated 9'

(Gecko:1796): Pango-WARNING **: shape engine failure, expect ugly output. the offending font is 'Verdana Not-Rotated 8.25'

(Gecko:1796): Pango-WARNING **: shape engine failure, expect ugly output. the offending font is 'Verdana Not-Rotated 7.5'

(Gecko:1796): Pango-WARNING **: shape engine failure, expect ugly output. the offending font is 'Verdana Bold Not-Rotated 8.25'

(Gecko:1796): Pango-WARNING **: shape engine failure, expect ugly output. the offending font is 'Verdana Not-Rotated 9'

(Gecko:1796): Pango-WARNING **: shape engine failure, expect ugly output. the offending font is 'Courier New Not-Rotated 8.25'

(Gecko:1796): Pango-WARNING **: shape engine failure, expect ugly output. the offending font is 'Verdana Not-Rotated 6.75'

(Gecko:1796): Pango-WARNING **: shape engine failure, expect ugly output. the offending font is 'Verdana Not-Rotated 12'

/usr/libexec/mozilla-launcher: line 119:  1796 Segmentation fault      $(type -P aoss) "$mozbin" "$@"

firefox-bin exited with non-zero status (139)

```

This is the result when I start firefox.

```
[18:38:59]|[tobi@tobi-rechner]|~

$grep rend /var/log/Xorg.0.log

        X.Org Font Renderer : 0.5

        Module class: X.Org Font Renderer

        ABI class: X.Org Font Renderer, version 0.5

        Module class: X.Org Font Renderer

        ABI class: X.Org Font Renderer, version 0.5

(**) NVIDIA(0): Option "RenderAccel" "true"

(**) NVIDIA(0): Enabling RENDER acceleration

(II) Initializing built-in extension RENDER

```

Tobi

----------

## roderick

 *Finswimmer wrote:*   

> 
> 
> ```
> [17:53:26]|[tobi@tobi-rechner]|~
> 
> ...

 

Your problem sounds just like other users, however, if you have the update cairo + patch from the overlay, the problem is fixed. So, I am unsure why you are seeing this.

You may want to try and re-emerge pango and gtk+ (emerge -1v pango gtk+).

Did this happen with cairo 1.4.6? Did you only recently start using the newspr use flag and the xeffects overlay, or have you had this newspr previously working under cairo 1.4.6?

----------

## Pajarico

Fixed for me.

----------

## Finswimmer

 *roderick wrote:*   

>  *Finswimmer wrote:*   
> 
> ```
> [17:53:26]|[tobi@tobi-rechner]|~
> 
> ...

 

emerge -1v pango gtk+ did not help.

I started recently to use the newspr use flag. 

I also re-emerged gnucash which also has problems with the fonts, but it did not helped.

revdep-rebuild does not report any errors.

Thanks

Tobi

----------

## GoofyX

Layman reports error:

```
* 

* Errors:

* ------

* 

* Failed to sync overlay "xeffects".

* Error was: Syncing overlay "xeffects" returned status 256!

* 
```

----------

## Finswimmer

 *GoofyX wrote:*   

> Layman reports error:
> 
> ```
> * 
> 
> ...

 

layman -d xeffects

layman -a xeffects

----------

## GoofyX

Thanks.

----------

## Finswimmer

 *Finswimmer wrote:*   

>  *roderick wrote:*    *Finswimmer wrote:*   
> 
> ```
> [17:53:26]|[tobi@tobi-rechner]|~
> 
> ...

 

Everything is fine now. Just had to re-emerge cairo though I thought I had done this. But it was not... :/

But I can not see any real difference?

Thanks

----------

## Vlad.Sharp

In DE's like Gnome, Xfce or KDE, find the control panel option for User Interface/Fonts (or similar), and then turn on subpixel rendering (on LCD monitors) and full hinting at 96x96 DPI (for LCD and Laptop screens again). The order of colours you want is usually RGB. That should fix it.

----------

## anz

Thanks alot, Dear Finswimmer!

```
layman -d xeffects

layman -a xeffects
```

... now "emerge -S xeffects" works again!

----------

## xcable

Excellet!!

The font rendering is much better.  I was quite annoyed by the fact that Windows XP looks better on my new LCD screen than Linux does, but now Linux's fonts are as good or better than Windows XP.  This is a must have for anyone that is using a LCD with lower than 96 native DPI (most are).

Does anyone know when these programs are going to unmasked?

--

heath holcomb

bulah.com

----------

## Da Fox

I'm sorry but I just can't get it to work right in kde. Bit of background: I used to have great font rendering in gnome, but I recently b0rked my install and decided to try kde for a change.

However I still haven't been able to get proper anti-aliasing working.

I have an IBM T42 laptop, which has a 15", 1400x1050 laptop screen. I measured the panel at ~304x228mm, and I think this means the DPI of this screen is 117 (1400/(304/25.4) = 116.9736842).

I think I have it almost working in GTK apps though, as it looks really nice in firefox (aside from the fonts being to large/small because of DPI (I think). Is there anyway to set the fonts for GTK apps from kde, or is there some config file I haven't found yet?)

To illustrate the problem (since I can't really describe it well) I made this screenshot. (left: firefox, right: kcontrol)

The best I can describe it is that the letters are rendered off-pixel-center... the 'stalk' from the 'd' is smeared across 3(!) pixels in KDE, whereas firefox perfectly renders it one pixel wide.

I've been playing with the settings in "KDE Control Center" -> "Fonts" -> "Use anti-aliasing for fonts", but I just can't get it right. As far as I can tell all that those settings do is change some things in ~/.fonts.conf, which I've set to the settings posted in the wiki.

Any help would be truly appreciated, my eyes are starting to hurt from the blurry fuglyness of kde ;(

--edit:

I found this quote:  *boniek wrote:*   

> Your screenshot should look like [this] - xft and cairo should look identical. Please post result of running following command:
> 
> ```
> emerge -pv x11-libs/cairo x11-libs/libXft media-libs/freetype
> ```
> ...

 

My cairo looks excellent (like firefox in my screenshot) whereas xft looks fugly (like kcontrol in my screenshot). I'm going to run the stated command now, and hope that fixes something. (or at least not break cairo :0)

--edit:

So far it hasn't helped, I'm currently 

```
emerge -1pvt app-text/poppler-bindings dev-python/pycairo gnome-base/librsvg x11-libs/gtk+ x11-libs/pango virtual/xft x11-apps/xclock x11-libs/pango x11-terms/xterm app-text/poppler gnome-base/librsvg kde-base/kcontrol media-gfx/fontforge media-libs/fontconfig media-libs/gd media-libs/imlib2 media-libs/libwmf x11-apps/mkfontscale x11-libs/cairo x11-libs/libXfont x11-libs/libXft x11-libs/pango x11-libs/qt x11-libs/qt
```

pretty much everything that depends on cairo, libXft or freetype. We'll see if that helps  :Smile: 

--edit:

Well, it hasn't helped. From what I've read the output from pango-view with the cairo backend should be identical to the output with the xft backend but it isn't. Same difference as in the screenshot  :Sad: 

Please help, I can't take the blur anymore !

----------

## ExZombie

Funny. I've been pondering about this "smeared" pixels for a long time and your screenshot makes is way easier to explain.

You see, all of my fonts look like your kcontrol. If I make a screenshot and zoom in, I see exactly the same. The funny thing is, (and that's what I've been wondering about) without zooming in, I don't see that "smear". I guess that means the way the fonts are rendered fits my LCD panel perfectly. Is that correct? It makes some sense.

If that's true then it would explain why I can't see what you're complaining about. Your kcontrol looks better than your firefox on my panel  :Smile:  . Unfortunately, I can't answer why they look different in the first place.

FYI, I'm using VRGB sub-pixel rendering. I guess you need RGB.

----------

## Da Fox

I've tried both RGB and BGR (even though I know my LCD has RGB ordering), but the fonts are rendered exactly the same. (Do I need to restart X for changes in the subpixel ordering to take effect? All other things such as hinting and anti-aliasing immediately affect newly started applications.). The are all rendered like the screenshot, orange on the left, blue on the right. Should that not reverse when I change from RGB to BGR ordering?

Further, I've been looking at all the screenshots posted in this topic, and they all show this blur. Also the 'original' screenshot, the one posted to some mailing list, has the same 'blur'. I guess that means that this is the way the fonts are supposed to look?

But if that is so then I don't understand what hinting does, because as far as I know 'hinting' is the process of adapting the shape of font glyphs before they are sent to the rasterizer such that certain features and shapes are retained, for example forcing the stems of the letter 'm' to fall in integral pixels. (See the screenshot in this wiki link, and some more explanation on font rasterization here). From what I see it looks as if there is something wrong with the font hinting in this new subpixel renderer?

In either case, I don't like it, and would really prefer my KDE fonts to look the way my GTK are and always have looked. Isn't there anyway I can tell KDE to use Cairo for font rendering, or am I spouting nonsense here...  :Smile: 

(I think maybe cairo and qt are two different implementations of the same thing, I think this holds true at least for Qt4, but I don't really know anything about cairo or qt other than that one looks pwitty and the other does not :p)

----------

## enderandrew

Given that even the Trolltech guys are pushing for universal text layout with Pango, I think we'll be at a point very soon when text rendering is all the same on Linux boxes, if not all boxes that wish to take advantage of stuff like Pango.

----------

## Da Fox

YES!

I finally found /some/ proof that is *should* be possible to get nice anti-aliasing even in kde/qt: screenshot

This came from the Arch-linux forums, bij someone named 'emmybear' (second post from the top). As you can see, all text is rendered the way I want it, with 'pixel-perfect-hinting', and the screenshot appears to be taken from KDE, as you can see the characteristic KDE taskbar, konqueror and konsole.

Now I've tried what he/she said (put only the DPI setting in local.conf, and AA and hinting max in kcontrol), but it doesn't help, fonts are still rendered blurry* in Qt and sharp** in GTK, and in fact I can't tell anything is different from before  :Sad: .

I really don't understand, don't qt and gtk _both_ use the *same* font.conf, and don't they _both_ render text ultimately with freetype?

* **: relative to my point of view / preference

--edit:

And yet another small step in the right direction:

I've discovered that the 'blur' is actually a new 'lcd filter', and that the lcd filtering that I want is now called 'legacy lcd filter'.

Here is a pretty good explanation of it: http://www.mail-archive.com/freetype-devel@nongnu.org/msg01846.html

Basically it says that incase you have very good byte-code-hinted fonts (which I do, as I mostly use bitstream-vera) this filter is sharper than the new filter, but in all other cases is better to use the new filter.

A nice way to see the difference is to use the 'ftdiff' tool, it allows you to change a lot of parameters on-the-fly. (press F1 for a quick overview).

For example to view bitstream-vera-sans rendered at 96 dpi, fontsize 12 you'd do:

```
ftdiff -r 96 -s 12 /usr/share/fonts/ttf-bitstream-vera/Vera.ttf
```

So now I need to know where I can select which lcd filter to use, and tell it that I want it to use the legacy filter. Does anyone know how to do that? Can it be done through .fonts.conf/fonts.local?

----------

## boniek

 *David Turner wrote:*   

> The "legacy" LCD filter corresponds to the current implementation found in LibXft and Cairo

 

If you want effect like the other guy don't use this overlay at all. Install cairo, libxft from portage, enable bytecode interpreter and disable autohinter. If that won't work, at some point in xeffects overlay you could choose what filter you want by setting appropriate use flag. Look through older revisions of freetype ebuild to see how that can be done (I've removed them because Turner considers legacy filter deprecated).

----------

## IvanMajhen

I just tested ftdiff with freetype 2.3.5, and in my opinion lcd filter light is the best for me. Can we set this filter with fontconfig?

I modified freetype that it uses lcd filter light by default.

Screenshot:

http://shrani.si/files/snapshot513c7b.png

----------

## roderick

boniek,

Cairo 1.4.10 wasn't bumped in the overlay yet. We need to keep on top of these bumps, as users may install these unwittingly and cause problems.

This was bumped on June 28th.

For anyone who has currently installed cairo 1.4.10, you do not have the newspr patch. Either go back to 1.4.8 from overlay or re-emerge cairo 1.4.10 (as soon as I have had a chance to update the overlay). 

Hopefully, we can get this updated today.

Cherers,

Rod.

----------

## roderick

Ok. Cairo updated.

Please re-emerge if you had previously installed 1.4.10 from portage.

emerge -1v cairo pango gtk+

Cherrs,

Rod.

----------

## PaulBredbury

 *IvanMajhen wrote:*   

> light is the best for me.

 

In ~/.fonts.conf

```
    <!-- hintnone, hintslight, hintmedium, hintfull -->

    <match target="font">

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

    </match>
```

----------

## anli

BTW, freetype 2.3.5 is in official ~portage now.

----------

## IvanMajhen

 *PaulBredbury wrote:*   

>  *IvanMajhen wrote:*   light is the best for me. 
> 
> In ~/.fonts.conf
> 
> ```
> ...

 

This is not what i'm looking for. This is hinting style. 

#elif defined( FT_FORCE_LIGHT_LCD_FILTER ) ---> i wan't this to  set with fontconfig. I patched freetype to use this and fonts look much smoother.

----------

## PaulBredbury

Yes, the fonts are a bit crisper:

```
diff -u freetype-2.3.4_p20070428.ebuild-orig freetype-2.3.4_p20070428.ebuild

--- freetype-2.3.4_p20070428.ebuild-orig        2007-07-04 17:46:27.000000000 +0100

+++ freetype-2.3.4_p20070428.ebuild     2007-07-04 17:46:27.000000000 +0100

@@ -12,7 +12,7 @@

 LICENSE="FTL GPL-2"

 SLOT="2"

 KEYWORDS=""

-IUSE="demos zlib bindist doc"

+IUSE="demos zlib bindist doc light"

 

 # The RDEPEND below makes sure that if there is a version of moz/ff/tb

 # installed, then it will have the freetype-2.1.8+ binary compatibility patch.

@@ -57,6 +57,12 @@

 

        disable_option FT_CONFIG_OPTION_OLD_INTERNALS

 

+       if use light ; then

+               sed -i \

+                       -e "/FT_END_HEADER/i\#define FT_FORCE_LIGHT_LCD_FILTER" \

+                       include/freetype/config/ftoption.h || die "sed ftoption.h light"

+       fi

+

        elibtoolize

        epunt_cxx

 }
```

----------

## IvanMajhen

This is what i'm talking about.   :Cool:  They also look better to me.

I thought that there is some fontconfig option, and not hardcoding this in freetype. 

This should go into xeffects.

----------

## Da Fox

 *boniek wrote:*   

>  *David Turner wrote:*   The "legacy" LCD filter corresponds to the current implementation found in LibXft and Cairo 
> 
> If you want effect like the other guy don't use this overlay at all. Install cairo, libxft from portage, enable bytecode interpreter and disable autohinter. If that won't work, at some point in xeffects overlay you could choose what filter you want by setting appropriate use flag. Look through older revisions of freetype ebuild to see how that can be done (I've removed them because Turner considers legacy filter deprecated).

 That won't be necessary, all I needed was PaulBredBury's patch, with a minor modification, thanks for the hint though  :Smile: 

 *PaulBredbury wrote:*   

> Yes, the fonts are a bit crisper:
> 
> ```
> diff -u freetype-2.3.4_p20070428.ebuild-orig freetype-2.3.4_p20070428.ebuild
> 
> ...

 Yes! Finally my fonts look exactly the way I like them, even in KDE  :Very Happy: 

Thank you so much, you saved me a lot of work going through old ebuilds  :Smile: 

For the record: changing the sed line from the above ebuild to 

```
sed -i -e "/FT_END_HEADER/i\#define FT_FORCE_LEGACY_LCD_FILTER" include/freetype/config/ftoption.h || die "sed ftoption.h LEGACY_LCD_FILTER_HAX"
```

 will force freetype to use the legacy lcd filter.

----------

## PaulBredbury

Here's a tidied ebuild which adds 2 new USE flags:  light and legacy. Plus some minor tidying  :Smile: 

----------

## Nah

 *PaulBredbury wrote:*   

> Here's a tidied ebuild which adds 2 new USE flags:  light and legacy. Plus some minor tidying 

 

Link don't work.   :Sad: 

----------

## PaulBredbury

rafb must only keep it for a day or two. Here's the ebuild:

/usr/local/portage/media-libs/freetype/freetype-2.3.4_p20070428.ebuild

```
# Copyright 1999-2007 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

inherit eutils flag-o-matic libtool

DESCRIPTION="A high-quality and portable font engine"

HOMEPAGE="http://www.freetype.org/"

SRC_URI="http://manta.univ.gda.pl/~rbonieck/${P}.tar.gz

   doc? ( mirror://sourceforge/${PN}/${PN}-doc-2.3.4.tar.bz2 )"

LICENSE="FTL GPL-2"

SLOT="2"

KEYWORDS=""

IUSE="bindist demos doc legacy light zlib"

# The RDEPEND below makes sure that if there is a version of moz/ff/tb

# installed, then it will have the freetype-2.1.8+ binary compatibility patch.

# Otherwise updating freetype will cause moz/ff/tb crashes. #59849

# 20 Nov 2004 agriffis

DEPEND="zlib? ( sys-libs/zlib )"

RDEPEND="${DEPEND}

   !<www-client/mozilla-1.7.3-r3

   !<www-client/mozilla-firefox-1.0-r3

   !<mail-client/mozilla-thunderbird-0.9-r3

   !<media-libs/libwmf-0.2.8.2"

S="${WORKDIR}/freetype2"

src_unpack() {

   unpack ${A}

   cd "${S}"

   enable_option() {

      sed -i -e "/#define $1/a #define $1" \

         include/freetype/config/ftoption.h \

         || die "unable to enable option $1"

   }

   disable_option() {

         sed -i -e "/#define $1/ { s:^:/*:; s:$:*/: }" \

         include/freetype/config/ftoption.h \

         || die "unable to disable option $1"

   }

   if ! use bindist ; then

      # Bytecodes and subpixel hinting supports are patented

      # in United States; for safety, disable them while building

      # binaries, so that no risky code is distributed.

      # See http://freetype.org/patents.html

      enable_option TT_CONFIG_OPTION_BYTECODE_INTERPRETER

      enable_option FT_CONFIG_OPTION_SUBPIXEL_RENDERING

      disable_option TT_CONFIG_OPTION_UNPATENTED_HINTING

   fi

   disable_option FT_CONFIG_OPTION_OLD_INTERNALS

   if use light ; then

      elog "Enabling FT_FORCE_LIGHT_LCD_FILTER."

      sed -i \

         -e "/FT_END_HEADER/i\#define FT_FORCE_LIGHT_LCD_FILTER" \

         include/freetype/config/ftoption.h || die "sed ftoption.h light"

   elif use legacy ; then

      elog "Enabling FT_FORCE_LEGACY_LCD_FILTER."

      sed -i \

         -e "/FT_END_HEADER/i\#define FT_FORCE_LEGACY_LCD_FILTER" \

         include/freetype/config/ftoption.h || die "sed ftoption.h legacy"

   fi

   elibtoolize

   epunt_cxx

}

src_compile() {

   # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=118021

   append-flags "-fno-strict-aliasing"

   type -p gmake &> /dev/null && export GNUMAKE=gmake

   sh autogen.sh || die "autogen.sh"

   econf $(use_with zlib) || die "econf"

   emake || die "emake"

   if use demos ; then

      cd "${WORKDIR}"/ft2demos

      emake || die "emake ft2demos"

   fi

}

src_install() {

   emake -j1 DESTDIR="${D}" install || die "emake install"

   dodoc ChangeLog README docs/{CHANGES,CUSTOMIZE,DEBUG,*.txt,PATENTS,TODO}

   cd "${WORKDIR}/${PN}-doc-${PV}"

   use doc && dohtml -r docs/*

   if use demos ; then

      cd "${WORKDIR}"/ft2demos/bin/.libs || die

      dobin * || die "dobin demos"

   fi

}

pkg_postinst() {

   ewarn "DO NOT report bugs to Gentoo's bugzilla."

   elog "See http://forums.gentoo.org/viewtopic-t-511382.html for support."

   einfo "Thank you on behalf of the Gentoo Xeffects team."

}
```

----------

## Nah

Thank !   :Razz: 

----------

## KejPi

This is very interesting article http://antigrain.com/research/font_rasterization/index.html.

It would be nice to achieve something what is shown in section labeled What can we do?

After all trials I am still not able to achieve nice "k" letter (using DejaVu sans font)  :Sad:  I am getting exactly what is shown in the article - at the end section Gamma does not Work!

----------

## KejPi

 *IvanMajhen wrote:*   

> This is what i'm talking about.   They also look better to me.
> 
> I thought that there is some fontconfig option, and not hardcoding this in freetype. 
> 
> This should go into xeffects.

 

I can't see any difference  :Sad: 

----------

## ExZombie

Mmmm, 'light' filter is only slightly better on my screen, but it's still better. Man, I love having a 130dpi display   :Razz: 

There's just one little gripe I have which I've been trying to solve on and off for a while now. I can't seem to find out why some fonts tend to render the letter 'o' and letters 'N', 'M' and 'W' in funny ways. While DejaVu just rocks, I want to cry at this screenshot. I'm gonna take a look at the soruce to see which font this is.

----------

## Eimai

 *ExZombie wrote:*   

> I want to cry at this screenshot. I'm gonna take a look at the soruce to see which font this is.

 

That's Trebuchet MS, one of the corefonts.

----------

## Belliash

This does not work for me...

I use it since this topic had just 2 pages and everytime worked for me, but not this time  :Sad: 

I always set it in KDE to use sub-pixel hinting (RGB) and hinting style to Medium. This worked, but i have installed new Gentoo and now does not work  :Sad: 

I have installed packages with USE:

[ebuild R ] media-libs/freetype-2.3.5 USE="X zlib -bindist -debug -doc" 0 kB

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

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

I tried downgrading freetype to latest from xeffects, cairo to 1.4.8 libXft to 2.1.11... None helped...

What i can say more?

When i disable antialiasing in KDE then fonts look ugly, but when enable it look prettier, but not the same like looked before. They look like i would have installed both cairo iand libXft with USE="-newspr" - old antialiasing, but as You can see i have enabled this flag...

So, whan can be wrong?

Thanks!

----------

## IvanMajhen

Hinting must be full.

----------

## Belliash

 *IvanMajhen wrote:*   

> Hinting must be full.

 

1) was medium and worked...

2) no difference when set to full...

----------

## IvanMajhen

Read this http://wiki.gentoo-xeffects.org/Font_Rendering#Changing_font_settings_in_your_Desktop_Environment

Hinting must be set to full. Post screenshot.

----------

## GoofyX

Layman does not list the xeffects overlay anymore. Has anything happened to it?

----------

## Dottout

maybe this post explains the reason. xeffects' father left gentoo, even if he still maintains the overlay

----------

## m.s.w

Damn sad story.

Without Daniel Robbins behind the wheel Gentoo is falling...

Kids can't run serius business.

Sad...., really sad.

----------

## roderick

 *GoofyX wrote:*   

> Layman does not list the xeffects overlay anymore. Has anything happened to it?

 

Check your config file for layman. You changed something or an update did... It's there for me...

* xeffects                  [Subversion] (source: svn://svn.gentoo-xeffects....)

* xeffects-experimental     [Subversion] (source: svn://svn.gentoo-xeffects....)

Check the following option in /etc/layman/layman.cfg:

```

nocheck  : yes

```

If it says no, then set it to yes. I believe that will correct it.

Oh, and xeffects is still alive.  :Smile: 

----------

## GoofyX

 *roderick wrote:*   

> Check your config file for layman. You changed something or an update did... It's there for me...
> 
> * xeffects                  [Subversion] (source: svn://svn.gentoo-xeffects....)
> 
> * xeffects-experimental     [Subversion] (source: svn://svn.gentoo-xeffects....)
> ...

 

Yes, that fixed it. However, now the two xeffects overlays are displayed with yellow asterisks... No big deal I guess, the important thing is someone to maintain this overlay.

And speaking of maintaining, I notice that the KDE packages are in slot 0 in the overlay, whereas the official packages are in slot 3.5. Although eix reports those packages as UD (downgrade), 

```
emerge -vpuD world
```

 does not want to downgrade any package. Should this different slot package allocation create any problems?

----------

## roderick

 *GoofyX wrote:*   

> Yes, that fixed it. However, now the two xeffects overlays are displayed with yellow asterisks... No big deal I guess, the important thing is someone to maintain this overlay.

 

This is because the entry in layman for xeffects is missing something trivial, which does not affect the end users ability to sync and use the overlay. Nothing to worry about.

 *GoofyX wrote:*   

> 
> 
> And speaking of maintaining, I notice that the KDE packages are in slot 0 in the overlay, whereas the official packages are in slot 3.5. Although eix reports those packages as UD (downgrade), 
> 
> ```
> ...

 

I think it has to do with the fact that portage is soon to begin not defaulting slot's and therefore you need to specify SLOT in the ebuild (haven't tested out yet). Which means that SLOT needs to be added to my kde ebuilds in the overlay. This is rather odd, as the ebuilds are a direct copy of the portage ones with tweaks. So, it almost seems as those the inheritance of the slot for kde packages does not automatically translate to ebuilds in an overlay. This seems wrong.

Anyway, the bottom line is that it won't necessarily break things as the builds I have modded do not have any slot deps that are broken at this point.

One other possibility is that this all could be "cosmetic" in the emerge/eix view and not actually broken.

So, bottom line - it works, but I will do some additional testing to see if I can figure out what is causing this weird behaviour.

----------

## GoofyX

 *roderick wrote:*   

> So, bottom line - it works, but I will do some additional testing to see if I can figure out what is causing this weird behaviour.

 

I think we end users owe you a big thanks for this. That's the least we can do from our part.

----------

## GoofyX

The xeffects repository seems not to respond. I get a "connection refuse" message.

Just to inform...

----------

## hornett

 *GoofyX wrote:*   

> The xeffects repository seems not to respond. I get a "connection refuse" message.
> 
> Just to inform...

 

https://forums.gentoo.org/viewtopic-t-575206.html

----------

## yabbadabbadont

Sorry for the thread necromancy, but is this project still active/necessary?  I just today got an LCD monitor and I'm trying to get fonts configured properly for it.

Edit: Never mind.  I just started following links and found how to get the xeffects overlay.  Then I just followed the wiki article.

----------

## boniek

It is still necessary. Project is still active (just no changes were required recently).

----------

## yabbadabbadont

It is amazing how much better the fonts look using the overlay.  Between the wiki's suggestions and Paul Bredbury's tip for disabling hinting for bold fonts, even very small text is sharp and clear.

----------

## natros

that's really amazing. 

i've have this on last ubuntu and i was impressed.

is there any reason why these patchs are not part of gentoo? is there any issues that we should know about?

----------

## boniek

To make things short - they are just a hack not a proper solution.

----------

## yabbadabbadont

 *boniek wrote:*   

> To make things short - they are just a hack not a proper solution.

 

The same could be said for Xorg, and most of Linux for that matter...   :Very Happy: 

----------

## boniek

There is new version of cairo available. I will try to commit new, patched version when I get back from work.

----------

## Emopig

boniek,

I hacked up a patch for 1.4.12 earlier today. See here.

Btw, how does "newspr" compare to Dave Turners "cleartype"-like patches? Are they the same but just re-factored?

In his interview with OSNews back in the summer David Turner said: *Quote:*   

> There is still some possible work on improvement the LCD filtering capabilities that were added in 2.3.0, though the current ones are still very good for a large set of screens.

 . He also expresses a distaste for "native" bytecode and says he prefers to let freetype's hinter do the work. Perhaps I will try freetype with the "bindist" USE flag.

----------

## vonr

newspr == David Turner's patches.

Also, like I mentioned in your other thread and a few pages back in this thread, the guys from PLD Linux are actively maintaining the subpixel patches. See here.

----------

## PaulBredbury

 *vonr wrote:*   

> PLD Linux

 

That's a slightly different patch. The point being, it's different, and will probably result in a different look.

It's nice to have the choice of so-called lcd, cleartype and xeffects patchsets (which all result in a different look)  :Smile: 

----------

## yabbadabbadont

Any ETA on the updated cairo in xeffects?  The mainline version was bumped due to a security issue.

----------

## vonr

 *PaulBredbury wrote:*   

> That's a slightly different patch. The point being, it's different, and will probably result in a different look.

 

That's true; a diff shows some slight differences. However, they both originate from David Turner's original patch from here as can be seen from the comments in the patch. Is there really a visual difference between the two, as you say? Looking at said diff, somehow I doubt it.

The patch maintained by PLD is clearly mentioned to be David Turner's (this is the patch arch calls 'lcd'). The 'xeffects patch' makes no such mention. As I said, apart from some slight differences, it looks to be the same patch albeit adapted for newer cairo versions in a slightly different manner. Could somebody please shed some light on this patch's origin?

The Archlinux 'Cleartype-like'-patch is new to me,

----------

## boniek

XEffects patch was taken from David Turner's page and corrected to work with newer versions by me.

As for cairo update in overlay - I have working ebuild, but I can't commit it to overlay for some reason.

Here is the tarball with patch (from PaulBredbury) and ebuild.

----------

## cvig

This is excellent! One question I do have is if the LCD hinting in freetype is enabled by newspr or if that still has to be patched manually to try.

----------

## boniek

Use freetype from portage tree - it's patched already.

----------

## cvig

 *boniek wrote:*   

> Use freetype from portage tree - it's patched already.

 

Thank you. I still can't get over how easier it is to read well rendered fonts.

----------

## billydv

I thought  I  had  seen  something  about  qt4  apps  in  this  thread  and  the  newer  freetype,  I  am  having  a  problem  with  a  qt4  app  named  servant,  after  updating  freetype,  servants  fonts  look  horrible.

----------

## billydv

Also,  will  there  be  a  cairo  update  in  xeffects?  There  are  two  newer  versions  in  portage  currently.

----------

## boniek

There is tarball with newer version of cairo on previous page. I don't know about XEffects as I don't have commit rights to tree anymore. I'm not user of qt4 so I can't help you with your problem.

----------

## billydv

I  heard  something  about  pdf  rendering  problems  with  the  newer  cairo  version,  any  truth  to  that?

----------

## m.s.w

I compiled cairo using ebuild from boniek on previous page. No problems with pdf.

----------

## punkid

The newer cairo with newspr patch has been commited into gentoo-china overlay

I'm emerging it right now  :Smile: 

----------

## boniek

For all this to work you will need patched cairo AND patched libXft. hopefully gentoo-china got both  :Smile: 

----------

## punkid

 *boniek wrote:*   

> For all this to work you will need patched cairo AND patched libXft. hopefully gentoo-china got both 

 

Still needs xeffects overlay to get the patched libXft, gentoo-china doesnt have it by far  :Sad: 

----------

## billydv

Could someone with fonts working well please compare this and let me know what if anything is different on their system

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]  60-liberation.conf *

  [20]  65-fonts-persian.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 *

----------

## boniek

```
> 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-lohit-gujarati.conf

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

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

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

  [13]  25-unhint-nonlatin.conf

  [14]  30-amt-aliases.conf

  [15]  30-metric-aliases.conf *

  [16]  30-urw-aliases.conf *

  [17]  40-generic.conf

  [18]  40-nonlatin.conf *

  [19]  45-latin.conf *

  [20]  49-sansserif.conf *

  [21]  50-user.conf *

  [22]  51-local.conf *

  [23]  57-dejavu.conf

  [24]  59-dejavu.conf

  [25]  60-latin.conf *

  [26]  60-liberation.conf

  [27]  61-dejavu-experimental.conf

  [28]  65-fonts-persian.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 *

```

BTW I'm Gnome user.

----------

## billydv

I  have  made  a  couple  of  changes  overall.  After  changing  all  my  kde  fonts  to  verdana  13  with  the  exception  of  fixed  width  which  is  set  to  Dejavu  sans  mono  13,  I  set  firefox  and  konqueror  both  to  use  verdana.  Then  my  final  eselect  fontconfig  was  this

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]  60-liberation.conf *

  [20]  65-fonts-persian.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 *

and  my  .fonts.conf  was  left  at

<?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>hintmedium</const>

  </edit>

 </match>

 <match target="font" >

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

   <bool>true</bool>

  </edit>

 </match>

<match target="font">

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

   <bool>true</bool>

  </edit>

 </match>

</fontconfig>

This  setup  gives  me  reasonably  good  font  rendering.  Still  qt4  apps  don't  render  real  well  but  what  can  I  say.  I'm  not  sure  there  is  a  real  solution.

----------

## bluesurfer

I use the cairo-1.4.12 ebuild from gentoo-china and libXft-2.1.12 from xeffects overlay. Looks great!

What about the quantization patch for freetype - why do I not need it?

BTW I think the ubuntu guys have already implemeted the patches in gutsy according to this:

http://wiki.ubuntuusers.de/Schriftbild_verbessern

http://ubuntuforums.org/showthread.php?t=555964

----------

## natros

 *bluesurfer wrote:*   

> I use the cairo-1.4.12 ebuild from gentoo-china and libXft-2.1.12 from xeffects overlay. Looks great!
> 
> What about the quantization patch for freetype - why do I not need it?
> 
> BTW I think the ubuntu guys have already implemeted the patches in gutsy according to this:
> ...

 

That's true.

----------

## PaulBredbury

Hooray, Ubuntu's patches look great   :Cool: 

Better than xeffects, I think.

----------

## paladin-zero

 *billydv wrote:*   

> I thought  I  had  seen  something  about  qt4  apps  in  this  thread  and  the  newer  freetype,  I  am  having  a  problem  with  a  qt4  app  named  servant,  after  updating  freetype,  servants  fonts  look  horrible.

 

I saw the same problem. Try running qtconfig, and change your default fonts.

----------

## paladin-zero

 *punkid wrote:*   

> The newer cairo with newspr patch has been commited into gentoo-china overlay
> 
> I'm emerging it right now 

 

A few posts to this thread in October claimed that the xeffects project is still alive, but the overlay is not being updated to keep pace with portage. Now people are using gentoo-china instead of xeffects to provide the ebuilds? Is somebody actively maintaining the xeffects overlay?

----------

## billydv

That did it, changed my font to verdana in qtconfig and now it shows up beautiful.

----------

## neuron

 *PaulBredbury wrote:*   

> Hooray, Ubuntu's patches look great  
> 
> Better than xeffects, I think.

 

This might make it into gentoo's main tree as well then I guess, since ubuntu is quite paranoid about license problems and stuff like that there shouldn't be any problems with those patches.

----------

## swimmer

Hmm - are there already ebuilds available to test this stuff? Or do I need to patch it manually?

Since xeffects seems to be unmaintained I have to look for another solution to keep those great looking fonts :-/

Greetz

swimmer

----------

## elkhunter

Is this howto still accurate?  Should I emerge xeffects or gentoo-china and what USE flags are needed (I saw posts indicating to use newspr and one indicated to use filter_* instead).  Also, what should I put in /etc/fonts/local.conf and in ~/.fonts.conf and what fontconfig scripts do I want enabled for an LCD (RGB) monitor?  Any help appreciated.

----------

## mwhitlock

 *elkhunter wrote:*   

> Is this howto still accurate?  Should I emerge xeffects or gentoo-china and what USE flags are needed (I saw posts indicating to use newspr and one indicated to use filter_* instead).  Also, what should I put in /etc/fonts/local.conf and in ~/.fonts.conf and what fontconfig scripts do I want enabled for an LCD (RGB) monitor?  Any help appreciated.

 

I had to pull both xeffects and gentoo-china in order to get patched libXft-2.1.12 and cairo-1.4.12, respectively.  I used Layman to get the xeffects overlay, but gentoo-china isn't listed in it, so I had to check that one out manually.

Additionally, because xeffects doesn't have kdelibs-3.5.8-r2 yet (c'mon guys!), I had to make my own:

```
# cp /usr/portage/kde-base/kdelibs/kdelibs-3.5.8-r2.ebuild /usr/local/portage/layman/xeffects/kde-base/kdelibs/

# diff -u /usr/portage/kde-base/kdelibs/kdelibs-3.5.8-r1.ebuild \

        /usr/local/portage/layman/xeffects/kde-base/kdelibs/kdelibs-3.5.8-r1.ebuild |

        patch /usr/local/portage/layman/xeffects/kde-base/kdelibs/kdelibs-3.5.8-r2.ebuild

# ebuild /usr/local/portage/layman/xeffects/kde-base/kdelibs/kdelibs-3.5.8-r2.ebuild manifest
```

Here's my ~/.fonts.conf, with commentary:

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

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

 <!-- Enable sub-pixel anti-aliasing -->

 <match target="font" >

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

   <const>rgb</const>

  </edit>

 </match>

 <match target="font" >

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

   <bool>true</bool>

  </edit>

 </match>

 <!-- Disable hinting (I like Mac-ish fonts) -->

 <match target="font" >

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

   <bool>false</bool>

  </edit>

 </match>

 <match target="font" >

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

   <const>hintnone</const>

  </edit>

 </match>

 <!-- Ban bitmap fonts (yuck!) -->

 <include>/etc/fonts/conf.avail/70-no-bitmaps.conf</include>

 <!-- Enable hinting for DejaVu Sans Mono, my terminal font -->

 <match target="font">

  <test name="family">

   <string>DejaVu Sans Mono</string>

  </test>

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

   <bool>true</bool>

  </edit>

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

   <const>hintfull</const>

  </edit>

 </match>

 <!-- Ban Type-1 fonts because they render poorly -->

 <selectfont>

  <rejectfont>

   <pattern>

    <patelt name="fontformat" >

     <string>Type 1</string>

    </patelt>

   </pattern>

  </rejectfont>

 </selectfont>

</fontconfig>
```

----------

## mwhitlock

I have to say, my fonts look really freakin' good now, IMHO.

Screen shot:

http://img146.imageshack.us/img146/1892/screenshotvf2.png

In looking through this thread, I see a lot of posts saying that bold fonts are "too bold."  Could someone comment on my screen shot?  Bold fonts look totally correct to me.  (For example, look at the selected window button in the Kicker.)

Incidentally, to clear up the apparent confusion out there:

fontconfig : merely selects a font file according to some given attributes; does no rasterization or rendering!

freetype : rasterizes vector font glyphs into bitmaps; does no LCD filtering!

libXft : renders glyph bitmaps on an X display; performs LCD filtering

cairo : renders vector graphics and FreeType-rasterized text; also performs LCD filtering

----------

## PaulBredbury

fontconfig-ubuntu is required, to compile cairo-ubuntu. Otherwise:

```
cairo-xlib-screen.c:191: error: 'FC_LCD_FILTER_DEFAULT' undeclared

cairo-xlib-screen.c:234: error: 'FC_LCD_FILTER_NONE' undeclared

cairo-xlib-screen.c:237: error: 'FC_LCD_FILTER_LIGHT' undeclared

cairo-xlib-screen.c:240: error: 'FC_LCD_FILTER_LEGACY' undeclared
```

----------

## bluesurfer

 *mwhitlock wrote:*   

> I had to pull both xeffects and gentoo-china in order to get patched libXft-2.1.12 and cairo-1.4.12, respectively.  I used Layman to get the xeffects overlay, but gentoo-china isn't listed in it, so I had to check that one out manually.

 

Strange. gentoo-china is in layman on my system.

 *mwhitlock wrote:*   

> Additionally, because xeffects doesn't have kdelibs-3.5.8-r2 yet (c'mon guys!), I had to make my own:

 

Why do you want kdelibs from xeffects? There's no need to if you just want to have better rendered fonts.

----------

## elkhunter

Thanks for the help mwhitlock.  My fonts look much better now but they are still slightly fuzzy so I think I still have something not quite right.  Here's what I have done so far:

  layman -a xeffects

  layman -a gentoo-china

  add newspr and utils to USE flags in make.conf

  emerge  media-libs/freetype x11-libs/cairo x11-libs/libXft libXfont

  replace my ~/.fonts.conf with your version listed above

  removed /etc/fonts/local.conf (I still had really ugly fonts 'til I removed this)

I'm running fluxbox and the fonts look pretty good in most everything I've tried (kde apps, gnome apps, xterm -fa 'Bitstream Vera Sans 12' -fs 9, firefox, thunderbird, etc).  However they are still a little blurry.  I'm wondering if I have my fontconfig set incorrectly for my LCD monitor.  Here's what I currently have:

Available fontconfig .conf files ( Desktop bin cpb dead.letter mythbackup other_root_files play_dvd_gxine play_dvd_mplayer tmp vmplayer 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-experimental.conf

  [10]  20-unhint-small-dejavu.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]  57-dejavu.conf

  [21]  60-latin.conf *

  [22]  60-liberation.conf

  [23]  61-dejavu-experimental.conf

  [24]  65-fonts-persian.conf *

  [25]  65-nonlatin.conf *

  [26]  69-unifont.conf *

  [27]  70-no-bitmaps.conf

  [28]  70-yes-bitmaps.conf

  [29]  80-delicious.conf *

  [30]  90-synthetic.conf *

Any help appreciated and thanks in advance.

----------

## mwhitlock

 *bluesurfer wrote:*   

> Why do you want kdelibs from xeffects? There's no need to if you just want to have better rendered fonts.

 

Since I have the xeffects overlay installed, several other ebuilds (including kdelibs) build from the overlay.  Some KDE ebuilds from xeffects call functions defined in the xeffects kdelibs that are not defined in the trunk kdelibs.  That means that I have to keep using the xeffects kdelibs, but sometimes it falls behind in version.

I would really prefer if there were some way to configure portage to only use an overlay for certain packages.  I really only care to have cairo and libXft built from the overlay ebuilds without all the rest of the xeffects KDE stuff.

----------

## mwhitlock

elkhunter, do your fonts look like those in my screen shot, or are they blurrier?

I haven't toggled any of the fontconfig files from their defaults, except that I have enabled substitution of dejavu fonts (57-dejavu.conf).  In other words, this is what I have enabled:

```
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.conf

  [10]  20-unhint-small-dejavu-experimental.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]  57-dejavu.conf *

  [21]  60-latin.conf *

  [22]  61-dejavu-experimental.conf

  [23]  65-fonts-persian.conf *

  [24]  65-nonlatin.conf *

  [25]  69-unifont.conf *

  [26]  70-no-bitmaps.conf

  [27]  70-yes-bitmaps.conf

  [28]  80-delicious.conf *

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

By the way, I ran 'layman -a gentoo-china', and it worked just fine.  I don't know why gentoo-china is not listed in 'layman -L'.

----------

## yabbadabbadont

 *mwhitlock wrote:*   

>  *bluesurfer wrote:*   Why do you want kdelibs from xeffects? There's no need to if you just want to have better rendered fonts. 
> 
> Since I have the xeffects overlay installed, several other ebuilds (including kdelibs) build from the overlay.  Some KDE ebuilds from xeffects call functions defined in the xeffects kdelibs that are not defined in the trunk kdelibs.  That means that I have to keep using the xeffects kdelibs, but sometimes it falls behind in version.
> 
> I would really prefer if there were some way to configure portage to only use an overlay for certain packages.  I really only care to have cairo and libXft built from the overlay ebuilds without all the rest of the xeffects KDE stuff.

 

When I used the overlay, after updating it, I would go into the overlay directories and remove all of the ones I didn't want.  I just left the cairo and libXft directories.

----------

## mwhitlock

 *yabbadabbadont wrote:*   

> When I used the overlay, after updating it, I would go into the overlay directories and remove all of the ones I didn't want.  I just left the cairo and libXft directories.

 

I know that would work, but all the stuff I deleted would show up again the next time I updated my copy of the overlay.  I wonder... what happens if I do 'svn rm' instead of just plain 'rm'.  Maybe if the directories in my working copy are marked for deletion, they won't reappear when I update.

----------

## elkhunter

Thanks mwhitlock.  I removed 10-autohint.conf to match yours, then removed the DPI and UseEdidDpi entries from my xorg.conf  and rebooted and things look better.  (I had added the latter two  based on the info at http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts).  Not sure which change fixed the blurry issue but it's much better (although I still dont think its quite as sharp as when I boot into windows).

A few more quick questions:  do you have anything in /etc/fonts/local.conf and what display manager do you use?  I'm using kdm but the fonts there still look horrible.  Also is there a fix to clean up the fonts in open office -- they still look terrible?

Thanks again.

----------

## mwhitlock

 *elkhunter wrote:*   

> Thanks mwhitlock.  I removed 10-autohint.conf to match yours, then removed the DPI and UseEdidDpi entries from my xorg.conf  and rebooted and things look better.  (I had added the latter two  based on the info at http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts).  Not sure which change fixed the blurry issue but it's much better (although I still dont think its quite as sharp as when I boot into windows).
> 
> A few more quick questions:  do you have anything in /etc/fonts/local.conf and what display manager do you use?  I'm using kdm but the fonts there still look horrible.  Also is there a fix to clean up the fonts in open office -- they still look terrible?
> 
> Thanks again.

 

I let X detect and use the physical DPI of my monitor. (It detects 101x101 dpi for my Dell 30".)  Letting X use your physical DPI means that fonts will display at their correct physical sizes.  For example, a 72-point font when rendered on my computer and displayed on my monitor is exactly 1 inch tall because I let X use my hardware DPI instead of overriding it with some other number.

If you want fonts to be as sharp as they are on Windows, you'll have to turn on hinting.  I have hinting disabled because I prefer glyphs to have accurate shapes at the expense of sharpness.  If you prefer stems to be nailed to the pixel grid, you should enable hinting, preferably using the byte-code interpreter (BCI), which executes the hints encoded in the font files.  I find that even with the newspr patches, hinted fonts still don't look as good as they do with ClearType on Windows.  My unhinted fonts look approximately like fonts look on Mac OS X, which also prefers glyph accuracy over sharpness.

I use kdm, too, and yeah, the fonts look terrible on the login screen.  Fortunately, I only have to look at that for a few seconds when booting up my computer, and I only do that maybe once a month.  Probably I could get those fonts to look good by flipping some of the fontconfig files using 'eselect fontconfig' (or just adjusting the symlinks in /etc/fonts/conf.d/ manually).  I haven't care to do that because, as I said, I only have to look at that screen momentarily.

I don't use OpenOffice, so I don't know how to help you there.

----------

## MM23

Is there any way to do this now that xeffects is dead?

I can't stand the default freetype/Xft rendering...

----------

## natros

too bad xeffects is dead, gentoo is dead, i'm moving to ubuntu  :Sad: 

----------

## bunder

 *natros wrote:*   

> gentoo is dead

 

(OT) people have been saying that for years.   :Wink: 

----------

## natros

<OT>maybe is not dead but i have seen better days</OT>

xeffects is down, http://wiki.gentoo-xeffects.org/ is down, where can i get the ebuilds?

----------

## swimmer

For the cairo+libXft ebuilds you can go there: http://arcong.ath.cx/index.php?option=com_content&task=view&id=16&Itemid=30

HTH

swimmer

----------

## billydv

Boniek,  since  you  were  maintaining  the  cairo  and  libxft  packages  in  xeffects,  maybe  you  should  setup  an  overlay  with  just  those  two  packages  so  that  all  of  us  using  you  font  rendering  methods  can  simply  use  your  overlay.  How  hard  can  it  be  to  maintain  an  overlay  with  2  packages?  Unfortunately  I  don't  know  whats  involved  in  setting  up  an  overlay.

----------

## GoofyX

 *billydv wrote:*   

> Boniek,  since  you  were  maintaining  the  cairo  and  libxft  packages  in  xeffects,  maybe  you  should  setup  an  overlay...

 

Yes, but before that, I would first like Boniek to tell us if he still maintains the overlay and/or is willing to spend time on maintaining it. There have been a lot of posts here that make me wonder (and I'm sure I'm not the only one) if Boniek is still "alive" (in the sense that he maintains xeffects).

It's a shame these patches don't get in the core...

----------

## billydv

GoofyX,  Boniek  was  not  maintaining  xeffects,  he  simply  made  some  additions  with  regards  to  the  cairo  and  libxft  ebuilds.  He  is  definitely  around  as  he  answered  a  post  of  mine  just  a  couple  of  weeks  ago.  He  also  recently  updated  a  cairo  ebuild  which  is  posted  on  the  previous  page  I  believe.

----------

## Emopig

Forget about overlays, if you want these patches install "portage-bashrc-ng" from

gechi's overlay and then use the autopatch module to apply whatever patches you want.

```
andrew@ziggy ~ $ ls -lhR /usr/portage/local/patches/x11-libs/

/usr/portage/local/patches/x11-libs/:

total 8.0K

drwxr-xr-x 2 root root 4.0K 2007-12-10 11:56 cairo

drwxr-xr-x 2 root root 4.0K 2007-12-10 11:56 libXft

/usr/portage/local/patches/x11-libs/cairo:

total 28K

-rw-r--r-- 1 root root 22K 2007-12-10 11:48 cairo-1.4.12-lcd-filter-1.patch

/usr/portage/local/patches/x11-libs/libXft:

total 28K

-rw-r--r-- 1 root root 22K 2007-12-10 11:55 libXft-2.1.12-lcd-filter.patch
```

```
andrew@ziggy ~ $ eselect bashrc-ng list

Available bashrc modules:

  [1]   autopatch on

  [2]   distclean off

  [3]   localepurge off

  [4]   oldtmpfs off

  [5]   perpackage off

  [6]   resumemerge off

  [7]   tmpfs off
```

Then I just use Cairo and libXft from the portage tree. The above patch files are just from PLD Linux's repo's:

```
http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/cairo-1.2.4-lcd-filter-1.patch

http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/xorg-lib-libXft-lcd-filter.patch
```

I do wish Ubuntu's patches were split out, not rolled into one uber diff patch...

----------

## Emopig

Since some people seem interested in what Ubuntu are doing in this regard...

The latest change log to Cairo on Ubuntu's packages says:

```
+  * Replace Ubuntu's lcd patch by patch from Freedesktop bug #10301

+    - drop debian/patches/02-cairo-1.4.8-lcd-filter-2.dpatch

+    - add debian/patches/02-lcd_filter_freedesktop_bug10301.patch
```

Cairo patch: http://bugs.freedesktop.org/show_bug.cgi?id=10301

Fontconfig patch: http://bugs.freedesktop.org/show_bug.cgi?id=13566

The patch Ubuntu is using for libXft seems to be a version of David Turners patch

"with additional modification that the specific LCD Filter can be changed."

For convenience I've extracted this from the libxft2 (2.1.12-2ubuntu4) package

that is queued for the release of Hardy Heron. Here:

http://pastebin.ca/raw/845690

To summarise:

If you want Ubuntu gutsy/hardy font rendering you need to patch libXft, Cairo

and Fontconfig (a small patch). You do not need to patch Freetype.

----------

## Emopig

PLD vs Ubuntu's libXft patch

Just so everyone knows Ubuntu's libXft2 patch is only slightly different to the PLD Linux patches in that it adds more fontconfig options.  As far as I can tell tell, there are no differences to the algorithms!

----------

## Emopig

Ok, time to see what kind of chaos I can cause...

```
ziggy libXft # echo ">=x11-libs/cairo-1.5.2" >>/etc/portage/package.unmask 

ziggy libXft # emerge -avt --oneshot libXft cairo fontconfig

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

Calculating dependencies... done!

[ebuild     U ] x11-libs/cairo-1.5.4-r1 [1.4.12] USE="X glitz opengl svg xcb -debug -directfb -doc -test%" 3,207 kB 

[ebuild   R   ]  x11-libs/libXft-2.1.12  USE="-debug" 255 kB 

[ebuild   R   ]   media-libs/fontconfig-2.5.0-r1  USE="xml -doc" 1,353 kB 

Total: 3 packages (1 upgrade, 2 reinstalls), Size of downloads: 4,814 kB
```

----------

## Emopig

All seems well for now. Good luck people!

----------

## bosele

would you please make the patched files available somewhere, i just can't get it to work.

prettyplease?

----------

## boniek

I'm visiting this thread from time to time so you could say I'm alive  :Smile:  I will try to make simple overlay with font related ebuilds over this weekend so stay tuned .

----------

## yabbadabbadont

 *boniek wrote:*   

> I'm visiting this thread from time to time so you could say I'm alive  I will try to make simple overlay with font related ebuilds over this weekend so stay tuned .

 

That would be much appreciated.

----------

## bosele

thanks, that would be great

----------

## billydv

Yeah  Boniek!!!!  Thats  the  spirit!!!!

----------

## boniek

Here you go:

https://boniek.homelinux.org/svn/repos/font-overlay/trunk/

It's as simple as you can get - I will try to update stuff as new versions become available. It's on my private machine so don't expect 100% uptime (if any of you can provide stable and fast hosting it would be much appreciated).

Here's paludis repository definition:

```
location = ${ROOT}/var/paludis/repositories/fonts/

sync = svn+https://boniek.homelinux.org/svn/repos/font-overlay/trunk/

names_cache = ${location}/.cache/names

cache = ${ROOT}/var/empty

distdir = ${ROOT}/var/tmp/distfiles

write_cache = ${ROOT}/var/cache/paludis/metadata

format = ebuild

master_repository = gentoo

```

----------

## aronparsons

 *boniek wrote:*   

> Here you go:
> 
> https://boniek.homelinux.org/svn/repos/font-overlay/trunk/
> 
> It's as simple as you can get - I will try to update stuff as new versions become available. It's on my private machine so don't expect 100% uptime (if any of you can provide stable and fast hosting it would be much appreciated).
> ...

 

Thanks!  I try to avoid overlays just because they pull in so many packages and sometimes the overlay ebuilds replace portage ebuilds that I don't them to (which really should be resolved with overlay priorities).  A small, single-purpose overlay like this is the way to do it.

Also, the ebuilds are missing their manifests (not a problem to create them locally though).

Here's a layman definition for a local repository list:

```
<layman>

<overlay

      type = "svn"

      src  = "https://boniek.homelinux.org/svn/repos/font-overlay/trunk/"

      name = "font-overlay"

      contact = "???">

        <description>Font Overlay</description>

</overlay>

</layman>
```

----------

## billydv

Boniek, you  need  to  manifest  the  ebuilds  in  your  overlay!!!!

----------

## yabbadabbadont

 *billydv wrote:*   

> Boniek, you  need  to  manifest  the  ebuilds  in  your  overlay!!!!

 

Just digest them yourself.   :Wink: 

```
ebuild <insert ebuild file name here> digest
```

----------

## boniek

 *billydv wrote:*   

> Boniek, you  need  to  manifest  the  ebuilds  in  your  overlay!!!!

 

Oops... fixed.

----------

## swimmer

Many many thanks for your efforts boniek!!! This is simply brillant  :Very Happy: 

Hugs

swimmer

----------

## bosele

thank you!

and please don't take this the wrong way but..

any chance of an ebuild for a patched cairo 1.5.*? [/glep]

----------

## boniek

 *bosele wrote:*   

> thank you!
> 
> and please don't take this the wrong way but..
> 
> any chance of an ebuild for a patched cairo 1.5.*? [/glep]

 

I will try to look into it.

----------

## StifflerStealth

They have the 1.5 patch with the modifications made by Ubuntu as mentioned on the previous page how it adds more options.  :Smile: 

http://bugs.freedesktop.org/show_bug.cgi?id=10301

Cool.

----------

## bosele

great, thanks again!

----------

## yabbadabbadont

@boniek: Thanks again for taking the time to set this up.  Since the actual guide is no longer available, would it be possible to post the text of the guide here in this thread?  (assuming that you have a copy of the guide on your own machine)  Or, since the thread has become lengthy with earlier posts out of date, perhaps just a summary of the basic steps?

I pulled a copy of the cairo and libXft ebuilds from your svn and have rebuilt both using the newspr USE flag.  I ran revdep-rebuild afterwards, just in case, but everything was consistent.  Do I need to manually re-emerge anything else?

Edit: Apparently not.  Everything looks great now.   :Very Happy: 

----------

## billydv

Boniek,  Cairo  has  been  updated  in  the  official  tree.

----------

## pijalu

 *billydv wrote:*   

> Boniek,  Cairo  has  been  updated  in  the  official  tree.

 

copy ebuild and patch with new version and you should be set  :Smile: 

----------

## bosele

pijalu: would you mind sharing that ebuild which patches the new version? I am apparently completely inept at changing anything but typo's in ebuilds.

----------

## boniek

It's up-to-date now. Unfortunately I won't be able to do 0day updates. I can only spend time working on overlay over the weekends (job, life etc  :Smile: )

If you are using paludis (it may be possible for portage as well) I recommend to mask cairo from gentoo repository:

```
echo "x11-libs/cairo::gentoo" >> /etc/paludis/package_mask
```

That way you will only use cairo from overlay.

----------

## PaulBredbury

boniek, should use elog instead of einfo, in pkg_postinst()  :Wink: 

----------

## boniek

Thanks for tip Paul. Changed as per suggestion.

Cairo 1.5.x now in overlay (I have stolen the patch from this thread - my thanks goes to estar).

----------

## neuron

 *boniek wrote:*   

> Thanks for tip Paul. Changed as per suggestion.
> 
> Cairo 1.5.x now in overlay (I have stolen the patch from this thread - my thanks goes to estar).

 

Just tried to grab that and it fails to patch cleanly.  Ebuild unpack fails.

```

 * Failed Patch: cairo-1.5.2-newspr.patch.bz2 !

 *  ( /var/tmp/portage/x11-libs/cairo-1.5.6/temp/381.patch )

```

----------

## boniek

That's strange. It works fine for me. Both - in Portage and in Paludis.

----------

## neuron

 *boniek wrote:*   

> That's strange. It works fine for me. Both - in Portage and in Paludis.

 

```

PATCH COMMAND:   patch -p1 -g0 -E --no-backup-if-mismatch < /var/tmp/portage/x11-libs/cairo-1.5.6/temp/13674.patch

========================================

patching file src/cairo-ft-font.c

Hunk #1 FAILED at 55.

Hunk #2 FAILED at 709.

Hunk #3 FAILED at 1015.

Hunk #4 FAILED at 1026.

Hunk #5 FAILED at 1056.

Hunk #6 FAILED at 1067.

Hunk #7 FAILED at 1087.

Hunk #8 FAILED at 1102.

Hunk #9 FAILED at 1138.

Hunk #10 FAILED at 1186.

Hunk #11 FAILED at 1208.

Hunk #12 FAILED at 1634.

12 out of 12 hunks FAILED -- saving rejects to file src/cairo-ft-font.c.rej

```

----------

## Occasus

Hello.

Could you tell me how to add the new overlay to layman?

I've appended 

```
<overlay

      type = "svn"

      src  = "https://boniek.homelinux.org/svn/repos/font-overlay/trunk/"

      name = "font-overlay"

      contact = "???">

        <description>Font Overlay</description>

</overlay>
```

to /usr/portage/local/layman/overlays.xml

And manually created a dir called font-overlay with the content of the overlay in it.

```
% layman -l

* custom-kernels            [Subversion] (source: http://opensvn.csie.org/cu...)

* font-overlay              [Subversion] (source: https://boniek.homelinux.o...)

* gentoo-china              [Subversion] (source: http://gentoo-china-overla...)

* plan9                     [Subversion] (source: http://overlays.gentoo.org...)

% eix x11-libs/cairo

[U] x11-libs/cairo

     Available versions:  1.2.6 1.4.10 1.4.12 1.4.12[1] (~)1.4.14 [M](~)1.5.6 {X debug directfb doc glitz opengl svg test xcb}

     Installed versions:  1.4.12[1](00:14:20 31/12/07)(X glitz newspr opengl svg -debug -directfb -doc -xcb)

     Homepage:            http://cairographics.org/

     Description:         A vector graphics library with cross-device output support

[1] "china" /usr/portage/local/layman/gentoo-china
```

Why can't I get the updated version of cairo?

----------

## kallee

Occasus, you need to put the description of the overlay into a different file. The file overlays.xml is where layman saves installed overlays. Make a new file, say list.xml:

```
> cat /usr/portage/local/layman/list.xml

<?xml version="1.0" ?>

<overlays>

<overlay

      type = "svn"

      src  = "https://boniek.homelinux.org/svn/repos/font-overlay/trunk"

      name = "font-overlay"

      contact = "???">

        <description>Font Overlay</description>

</overlay>

</overlays>

```

Then use this file with -o switch. To see all available overlays:

```
> layman -o file:///usr/portage/local/layman/list.xml -L
```

To add the font-overlay:

```
> layman -o file:///usr/portage/local/layman/list.xml -a font-overlay
```

After that you need to add the PORTDIR_OVERLAY="/usr/portage/local/layman/font-overlay" to your /etc/make.conf and then emerge cairo.

----------

## swimmer

I simple appended 

```
file:///usr/portage/local/layman/font-overlay.xml
```

 to "overlays :" in /etc/layman/layman.cfg ...

HTH

swimmer

PS: My font-overlay.xml looks like this:

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

<layman>

  <overlay

      type = "svn"

      src  = "https://boniek.homelinux.org/svn/repos/font-overlay/trunk/"

      contact = "boniek"

      name = "font-overlay">

    <link>

      https://boniek.homelinux.org/svn/repos/font-overlay/trunk/

    </link>

    <description>Just a simple overlay for the necessary packages to let fonts look good on LCD displays</description>

  </overlay>

</layman>

```

----------

## Occasus

Thank you for the help!

----------

## StephanX

 *swimmer wrote:*   

> I simple appended 
> 
> ```
> file:///usr/portage/local/layman/font-overlay.xml
> ```
> ...

 

Hmm, it first didn't work for me. Only when I changed the file /etc/layman/layman.cfg to include the following:

```
nocheck  : yes
```

Now, I can do a 

```
layman -a font-overlay
```

and it works   :Laughing: 

Stephan

----------

## swimmer

Hmpf my fault - should have mentioned that :-/ 

Sorry about that

swimmer

----------

## m.s.w

boniek, thank you very much. It works.

Sorry, for the polish language below, but I don't know how to say it in english.

Stary, jesteś zajebisty.  :Smile: 

----------

## Hell-Razor

Stary, jesteś zajebisty

something about an old man not being (something)

----------

## deepb

Thank you so much for creating the overlay.. I manually patched libXft & cairo many months ago, and became very accustomed to beautiful fonts.  Then, quite recently, I went into shock after accidentally upgrading cairo with the regular portage version.  I was so distracted by the ugliness, I could barely get any work done.   :Smile: 

Cheers.

----------

## Lori

Thanks boniek for maintaining the overlay! I just reinstalled libXft and cairo with newspr and I am very happy with the result! Keep up the good work!

Regards,

Lori

----------

## soya

I'm getting this error (after adding the layman overlay and running layman -a font-overlay)

emerge cairo

```

[ebuild     U ] x11-libs/cairo-1.5.6 [1.4.14] USE="X directfb glitz newspr%* opengl svg* -debug -doc -test% -xcb" 0 kB [0=>1]

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

Portage tree and overlays:

 [0] /usr/portage

 [1] /usr/local/layman/font-overlay
```

```
 * Failed Patch: cairo-1.5.2-newspr.patch.bz2 !

 *  ( /var/tmp/portage/x11-libs/cairo-1.5.6/temp/15271.patch )

 * 

 * Include in your bugreport the contents of:

 * 

 *   /var/tmp/portage/x11-libs/cairo-1.5.6/temp/cairo-1.5.2-newspr.patch.bz2-15271.out

 * 

 * ERROR: x11-libs/cairo-1.5.6 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_unpack

 *             environment, line 2669:  Called epatch 'src_unpack'

 *             environment, line 1515:  Called die

 * The specific snippet of code:

 *                   die "Failed Patch: ${patchname}!";

 *  The die message:

 *   Failed Patch: cairo-1.5.2-newspr.patch.bz2!

 * 

 * 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/x11-libs:cairo-1.5.6:20080216-020115.log'.

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

 * This ebuild is from an overlay: '/usr/local/layman/font-overlay/
```

Don't know why i'm gettin the error when aplying the patch. i think emerge is messing cairo from the overlay with the one from the gentoo portage

That doesn't exist:

/var/tmp/portage/x11-libs/cairo-1.5.6/temp/15271.patch

/var/tmp/portage/x11-libs/cairo-1.5.6/temp/cairo-1.5.2-newspr.patch.bz2-15271.out

neither /var/tmp/portage/x11-libs/

PD:Do someone know what's the difference betwen the patch on the post here and the ones from here http://bugs.freedesktop.org/show_bug.cgi?id=10301 ?

----------

## estar

Gah, people still use that thing I posted? Well, it’s not quite working for 1.5.10 anymore, so I’ve modified it so it at least applies successfully: cairo-1.5.10-newspr.patch (download this). Compatibility with 1.5.10 entirely untested, use at your own risk.

If somebody’s studied the patch(set?) soya’s referring to, I’d like to know what it does, too.

----------

## dman777

I went ahead and reinstalled cairo with the new overlay, but I don't see a change yet. The how to link is dead, can someone tell me what to do to make the new font quality take effect?

----------

## estar

You can find the HOWTO here. Iirc, the major configuration step is that of creating ~/.fonts.conf.

By the way, there were no patch-relevant changes from 1.5.10 to 1.5.12, I think.

----------

## dman777

Thanks! After reading the How To, I see no mention of the Boniek's font-overlay that I installed with Cairo. Does the overlay eliminate any of these steps? Or do I do the whole How To in addition to adding the overlay to Cairo?

----------

## estar

The HOWTO was part of the xeffects overlay/project which is now dead. Boniek’s overlay supersedes those packages of that overlay which were relevant to subpixel rendering. Therefore, ignore the HOWTO steps until the section on ‘Changing font settings’ and proceed from there.

----------

## dman777

I don't think the .font.conf file is taking effect. I have a couple of questions:

1). when I make the .font.conf file, do I need to make it an executable file?

2). Where the doc saids "change rgb to subpixel order of your monitor)", I did not know what they were talking about so I made the line "<edit mode="assign" name="rgba" >     <const>rgb</const> </edit>" exactly as it is. 

What else could be wrong for this file not to take effect?

Thanks,

-Darin

----------

## PaulBredbury

Notice the name:

```
$ ll ~/.fonts.conf

-rw-r--r-- 1 brebs brebs 4411 2008-03-05 00:00 /home/brebs/.fonts.conf
```

----------

## dman777

ya, that's what i have. I wanted to make sure I have the over-lay installed. So, I did a emerge -pv cairo and this is what I got:

Total: 1 package (1 reinstall), Size of downloads :0 kb

Portage tree and overlays:

[0] /usr/portage

[1] /usr/portage/local/layman/font-overlay

To me, it looks like the overlay is installed properly. Am I reading it correctly?

----------

## neuron

 *dman777 wrote:*   

> ya, that's what i have. I wanted to make sure I have the over-lay installed. So, I did a emerge -pv cairo and this is what I got:
> 
> Total: 1 package (1 reinstall), Size of downloads :0 kb
> 
> Portage tree and overlays:
> ...

 

.fonts.conf not .font.conf  :Wink: 

----------

## dman777

that was just a typo in my message..sorry...i do have ".fonts.conf ".

UPDATE: I renamed my .fonts.conf file to .fonts.conf.bck so it wouldn't load. Afterwards I went into x server and loaded firefox and I don't see a change in the fonts. So I don't think the file is taking effect. Any ideas?

----------

## estar

Hmm, check if you have a symlink called /etc/fonts/conf.d/50-user.conf pointing to /etc/fonts/conf.avail/50-user.conf. If not, 

```
cd /etc/fonts/conf.d && sudo ln -s ../conf.avail/50-user.conf .
```

 That’s the configuration file which includes ~/fonts.conf.

----------

## vonr

 *estar wrote:*   

> If somebody’s studied the patch(set?) soya’s referring to, I’d like to know what it does, too.

 

It's basically the same patch, but with some slight changes: it adds some documentation and has some code-cleanup. The most important change is that it adds an option ("lcdfilter") specifying the filtering-type: the values it may contain are "lcdnone", "lcddefault" (for David Turner's filter), "lcdlight" (David Turner's filter, but less agressive), and "lcdlegacy" (the default cairo filter). This option is set through fontconfig, which has to be patched with the patch from freedesktop #13566. Also please note that the option needs to be set for sub-pixel filtering to work; or, at least, not use the cairo default filter.

The most interesting thing about this whole story is that upstream seems to accept these patches; fontconfig-2.6 will contain the patch from freedesktop #13566, and the inclusion of the patch from freedesktop #10301 in cairo is being discussed.

For those interested I've modified the patch from freedesktop #10301 to apply to cairo-1.5.12; it can be found here. The fontconfig patch from freedesktop #13566 applies to fontconfig-2.5 just fine.

----------

## IvanMajhen

I'm using ubuntu patches and they work great. They also patch fontconfig. It is nice to have option to turn off

lcdfilter for some over bold fonts.

Openoffice will from 2.4 release use cairo to render text. 

Here is screenshot to prove it:   :Laughing: 

http://img223.imageshack.us/my.php?image=office2ao5.png

//EDIT: 

I was wrong. It will not go in mainline.

----------

## dman777

 *estar wrote:*   

> Hmm, check if you have a symlink called /etc/fonts/conf.d/50-user.conf pointing to /etc/fonts/conf.avail/50-user.conf. If not, 
> 
> ```
> cd /etc/fonts/conf.d && sudo ln -s ../conf.avail/50-user.conf .
> ```
> ...

 

Ya, I check it and the link is correct. I don't think this file is getting loaded when I go into the X server enviroment or any other time. Reason being, to test to see if this file is getting loaded I went into the ../conf avail/  directory and renamed the 50-user.conf  to 50-user.conf .bck so it wouldn't get loaded when I execute xinit. Well, after changeing the name I exited and went back into the X server environment and there was no change in fonts and no error messages. So I am think this file isn't getting loaded, which means the .fonts.conf won't get loaded ether. What should I do?

----------

## boniek

 *IvanMajhen wrote:*   

> I'm using ubuntu patches and they work great. They also patch fontconfig. It is nice to have option to turn off
> 
> lcdfilter for some over bold fonts.
> 
> Openoffice will from 2.4 release use cairo to render text. 
> ...

 

Anything more on this topic? Where did this screenshot came from? Any code/patches? :Smile: 

----------

## IvanMajhen

 *boniek wrote:*   

>  *IvanMajhen wrote:*   I'm using ubuntu patches and they work great. They also patch fontconfig. It is nice to have option to turn off
> 
> lcdfilter for some over bold fonts.
> 
> Openoffice will from 2.4 release use cairo to render text. 
> ...

 

This is my screenshot.   :Very Happy: 

Precompiled binaries are from:

http://ooo.services.openoffice.org/pub/OpenOffice.org/cws/upload/cairotext01/

Just use rpm2targz to convert them, end then extract. To run openoffice just go to program folder and type:

SAL_USE_VCLPLUGIN=gtk ./soffice.bin -writer 

to use gtk theme and kde icons.

Patch is here:

http://cvs.fedora.redhat.com/viewcvs/rpms/openoffice.org/devel/workspace.cairotext01.patch?rev=1.6.2.1&view=markup

And ubuntu bug is here:

https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/54776

Are you still maintaining ebuilds? It would be wise to use ubuntu patches, since they are maintained and are in hardy by default.

I use their libXft, cairo-1.5.12, and fontconfig patches. They have option in fontconfig to disable lcdfilter on fly.

You could try talk to geki to include this patch in his oo ebuild's. I tried but...   :Twisted Evil: 

https://forums.gentoo.org/viewtopic-t-489909-postdays-0-postorder-asc-start-200.html

----------

## boniek

Alright - I will look into it  :Smile: 

OOo looks freaking awesome.

----------

## IvanMajhen

It works with 2.3 also!   :Laughing: 

If you need ebuild PM me.

I wish i found this patch before...  :Rolling Eyes: 

----------

## dman777

I would love to try these patches! Is there a tutorial on how to apply these patches?

----------

## IvanMajhen

For openoffice?

----------

## irasnyd

I've got an interesting problem. I've got x11-libs/cairo and x11-libs/libXft from the fonts overlay, and I have a custom ebuild to apply the patch from freedesktop #13566 that vonr mentioned above. I've added the "lcdfilter" stuff to my ~/.fonts.conf and it all works great. My fonts look lovely. No problems there.

The problem I have is that text rendering is SLOW. Really slow. I can see the text redrawing line by line in a TreeView widget, for example. I ran some tests using GtkPerf and it is not my imagination. The test that shows the problem for me is the GtkDrawingArea - Text test. It takes ~23 seconds to complete. This is on my desktop, which has a nVidia Ti4800 in it (NV28). I'm using nvidia's proprietary drivers, x11-drivers/nvidia-drivers-96.43.01. I wish I could use the newer versions, but this card isn't supported by them.

I also have a laptop set up in exactly the same way, with identical ebuilds and /etc/fonts/* configuration. The text rendering is also excellent. It looks exactly like my desktop. The difference is that the same GtkPerf test takes < 2 seconds, and text rendering is not slow at all. The laptop has a Intel GMA950 / 945GM graphics chip in it, which should be slower than the one in my desktop.

I've heard that slow text rendering can be caused by lack of RENDER acceleration. I'm pretty sure I have the acceleration turned on. This is the output of grep -i render /var/log/Xorg.0.log

```
   X.Org Font Renderer : 0.5

   Module class: X.Org Font Renderer

   ABI class: X.Org Font Renderer, version 0.5

   Module class: X.Org Font Renderer

   ABI class: X.Org Font Renderer, version 0.5

(**) NVIDIA(0): Option "RenderAccel" "true"

(**) NVIDIA(0): Enabling RENDER acceleration

(II) Initializing built-in extension RENDER

```

I've heard rumors that there are problems with the nvidia drivers on certain chipsets, but that nvidia just ignores the bug reports. I may be completely wrong in this regard.

Any ideas on how to make my text rendering faster?

----------

## PaulBredbury

Try e.g.:

```
nvidia-settings -a InitialPixmapPlacement=2 -a GlyphCache=1
```

See thread.

----------

## irasnyd

 *PaulBredbury wrote:*   

> Try e.g.:
> 
> ```
> nvidia-settings -a InitialPixmapPlacement=2 -a GlyphCache=1
> ```
> ...

 

Thanks. I read through that thread, and the one about the beta drivers. I guess the acceleration (GlyphCache) thing is only for 8xxx and 9xxx series cards. I'm stuck on the legacy 96.43.05 drivers. Oh well.

Thanks for the help, though. At least I know where to look now  :Smile: 

----------

## m.s.w

I see that there is cairo-1.5.12.ebuild in boniek's font-overlay, but it doesn't want to upgrade. I have cairo in package.keywords but still it doesn't go. What should I do to have it?

----------

## OmSai

Auto patching of the cairo-1.5.12.ebuild fails  :Confused: 

I updated the ebuild in the overlay:

```
# date

Sat Mar 22 14:20:09 EDT 2008

# layman -S

* Running command "/usr/bin/svn update "/usr/portage/local/layman/font-overlay""...

At revision 7.

* 

* Success:

* ------

* 

* Successfully synchronized overlay "font-overlay".
```

But the newspr patch doesn't work after src_unpack. Here's the relevant emerge output:

```
>>> Unpacking source...

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

 * Applying cairo-1.5.12-newspr.patch.bz2 ...

 * Failed Patch: cairo-1.5.12-newspr.patch.bz2 !

 *  ( /var/tmp/portage/x11-libs/cairo-1.5.12/temp/21365.patch )

 * 

 * Include in your bugreport the contents of:

 * 

 *   /var/tmp/portage/x11-libs/cairo-1.5.12/temp/cairo-1.5.12-newspr.patch.bz2-21365.out

 * 

 * ERROR: x11-libs/cairo-1.5.12 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_unpack

 *             environment, line 2740:  Called epatch 'src_unpack'

 *             environment, line 1531:  Called die

 * The specific snippet of code:

 *                   die "Failed Patch: ${patchname}!";

 *  The die message:

 *   Failed Patch: cairo-1.5.12-newspr.patch.bz2!

 * 

 * 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.5.12/temp/build.log'.

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

Relevant attachments:

cairo-1.5.12-newspr.patch.bz2-21365.out

build.log

environment

```
# emerge --info

Portage 2.1.4.4 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.24-zen4-g4bbcf6dd x86_64)

=================================================================

System uname: 2.6.24-zen4-g4bbcf6dd x86_64 AMD Athlon(tm) 64 Processor 3800+

Timestamp of tree: Sat, 22 Mar 2008 16:47:01 +0000

ccache version 2.4 [enabled]

app-shells/bash:     3.2_p17-r1

dev-java/java-config: 1.3.7, 2.1.4

dev-lang/python:     2.4.4-r9, 2.5.1-r3

dev-python/pycrypto: 2.0.1-r6

dev-util/ccache:     2.4-r7

sys-apps/baselayout: 1.12.11.1

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.26

virtual/os-headers:  2.6.22-r2

ACCEPT_KEYWORDS="amd64"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=athlon64 -O2 -pipe -ggdb"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/rc.d /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d /usr/share/X11"

CXXFLAGS="-march=athlon64 -O2 -pipe -ggdb"

DISTDIR="/usr/portage/distfiles"

FEATURES="ccache collision-protect distlocks fixpackages metadata-transfer nostrip sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://gentoo.cites.uiuc.edu/pub/gentoo/ "

LINGUAS="hi"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/layman/font-overlay /usr/local/portage /usr/local/overlays/xfce4-svn"

SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"

USE="3dnow 3dnowext X a52 aac acl acpi alsa amd amd64 apache2 avi berkdb cdr cli cracklib crypt cups dbus directfb divx divx4linux dri dts dvd dvdnav dvdread encode fame firefox flac fortran gdbm gif gmedia gpm gtk hal iconv ipod ipv6 isdnlog jpeg ldap libnotify live lm_sensors logitech-mouse mad matroska mesa midi mjpeg mmx mp3 mpeg mplayer mudflap ncurses newspr nls nptl nptlonly nsplugin ogg oggvorbis opengl openmp oss pam pcre pdf png pppd python qt3 qt4 quicktime readline realmedia reflection samba scanner sdl session spell spl sse sse2 ssl startup-notification subtitles svg swat tcpd tetex theora tiff truetype type1 unicode vorbis wma wmp xanim xcomposite xorg xscreensaver xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias auth_mysql" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="hi" USERLAND="GNU" VIDEO_CARDS="nvidia"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
```

I'm able to use cairo-1.4.14 from the overlay.

----------

## vonr

 *OmSai wrote:*   

> Auto patching of the cairo-1.5.12.ebuild fails

 

Just use these ebuilds. The tarball contains ebuilds for x11-libs/cairo-1.5.12 with the patch i posted earlier as well as an ebuild for media-libs/fontconfig-2.5.0-r1 with the patch from freedesktop #13566. Please note that the fontconfig ebuild also needs "fontconfig-2.3.2-docbook.patch" from the tree. You'll need both these ebuilds for the lcd filtering to work.

You'll also need to modify your /etc/fonts/local.conf or equivalent to contain something like this:

```
<!-- Enable freetype's new subpixel filter. Currently, only a cairo

version containing the patches from freedesktop #10301 respects this

setting. Fontconfig needs to be patched using the patches from freedesktop

#13566 for this to work; 2.6 will contain this functionality by default. -->

<match target="font">

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

        <const>lcddefault</const>

    </edit>

</match>
```

----------

## OmSai

Thank you, vonr!  :Very Happy: 

 *dman777 wrote:*   

> I would love to try these patches! Is there a tutorial on how to apply these patches?

 Here you go -

I'm assuming you downloaded the tarball vonr mentioned to your /tmp and you are logged in as root.

```
mkdir -p /usr/local/portage/x11-libs/cairo/files

mkdir -p /usr/local/portage/media-libs/fontconfig/files
```

The ebuilds you place in the /usr/local/portage/ folder takes precedence over the versions in the portage tree. So...

```
tar -xvf /tmp/lcd-filtering.tar.bz2

cd /tmp

cp cairo-1.5.12.ebuild /usr/local/portage/x11-libs/cairo/

cp cairo-lcd-filtering.patch /usr/local/portage/x11-libs/cairo/files/

cp fontconfig-2.5.0-r1.ebuild /usr/local/portage/media-libs/fontconfig/

cp fontconfig-lcdfilter-config.patch /usr/local/portage/media-libs/fontconfig/files/

cp /usr/portage/media-libs/fontconfig/files/fontconfig-2.3.2-docbook.patch /usr/local/portage/media-libs/fontconfig/files/
```

** Make sure your ~arch is included in the ebuilds!

** It only has ~x86 by default in the tarball.

I'm using amd64, so I simply added ~amd64 to the KEYWORDS like:

```
KEYWORDS=""~x86 ~amd64"
```

Implement this step (for you arch, if it is not x86) in both the cairo-1.5.12.ebuild and fontconfig-2.5.0-r1.ebuild

Now you have to create the Digests and Manifests for Portage (here's why)...

```
cd /usr/local/portage/x11-libs/cairo/

ebuild cairo-1.5.12.ebuild manifest

ebuild cairo-1.5.12.ebuild digest

cd /usr/local/portage/media-libs/fontconfig/

ebuild fontconfig-2.5.0-r1.ebuild manifest

ebuild fontconfig-2.5.0-r1.ebuild digest
```

All that remains now is to add the ~arch keywords per package to your /etc/portage/package.keywords

Replace ~amd64 with whatever your arch is.

```
cd /etc/portage/

echo "x11-libs/cairo ~amd64" >> package.keywords

echo "media-libs/fontconfig ~amd64" >> package.keywords
```

Modify your /etc/fonts/local.conf or equivalent as vonr said in the post above.

I actually use /etc/fonts/conf.d/51-local.conf

[edit]I've omploaded mine for you to make life easier[/edit]

Finally emerge!

```
emerge -Dav x11-libs/cairo

emerge -Dav media-libs/fontconfig
```

----------

## vonr

FYI I've updated the ebuilds in the tarball to re-contain their original keywords (well, not exactly: I've dropped fontconfig to ~arch). These ebuilds come from my own local overlay and I only use them on x86 hardware...   :Embarassed: 

----------

## trumee

Thanks guys for the new ebuild. Unfortunately, these patches dont seem to make any difference to my system. I have installed the vonr ebuilds on my amd64 system:

```

# emerge -pv cairo fontconfig

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

Calculating dependencies... done!

[ebuild   R   ] media-libs/fontconfig-2.5.0-r1  USE="xml -doc" 0 kB [1]

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

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

Portage tree and overlays:

 [0] /usr/portage

 [1] /usr/local/portage

```

I have also created the local.conf file in /etc/fonts. In my kde i have specified full hinting. Unfortunately, after this the fonts i get on the screen are so thin, that sometimes they are not very readable. This is what it looks like http://i29.tinypic.com/15e9x51.png

Is this what it is supposed to be like with these patches?

----------

## PaulBredbury

 *trumee wrote:*   

> Is this what it is supposed to be like?

 

Yes. Read this thread from the beginning, with reference to "DPI".

----------

## vonr

Updated the tarball with an ebuild for cairo-1.5.14.

----------

## Rikz

What about libXft, should I still use newspr patch? Or it is enough to use patched cairo and fontconfig.

----------

## vonr

 *Rikz wrote:*   

> What about libXft, should I still use newspr patch? Or it is enough to use patched cairo and fontconfig.

 

Yes, in order for the nice lcd filtering to work for non-cairo apps you'll need to use a patched libXft.

----------

## niick

Could someone please post an ebuild for openoffice, to enable the nice font rendering. I tried to apply the patch to the 2.4.0 ebuild but it failed  :Sad: 

----------

## dman777

OmSai,

Thank you so much for taking the time to write that tutorial! It is perfect. Thank you again! 

I have a question, copied and pasted the following into my /etc/fonts/local.conf:

<?xml version="1.0"?>

<!-- Enable freetype's new subpixel filter. Currently, only a cairo

version containing the patches from freedesktop #10301 respects this

setting. Fontconfig needs to be patched using the patches from freedesktop

#13566 for this to work; 2.6 will contain this functionality by default. -->

<match target="font">

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

        <const>lcddefault</const>

    </edit>

</match>

But I get a error when I launch an application like firefox:

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

Any suggestions?

Thanks,

-Darin

----------

## m.s.w

dman777,

it means, that you don't use this patched cairo and fontconfig.

----------

## dman777

I don't understand. I used the fontconfig that was patched and included in vonr's package.

----------

## m.s.w

Just check it once again, which version of fontconfig and cairo you emerged. Just focus and follow once again above instructions. I did it and it worked. Check if you don't have >x11-libs/cairo-1.4.6 in your /etc/portage/package.mask

----------

## IvanMajhen

 *niick wrote:*   

> Could someone please post an ebuild for openoffice, to enable the nice font rendering. I tried to apply the patch to the 2.4.0 ebuild but it failed 

 

I have ebuild for 2.4.0 that works. Send me PM with yours e-mail and I'll send it to you.

----------

## m.s.w

IvanMajhen - sent it to me, I will host it.

----------

## dman777

The version in vonr's package is cairo 1.4.14...not cairo 1.4.6 as you mentioned. Is that a problem?

Here's what I have emerged:

localhost ~ # emerge -pv x11-libs/cairo

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

Calculating dependencies... done!

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

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

Portage tree and overlays:

 [0] /usr/portage

 [1] /usr/portage/local/layman/font-overlay

localhost ~ # emerge -pv media-libs/fontconfig

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

Calculating dependencies... done!

[ebuild   R   ] media-libs/fontconfig-2.5.0-r1  USE="-doc -xml" 0 kB 

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

localhost ~ # 

----------

## PaulBredbury

I've created a patch for cairo-ubuntu 1.5.14, to compile with libtool versions 1.5* and 2.2 - see pkgbuild  :Smile: 

Edit: Fixed link, thanks to stupid AUR.Last edited by PaulBredbury on Wed Sep 17, 2008 7:30 pm; edited 1 time in total

----------

## IvanMajhen

 *m.s.w wrote:*   

> IvanMajhen - sent it to me, I will host it.

 

Send me e-mail on PM.

----------

## OmSai

 *PaulBredbury wrote:*   

> I've created a patch for cairo-ubuntu 1.5.14, to compile with libtool versions 1.5* and 2.2 - see pkgbuild and its patch 

 Could someone please ebuild this?  :Very Happy: 

----------

## boniek

 *OmSai wrote:*   

>  *PaulBredbury wrote:*   I've created a patch for cairo-ubuntu 1.5.14, to compile with libtool versions 1.5* and 2.2 - see pkgbuild and its patch  Could someone please ebuild this? 

 

Done in font-overlay.

----------

## octoploid

 *boniek wrote:*   

>  *OmSai wrote:*    *PaulBredbury wrote:*   I've created a patch for cairo-ubuntu 1.5.14, to compile with libtool versions 1.5* and 2.2 - see pkgbuild and its patch  Could someone please ebuild this?  
> 
> Done in font-overlay.

 

Does not build on my machine:

```
...

checking for correct ltmain.sh version... no

configure: error:

*** [Gentoo] sanity check failed! ***

*** libtool.m4 and ltmain.sh have a version mismatch! ***

*** (libtool.m4 = 1.5.24, ltmain.sh = "1.5.24 Debian 1.5.24-1") ***

Please run:

  libtoolize --copy --force

if appropriate, please contact the maintainer of this

package (or your distribution) for help.

```

----------

## PaulBredbury

 *octoploid wrote:*   

> configure: error:

 

The end of src_unpack should probably be:

```
eautoreconf  # inherit autotools

elibtoolize  # inherit libtool
```

With the obvious inherit line modification.

Notice my pkgbuild:

```
autoreconf -fi || return 1
```

----------

## swimmer

 *PaulBredbury wrote:*   

> 
> 
> The end of src_unpack should probably be:
> 
> ```
> ...

 

I can confirm that appending "autotools" to the inherit line and adding 

"eautoreconf" above "elibtoolize" fixes the compilation problem ...

Greetz

swimmer

----------

## boniek

Thanks guys. Problem should be fixed now  :Smile: 

----------

## aronparsons

Can we get the ebuild of fontconfig with the lcdfilter patch added to the overlay?  :Smile: 

----------

## anli

It seems like redigesting must take place:

```
emerge cairo

Calculating dependencies... done!

>>> Verifying ebuild Manifests...

!!! A file listed in the Manifest could not be found: /usr/portage/local/layman/font-overlay/x11-libs/cairo/files/cairo-1.5-libtool-2.2.patch.bz2

```

Manifest still has a ref to non-existing file.

----------

## boniek

 *aronparsons wrote:*   

> Can we get the ebuild of fontconfig with the lcdfilter patch added to the overlay? 

 

Will do. Give me more time  :Smile: 

 *anli wrote:*   

> Manifest still has a ref to non-existing file.

 

I will look into it.

----------

## natros

I have just updated from cairo-1.4.14 to 1.5.16 and i must say it does not look good

Before:

http://i31.tinypic.com/t4us8x.png

After:

http://i31.tinypic.com/28qq4pk.png

----------

## aronparsons

 *natros wrote:*   

> I have just updated from cairo-1.4.14 to 1.5.16 and i must say it does not look good
> 
> Before:
> 
> http://i31.tinypic.com/t4us8x.png
> ...

 

I had the same experience.  I believe I did everything correctly including the patched fontconfig and setting the fontconfig directive for the LCD filtering.  I've reverted back to 1.4.x for now.

----------

## creidiki

Has anyone tried renaming the ebuild to .20?

Also, boniek if youre still looking for hosting and dont mind using git we can give you a repo on the einit.org server  :Smile: 

----------

## creidiki

 *creidiki wrote:*   

> Has anyone tried renaming the ebuild to .20?

 

Replying to myself, yup, works clean with a simple ebuild rename.

----------

## PaulBredbury

cairo-ubuntu has been bumped to 1.5.20 with new libtool patch, if you Gentoo people are interested  :Wink: 

Edit: And it has new dependency:  pixman>=0.10.0

Edit2: Fixed URL for cairo-ubuntu because the Arch AUR is so stupid that it lets anyone delete the package!Last edited by PaulBredbury on Wed Sep 17, 2008 7:26 pm; edited 2 times in total

----------

## creidiki

 *PaulBredbury wrote:*   

> cairo-ubuntu has been bumped to 1.5.20 with new libtool patch, if you Gentoo people are interested 

 

How do the Ubuntu patches differ from the newspr patches?

----------

## PaulBredbury

The Ubuntu patches are the best in the universe  :Razz: 

Unless you've got a crappy monitor, or couldn't be bothered to configure ~/.fonts.conf properly.

----------

## creidiki

It seems that you would need freetype, libXft, fontconfig and cairo with the patches?

Is it noticeably better than newspr once you have all that (answer my question straight, monkey-man! ;p)

----------

## PaulBredbury

No. I've not been given any bananas.

And anyway, these questions are already answered about a zillion times in this thread, so read it.

----------

## creidiki

*me hands over some bananas*

Ok, lemme dive through thread ... aah, I see. so we're already using the ubuntu patches, basically. Cool.

The usefulness of libtool patch for gentoo is debatable given that its been hard-masked at the root level of all the profiles, but I guess it would be cool to have  :Smile: 

I'd whip up an overlay on einit.org/jyujin.de with 1.5.20 and the libtool patches, but I'll wait for boniek's response.

btw: I see that freetype2-ubuntu is involved, does gentoo need a patched freetype2 as well?

----------

## bosele

for me renaming the ebuild to .20 and updating also results in bad looking fonts, i've changed nothing else, just updated cairo, should i make more changes.

----------

## billydv

I  too  think  that  my  fonts  looked  better  before  updating  to  1.5.16,  maybe  we  should  try  to  get  the  ebuilds  put  together  using  the  Ubuntu  patches.

----------

## creidiki

I've got that mostly done - I'm testing them right now in fact, so far so good.

The ubuntu patches are /large/ however, so I've made freetype|fontconfig|libXft|cairo use the 'ubuntu' USE flag  :Razz: 

I'll post a tarball in a bit so you can test them yourself.

----------

## creidiki

Mk, here it is: http://jyujin.de/~creidiki/fontlibs-ubuntu.tar.lzma

These apply the whole of the ubuntu/debian patches, apart from those which are entirely debian/ubuntu specific - you have been warned  :Smile: 

edit: They all work good now. cairo and libXft are the same as the ones on boniek's overlay. Ubuntu cairo has no extra patches, they still use the same 1.5.12 newspr patch we do, i just updated it to 1.6.4. Their libXft has some extra stuff, but its a mess of a autohell makefile stuff I'm not gonna touch with a 50-foot pole. So really its just fontconfig and freetype:2 stuff on top of what we had already.

----------

## bosele

has anyone tried the tarball? (btw how do i extract the thing from the command line, google doesn't want to tell me for some reason)

----------

## PaulBredbury

lzma?? Just use tar.gz or tar.bz2 like the rest of the planet  :Wink: 

Anyway, it's already out-of-date - see cairo 1.6.4  :Cool: 

Edit: Some idiot has deleted cairo-ubuntu from the Arch AUR it seems, so here's a copy.Last edited by PaulBredbury on Mon Apr 21, 2008 5:06 pm; edited 1 time in total

----------

## billydv

Yeah, you have to recompress to something usable, I cant open your file!!!!!!  tar.gz!!!!!!!!!!!!

----------

## creidiki

You have lzma-utils, so use it.  :Razz: 

http://jyujin.de/~creidiki/fontlibs-ubuntu.tar.bz2

Updated, and now in crappy bzip2 format.  :Laughing: 

----------

## creidiki

Moved them to git cause I'm lazy:

sync: git://git.jyujin.de/creidiki/fonts.git

browse: http://git.jyujin.de/?p=creidiki/fonts.git;a=summary

----------

## ExZombie

creidiki: Man, thank you! I thought lzma only exists in 7zip. This is far more useful  :Smile: 

----------

## creidiki

Lots of gentoo packages use the .lzma tarballs so you have the progs already, but since tar 1.20 (out soon) will have LZMA support vapier hasn't bothered backporting it to 1.19  :Smile: 

----------

## bosele

well, i've tried the ubuntu ebuilds in the tarball, but i must say the results are not great. My fonts look kinda blurry and at times it has "stray" pixels. could you share your fontconfig? i would like to get some result before i downgrade the whole thing.

thanks in advance.

----------

## creidiki

Unfortunately the ubuntu patches for libXft need someone who understands autohell for tackling them. From a cursory look they appear to be a mix of debain/ubuntu specifc and generic changes.

So it could very well be that.

```
holy_fire ~ # 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-lohit-gujarati.conf

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

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

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

  [18]  25-unhint-nonlatin.conf

  [19]  30-amt-aliases.conf *

  [20]  30-metric-aliases.conf *

  [21]  30-urw-aliases.conf *

  [22]  40-generic.conf *

  [23]  40-nonlatin.conf *

  [24]  45-latin.conf *

  [25]  49-sansserif.conf *

  [26]  50-user.conf *

  [27]  51-local.conf *

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

  [29]  57-dejavu.conf *

  [30]  59-dejavu.conf *

  [31]  60-latin.conf *

  [32]  61-dejavu-experimental.conf *

  [33]  65-fonts-persian.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 *
```

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

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

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

    <const>lcdfilterdefault</const>

  </edit>

</fontconfig>
```

Certainly some experimenting with hintstyle and lcdfilter settings will be necessary to find out how good it all is. I'm still playing around with it myself.

----------

## PaulBredbury

If you have blurry fonts, then first curse your crappy monitor, then put in ~/.Xresources

```
Xft.lcdfilter:  lcdlegacy

Xft.hintstyle:  hintfull
```

This is needed because cairo cannot read fontconfig's settings, apparently. The choices are:  lcdnone, lcddefault, lcdlight, lcdlegacy

Then run:

```
xrdb -merge ~/.Xresources
```

And xrdb -query will optionally show that the values are set.

Also, put in ~/.fonts.conf

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

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

   <!-- Info:

   xeffects thread:  http://forums.gentoo.org/viewtopic-t-511382.html

   http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts

   http://wiki.archlinux.org/index.php/XOrg_Font_Configuration

   http://antigrain.com/research/font_rasterization/index.html

   -->

   <!-- Blurry fonts:  Try rgb, bgr, vrgb, vbgr for "rgba" -->

   <match target="font">

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

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

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

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

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

   </match>

   <!-- Greyscale for small fonts -->

   <match target="font">

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

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

   </match>

</fontconfig>
```

Play with the "rgba" setting where the "Blurry fonts" comment is. Then close and re-open firefox, to see the change.

Edit: Removed comment lines from ~/.Xresources, because Gentoo's xrdb gets indigestion  :Confused: 

Edit: Removed "filter" from Xft.lcdfilter, to match upstream's changes.Last edited by PaulBredbury on Wed Aug 06, 2008 3:05 pm; edited 3 times in total

----------

## confusion

The guide is currently offline. Is there an alternative?

John

----------

## PaulBredbury

Use Google and click on "Cached".

----------

## Jupiter1TX

Hey guys in case you didn't know app-arch/lzma-utils is in portage

and a simple 'lzma --help' shows to use 'lzma -d filename'. It worked

perfectly fine.

Am currently using the simple local.font as shown above and my fonts

never looked better.

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

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

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

    <const>lcdfilterdefault</const>

  </edit>

</fontconfig>
```

This screenshot doesn't do it justice but ok example.

http://img394.imageshack.us/my.php?image=fonts3cq6.jpg

----------

## PaulBredbury

The place to set lcdfilter is in ~/.Xresources, rather than /wherever/fonts.conf

lcdfilterdefault is the default anyway  :Wink: 

----------

## creidiki

 *Jupiter1TX wrote:*   

> Hey guys in case you didn't know app-arch/lzma-utils is in portage
> 
> and a simple 'lzma --help' shows to use 'lzma -d filename'. It worked
> 
> perfectly fine.

 

Tar 1.20 is now in portage, with upstream lzma support  :Very Happy: 

----------

## billydv

Paul, here  is  what  I  get

Windows2 billydv # xrdb -merge /home/billydv/.Xresources

/home/billydv/.Xresources:2:46: warning: missing terminating ' character

Windows2 billydv #                                

Is  that  right?

----------

## PaulBredbury

 *Quote:*   

> missing terminating ' character

 

No, that is not right. Dunno how you managed that  :Confused: 

----------

## billydv

Sorry, tried it again, definitely no mistakes copying, don't know whats wrong.

----------

## bosele

same here on the issing terminating ' character

----------

## Jupiter1TX

Hey guys i ran into the same thing and this is what fixed it.

Rather then cut and pasting the whole thing.

```

! From http://johan.kiviniemi.name/blag/2008/01/12/ubuntu-hardy-fonts/

! Needed because cairo cannot read fontconfig's settings, apparently.

! xrdb -query

! xrdb -merge ~/.Xresources

! Choices:  lcdfilternone, lcdfilterdefault, lcdfilterlight, lcdfilterlegacy

Xft.lcdfilter:  lcdfilterlegacy

Xft.hintstyle:  hintfull
```

Just put.

```
Xft.lcdfilter:  lcdfilterlegacy

Xft.hintstyle:  hintfull
```

----------

## PaulBredbury

OK, fixed. I've also removed "lcdfilter" from ~/.fonts.conf, because Wine says:

 *Quote:*   

> Fontconfig warning: "~/.fonts.conf", line 75: invalid constant used : lcdfilterdefault

 

----------

## zach9824

Thanks to everyone who has worked so hard on getting awesome font rendering on Gentoo. The latest Ubuntu patches seem to really sharpen up my display and I get nice clean albeit thinner fonts. I like the fonts a bit thinner on my LCD. On another display they are a bit bolder and I need to play with the settings when I find time. Overall I am really pleased.

In following the steps listed above and to add to what PaulBredbury has provided I noticed that xrdb -query did not have the Xft.rgba: <value> set properly:

```

Xft.antialias:  1

Xft.hinting:    1

Xft.hintstyle:  hintfull

Xft.lcdfilter:   lcdfilterlegacy

Xft.rgba:       none

```

So I additionally added the Xft.rgba <value> to the ~/.Xresources file (where value should match your ~/.fonts.conf setting):

```

Xft.lcdfilter:   lcdfilterlegacy

Xft.hintstyle:  hintfull

Xft.rgba:       rgb

```

EDIT: OK. Once you reboot the setting defaults back to none! It does not seem to hurt anything and I guess the value is overridden somewhere. Either way the fonts look very good when using lcdfilterlegacy setting.

Thanks.

----------

## PaulBredbury

zach9824, are you starting xorg via startx, or via gdm/xdm? Because /etc/X11/xinit/xinitrc should load ~/.Xresources:

```
userresources=$HOME/.Xresources

...

if [ -f $userresources ]; then

    xrdb -merge $userresources

fi
```

In Arch Linux, /etc/X11/xinit/xinitrc is owned by xorg-xinit 1.0.7-3

Then take a look at /usr/bin/startx and how $HOME/.xinitrc will be used in preference to /etc/X11/xinit/xinitrc if it exists.

xorg was obviously designed to confuse us  :Evil or Very Mad: 

----------

## zach9824

I should first clarify that the only value that appears to be not sticking is the Xft.rgba.

My WM is KDE-3.5.9 started via xdm on boot using the new baselayout-2 which just entered ~arch. I checked those files and everything looks as you suggested it should. I guess there is not a problem with xrdb -merge $userresources in that it actually does set the other values. 

It does appear however that the rgba value does not appear to be reading the Xresources unless I manually run xrdb -merge ~/.Xresources after I am already up and running within KDE. 

Again I don't even know if it makes a difference as changing rgba settings in my local fonts.conf appears to work when I actually change my LCD/font rendering to say "bgr" as opposed to "rgb" I see the difference upon restarting X...

PS. I tried killing the X session stopping xdm and just staring X via startx on my user account. The same result. (my ~/.xinitrc has exec startkde).

Wow - That is confusing!  :Smile: 

thanks.

----------

## PaulBredbury

With xdm, there's no need for ~/.xinitrc AFAICT.

But if you are going to keep ~/.xinitrc, then I would suggest sticking in ~/.xprofile or whatever file runs at "user xorg window-manager startup" in this crazy Xorg world:

```
/usr/bin/xrdb -merge ~/.Xresources
```

For me, Xft.rgba seems to be automagically set to rgb, perhaps due to /etc/fonts/conf.d/ or ~/.fonts.conf

----------

## billydv

I  just  wanted  to  ask  something  here,  although  I  am  using  these  ebuilds,  I  do  not  have  and  lcd  monitor,  I  have  an  IBM  thinkvision  19"  crt  monitor.  What  if  anyhting  should  I  be  doing  different?

----------

## PaulBredbury

Sub-pixel rendering only benefits LCD monitors, not CRT. However, you might benefit from Ubuntu's colored/greyscale pixel rendering. Just experiment with the options.

----------

## natros

what's the difference between .Xresources and .fonts.conf? isn't changing .fonts.conf enough?

----------

## zach9824

Well I figured out what was wrong with my set-up. Long ago I had set some options from within Kcontrol -> fonts. When those settings are changed they automatically override the defaults within ~/.fonts.conf. Setting the KDE Contro panel settings back to the default "use system settings" and re-copying your examples listed above to my ~/.fonts.conf fixes my issues and the fonts even look better still as the correct Sub-pixel setting "rgb" (for my set-up) is now set properly.

So if anyone is experiencing strange issues and using KDE then you should check that your  KDE -> Appearance & Themes -> Control Center -> Fonts -> Use anti-aliasing setting is set to "SYSTEM SETTINGS". Otherwise whatever you have set will keep wiping out your local settings and using KDE defined values.

 *PaulBredbury wrote:*   

> With xdm, there's no need for ~/.xinitrc AFAICT.
> 
> But if you are going to keep ~/.xinitrc, then I would suggest sticking in ~/.xprofile or whatever file runs at "user xorg window-manager startup" in this crazy Xorg world:
> 
> ```
> ...

 

----------

## creidiki

Moved overlay.

sync: git://repo.or.cz/gentoo-soor-overlay.git

browse: http://repo.or.cz/w/gentoo-soor-overlay.git

----------

## OmSai

 *creidiki wrote:*   

> Moved overlay.
> 
> sync: git://repo.or.cz/gentoo-soor-overlay.git
> 
> browse: http://repo.or.cz/w/gentoo-soor-overlay.git

 

I'm getting this error compiling cairo from your overlay -

```
 x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I. -I/usr/include/freetype2 -D_REENTRANT -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/pixman-1 -Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations -Wdeclaration-after-statement -Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -fno-strict-aliasing -march=athlon64 -O2 -pipe -ggdb -finline-limit=1200 -MT libcairo_la-cairo-xlib-display.lo -MD -MP -MF .deps/libcairo_la-cairo-xlib-display.Tpo -c cairo-xlib-display.c -o libcairo_la-cairo-xlib-display.o >/dev/null 2>&1

cairo-xlib-screen.c: In function '_cairo_xlib_init_screen_font_options':

cairo-xlib-screen.c:192: error: 'FC_LCD_FILTER_DEFAULT' undeclared (first use in this function)

cairo-xlib-screen.c:192: error: (Each undeclared identifier is reported only once

cairo-xlib-screen.c:192: error: for each function it appears in.)

cairo-xlib-screen.c:235: error: 'FC_LCD_FILTER_NONE' undeclared (first use in this function)

cairo-xlib-screen.c:238: error: 'FC_LCD_FILTER_LIGHT' undeclared (first use in this function)

cairo-xlib-screen.c:241: error: 'FC_LCD_FILTER_LEGACY' undeclared (first use in this function)

make[2]: *** [libcairo_la-cairo-xlib-screen.lo] Error 1

make[2]: *** Waiting for unfinished jobs....

mv -f .deps/libcairo_la-cairo-xlib-display.Tpo .deps/libcairo_la-cairo-xlib-display.Plo

make[2]: Leaving directory `/var/tmp/portage/x11-libs/cairo-1.6.4/work/cairo-1.6.4/src'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/x11-libs/cairo-1.6.4/work/cairo-1.6.4'

make: *** [all] Error 2

 * 

 * ERROR: x11-libs/cairo-1.6.4 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 2719:  Called die

 * The specific snippet of code:

 *       emake || die "compile failed"

 *  The die message:

 *   compile failed

 * 

 * 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.6.4/temp/build.log'.

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

```
Portage 2.1.4.4 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.24-zen5-g89f66354 x86_64)

=================================================================

System uname: 2.6.24-zen5-g89f66354 x86_64 AMD Athlon(tm) 64 Processor 3800+

Timestamp of tree: Tue, 29 Apr 2008 00:45:01 +0000

ccache version 2.4 [enabled]

app-shells/bash:     3.2_p17-r1

dev-java/java-config: 1.3.7, 2.1.4

dev-lang/python:     2.4.4-r9, 2.5.1-r3

dev-python/pycrypto: 2.0.1-r6

dev-util/ccache:     2.4-r7

sys-apps/baselayout: 1.12.11.1

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.26

virtual/os-headers:  2.6.23-r3

ACCEPT_KEYWORDS="amd64"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=athlon64 -O2 -pipe -ggdb"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/rc.d /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d /usr/share/X11"

CXXFLAGS="-march=athlon64 -O2 -pipe -ggdb"

DISTDIR="/usr/portage/distfiles"

FEATURES="ccache collision-protect distlocks fixpackages metadata-transfer nostrip sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://gentoo.cites.uiuc.edu/pub/gentoo/ "

LINGUAS="hi"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/layman/font-overlay /usr/portage/local/layman/gentoo-soor-overlay /usr/local/portage /usr/local/overlays/xfce4-svn"

SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"

USE="3dnow 3dnowext X a52 aac acl acpi alsa amd amd64 apache2 avi berkdb cairo cdr cli cracklib crypt cups dbus directfb divx divx4linux dri dts dvd dvdnav dvdread encode fame fastcgi firefox flac fortran gdbm gif gmedia gpm gtk hal iconv inifile ipod ipv6 isdnlog jpeg ldap libnotify live lm_sensors logitech-mouse mad matroska mesa midi mjpeg mmx mp3 mpeg mplayer mudflap ncurses newspr nls nptl nptlonly nsplugin ogg oggvorbis opengl openmp oss pam pcre pdf php php5 png postgres pppd python qt3 qt4 quicktime readline realmedia reflection samba scanner sdl session spell spl sqlite3 sse sse2 ssl startup-notification subtitles svg swat tcpd tetex theora tiff truetype type1 unicode vorbis wma wmp xanim xcomposite xine xinetd xorg xscreensaver xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias auth_mysql" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="hi" USERLAND="GNU" VIDEO_CARDS="nvidia"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
```

----------

## creidiki

You need freetype2/fontconfig/libXft from this overlay with ubuntu/newspr patches enabled to compile that, have you done that?  :Smile: 

----------

## yabbadabbadont

I was wondering if there are still any patch sets around for the "stable" versions of cairo (1.4.14) and libXft?  Well, I guess that there is only one version of libXft in portage.

----------

## PaulBredbury

cairo 1.6.x is the stable branch.

----------

## OmSai

 *creidiki wrote:*   

> You need freetype2/fontconfig/libXft from this overlay with ubuntu/newspr patches enabled to compile that, have you done that? 

 That fixed it; thanks!

----------

## creidiki

yw.

I'll add built_with_use checks when I can find the time and gather up the necessary 'can-be-bothered' factor  :Wink: 

----------

## anli

Is it safe to ignore the meassage?

 *Quote:*   

> * Overlay eclasses override eclasses from PORTDIR:
> 
>  *
> 
>  *   '/usr/portage/local/layman/gentoo-soor-overlay/eclass/qt4.eclass'
> ...

 

----------

## tatotato

Yeah, they're just handy informational messages.   :Smile: 

----------

## yabbadabbadont

 *PaulBredbury wrote:*   

> cairo 1.6.x is the stable branch.

 

Quit trolling...   :Razz:   :Very Happy: 

It is still keyword masked in the portage tree.

----------

## elkhunter

I pulled in the soor overlay but when I try to emerge -pv cairo libXft freetype fontconfig I get the following errors:

 * Overlay eclasses override eclasses from PORTDIR:

 * 

 *   '/usr/portage/local/gentoo-soor-overlay/eclass/qt4.eclass'

 *   '/usr/portage/local/gentoo-soor-overlay/eclass/qt4-build.eclass'

 * 

 * It is best to avoid overridding eclasses from PORTDIR because it will

 * trigger invalidation of cached ebuild metadata that is distributed with

 * the portage tree. If you must override eclasses from PORTDIR then you

 * are advised to run `emerge --regen` after each time that you run `emerge

 * --sync`. Set PORTAGE_ECLASS_WARNING_ENABLE="0" in /etc/make.conf if you

 * would like to disable this warning.

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

Calculating dependencies ... done!

[ebuild   R   ] media-libs/freetype-2.3.5-r2  USE="X ubuntu%* utils -bindist -debug -doc" 0 kB [0=>1]

[ebuild   R   ] media-libs/fontconfig-2.5.0-r1  USE="ubuntu%* xml -doc" 0 kB [0=>1]

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

[ebuild   R   ] x11-libs/cairo-1.6.4  USE="X glitz newspr opengl svg -debug -directfb -doc -test -xcb" 0 kB [1]

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

Portage tree and overlays:

 [0] /usr/portage

 [1] /usr/portage/local/gentoo-soor-overlay

Am I missing something?  I had been using the gentoo-china overlay and had great fonts then I did an update of the world and now my fonts are really ugly.  From what I can tell reading through this (long) thread, I don't need gentoo-china anymore and instead just need the soor overlay, right?

----------

## creidiki

The warning is just your package manager trying to masquerade the fact that its broken by complaining about perfectly reasonable stuff  :Razz: 

Ignore it.

----------

## neuron

Having a little problem, using font-overlay right now, and everything is.. decent, can't quite get it as good as I remember it being ages ago, but it's decent, EXCEPT, this pdf:

http://boo.codehaus.org/BooManifesto.pdf

Which is completely unreadable, looks like spacing between characters is completely screwed up.

Screenshot : http://img216.imageshack.us/my.php?image=screweduplx7.png

Any suggestions?

Also, and quick howto on how to get it good now?  So many different ways of doing it these ways, and they dont coexist too happily :p, it'd be nice with short lcd howto of which fonts in xorg.conf & installed/.fonts.conf/patchset.  I tend to spend ages tinkering with my fonts now and then, and then the rest of the day trying to get it back to the way it was before I started screwing with it  :Razz: 

----------

## creidiki

You'll have to ask Paul if you want a Howto, all I know is how to mainatin the ebuilds (kinda) and how to make it look good on /my/ box.

```
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

  [19]  30-amt-aliases.conf *

  [20]  30-metric-aliases.conf *

  [21]  30-urw-aliases.conf *

  [22]  40-generic.conf *

  [23]  40-nonlatin.conf *

  [24]  45-latin.conf *

  [25]  49-sansserif.conf *

  [26]  50-user.conf *

  [27]  51-local.conf *

  [28]  53-monospace-lcd-filter.conf *
```

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

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

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

    <const>lcdfilterdefault</const>

  </edit>

</fontconfig>
```

----------

## neuron

Doing that I get:

```

Fontconfig warning: "local.conf", line 6: invalid constant used : lcdfilterdefault

Fontconfig warning: "/etc/fonts/conf.d/53-monospace-lcd-filter.conf", line 17: invalid constant used : lcdfilterlegacy

```

And while most of my fonts looks great, for example Times look horrible, could you list your font section from xorg.conf, and all the font packages you have installed?

cat /etc/X11/xorg.conf | grep 'font'

equery list  | grep 'media-fonts'

----------

## creidiki

That shouldn't happen with the ubuntu-patched freetype-2/fontconfig ... strange.

It doesn't here, at any rate.

----------

## neuron

 *creidiki wrote:*   

> That shouldn't happen with the ubuntu-patched freetype-2/fontconfig ... strange.
> 
> It doesn't here, at any rate.

 

The default times font also look really bad, probably because I've screwed around with it for so long, and have some "stale" fonts installed or something.

The output of :

cat /etc/X11/xorg.conf | grep 'font'

equery list | grep 'media-fonts'

Would help a lot, so I can clear out the fonts packages I have that aren't needed.

----------

## swimmer

I achieved a better looking times font by enabling 70-no-bitmaps.conf and of course disabling 70-yes-bitmaps.conf  :Wink: 

HTH

swimmer

----------

## creidiki

 *neuron wrote:*   

> cat /etc/X11/xorg.conf | grep 'font'

 

```
(nothing)
```

 *neuron wrote:*   

> equery list | grep 'media-fonts'

 

```
media-fonts/adi-dsp-fonts

media-fonts/arkpandora

media-fonts/artwiz-aleczapka-en

media-fonts/cheapskatefonts

media-fonts/corefonts

media-fonts/cronyx-fonts

media-fonts/dejavu

media-fonts/efont-unicode

media-fonts/encodings

media-fonts/essays1743

media-fonts/font-adobe-100dpi

media-fonts/font-adobe-75dpi

media-fonts/font-adobe-utopia-type1

media-fonts/font-alias

media-fonts/font-bh-ttf

media-fonts/font-bh-type1

media-fonts/font-bitstream-100dpi

media-fonts/font-bitstream-speedo

media-fonts/font-bitstream-type1

media-fonts/font-cursor-misc

media-fonts/font-ibm-type1

media-fonts/font-micro-misc

media-fonts/font-misc-misc

media-fonts/font-mutt-misc

media-fonts/font-util

media-fonts/font-xfree86-type1

media-fonts/freefont-ttf

media-fonts/freefonts

media-fonts/gnu-gs-fonts-other

media-fonts/gnu-gs-fonts-std

media-fonts/hunkyfonts

media-fonts/intlfonts

media-fonts/lfpfonts-fix

media-fonts/lfpfonts-var

media-fonts/sharefonts

media-fonts/tengwar-fonts

media-fonts/terminus-font

media-fonts/ttf-bitstream-vera

media-fonts/ttf-gentium

media-fonts/ttf-sil-charis

media-fonts/ttf-sil-doulos

media-fonts/unifont

media-fonts/urwvn-fonts
```

----------

## PaulBredbury

Specify lcdfilterblah in ~/.Xresources and not in ~/.fonts.conf

That means not in /etc/fonts/

----------

## creidiki

Yell at ubuntu then, 53-monospace-lcd-filter.conf is from their patches  :Smile: 

----------

## PaulBredbury

Ubuntu messed up there. I'm quite happy to forgive them, since they have the best font rendering.

----------

## natros

 *PaulBredbury wrote:*   

> Specify lcdfilterblah in ~/.Xresources and not in ~/.fonts.conf
> 
> That means not in /etc/fonts/

 

What's the difference between those two files? I have always made my changes in ~/.fonts.conf

I think we all agree that the Ubuntu fonts have a better looking, why don't the gentoo devs use the ubuntu patchs?

What's the "official" source/overlay? I have seen tar files, svn sources, git sources, xeffects overlay, fonts overlay,... I'ts a mess. I will not volunteer for writing docs as my english is bad but if you need my help for other things I'm available.

----------

## creidiki

I'd like to know when people are getting those warnings.

Because I've got lcdfilter stuff set in fonts.conf, and no warning  :Question:   :Shocked: 

----------

## PaulBredbury

The warning isn't always shown - I think it depends on the app. IIRC, wine will moan about it.

----------

## r0shi

Is the link in the first post for a howto on using the cleartype patches?

Its offline at the moment, is there a mirror?

----------

## neuron

 *PaulBredbury wrote:*   

> The warning isn't always shown - I think it depends on the app. IIRC, wine will moan about it.

 

Just realized I'm on 64bit, and wine is ofcourse using 32bit libraries  :Smile: 

Gonna do a ABI=x86 and replace my 32bit libraries  :Smile: 

----------

## creidiki

Ah, that would be it.

Because I'm pretty sure lcdfilter* is in fact supposed to go in fonts.conf. It certainly works here  :Razz: 

----------

## deno

Hi,

I am trying to compile fontconfig-2.5.0-r1 from soor overlay ant it simply fails (no error messages) with and without ubuntu USE flag enabled on running autoconf. Any hints?

----------

## creidiki

 *deno wrote:*   

> Hi,
> 
> I am trying to compile fontconfig-2.5.0-r1 from soor overlay ant it simply fails (no error messages) with and without ubuntu USE flag enabled on running autoconf. Any hints?

 

I am aware of the issue.

I need to collect the libtool/autoconf/automake patches that have been recently applied to the font packages in portage to build with the latest versions of the above toolchain packages. I'll do it when I'm done updating qt-copy in preparation of 4.4.0 final, which was released last night.

You can either wait till tonight/tomorrow, or use stable autoconf.

----------

## deno

Thanks creidiki. I'll wait. btw. I tried stable autoconf last night but got message that >=2.6(hm, that's maybe not the right version, but cannot check now as I am not using gentoo atm.) is required.

----------

## creidiki

latest stable autoconf is 2.61-r2. 2.62 breaks a number of packages.

same situation for libtool 2.2 vs libtool 1.5

I haven't heard anything about automake, it might even be ok since its just a revbump but with GNU tools im not taking the risk  :Razz: 

----------

## deno

Here it compiles with autoconf-2.62 and libtool-2.2.4.

----------

## creidiki

*cough* thats cause I added the libtool patch from portage yesterday evening >_>

----------

## deno

Thanks  :Smile:  I got it.

----------

## Snaury

Creidiki, your repository has qt-3.3.8-r4 marked as ~x86, official is x86. This causes qt to downgrade to qt-3.3.4-r8, which pulls freetype-2.1. Could you please maybe make a separate fonts overlay? Your new soor overlay has just too many packages, unrelated to fonts as it seems...

----------

## natros

 *Snaury wrote:*   

> Creidiki, your repository has qt-3.3.8-r4 marked as ~x86, official is x86. This causes qt to downgrade to qt-3.3.4-r8, which pulls freetype-2.1. Could you please maybe make a separate fonts overlay? Your new soor overlay has just too many packages, unrelated to fonts as it seems...

 

I agree with you

----------

## treellama

I just symlinked the four fonts packages in question into my local overlay, without bothering to add gentoo-soor-overlay to PORTDIR_OVERLAY. Seems like an easy enough solution.

----------

## creidiki

 *Snaury wrote:*   

> Creidiki, your repository has qt-3.3.8-r4 marked as ~x86, official is x86. This causes qt to downgrade to qt-3.3.4-r8, which pulls freetype-2.1. Could you please maybe make a separate fonts overlay? Your new soor overlay has just too many packages, unrelated to fonts as it seems...

 

I'll change the keywords on the qt packages.

but that's it, managing 3 overlays was too much of a pain.

anyway, you can just change your keywords for that one package, you know ...

----------

## kaildio

From fonts/conf.d/53-monospace-lcd-filter.conf

```
    

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

      <const>lcdfilterlegacy</const>

    </edit>

```

in other parts i've seen lcdfilter instead of lcd_filter as filter name.

Which one is correct?

----------

## GoofyX

Hey guys, boniek seems to have not replied to this thread for some time now. What's the status with the font rendering patches? I'm still using boniek's overlay, but during the latest weeks, it has been unable to sync, since the host is down. Should I use a new overlay (although the current one seems to work pretty fine)?

----------

## aronparsons

 *kaildio wrote:*   

> From fonts/conf.d/53-monospace-lcd-filter.conf
> 
> ```
>     
> 
> ...

 

The fontconfig portion of this is committed upstream as of commit 53aec111074cf7b46d15eb84a55791d3c95bc15e included in release 2.5.92.  The filter names changed; your fontconfig files will need to use 'lcddefault' instead of 'lcdfilter_default'.

----------

## paladin-zero

I found that after following the directions in this thread, xrdb -query showed that my Xft.hintstyle was medium and Xft.rgba was none. I'm using kde-3.5.9. I tried setting these properties in ~/.Xresources, but they were ignored. I think kde must be overriding the settings. Anyway, I added a file to .kde/Autostart:

#!/bin/bash

xrdb -merge ~/.Xresources

Ok, its a hack, but now the settings really do stick, even after logging out and back in. I finally have beautiful fonts in emacs!

----------

## Phlogiston

Could anyone please write some short howto what is needed to get that working again? Earlier I used xeffects overlay, but now its gone and the howto too, so that would be damn nice! Or maybe someone has the text and can put it on gentoo wiki?

Thanks in advance

/edit: Here is the original article from xeffects:

http://web.archive.org/web/20070816222614/http://wiki.gentoo-xeffects.org/Font_Rendering

That should go into the wiki right?

----------

## GoofyX

Hey people, I haven't kept up with the progress of this thread and it now seems that the soor-overlay has all the ebuilds for the packages that boniek maintained in his local overlay. Is that the case? Is there a howto for this? I added soor-overlay and there is a ubuntu USE flag now, what's the deal with it?

----------

## aronparsons

 *GoofyX wrote:*   

> Hey people, I haven't kept up with the progress of this thread and it now seems that the soor-overlay has all the ebuilds for the packages that boniek maintained in his local overlay. Is that the case? Is there a howto for this? I added soor-overlay and there is a ubuntu USE flag now, what's the deal with it?

 

Enable "ubuntu" and "newspr" USE flags.  Emerge cairo, freetype and libXft from soor-overlay.  fontconfig 2.60 is in Portage and has the ability to use the new filters.

Add the following to /etc/fonts/local.conf and make sure it is enabled (eselect fontconfig list).

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

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

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

    <const>lcddefault</const>

  </edit>

</fontconfig>
```

Enjoy.

----------

## anli

```
* You need to rebuild fontconfig with ubuntu USE enabled

 * before you can compile libXft with newspr.

 *

 * ERROR: x11-libs/libXft-2.1.12 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called pkg_setup

 *    libXft-2.1.12.ebuild, line   34:  Called die

 * The specific snippet of code:

 *              die "Please rebuild fontconfig with ubuntu enabled."

```

But fontconfig has not ubuntu flag:

```
emerge -pv fontconfig cairo freetype libXft

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

Calculating dependencies... done!

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

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

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

[ebuild   R   ] x11-libs/cairo-1.6.4  USE="X glitz newspr opengl svg -debug -directfb -doc -test -xcb" 0 kB [1]

```

----------

## bi3l

 *aronparsons wrote:*   

> fontconfig 2.60 is in Portage and has the ability to use the new filters.

 

Wrong, cairo from soor does not build with fontconfig-2.6.0 from portage because lcd filtering is missing.

----------

## IvanMajhen

Fontconfig 2.6 has lcd patches in it, but cairo patch needs to be updated.

Ubuntu patches for fontconfig were calling this fontconfig functions in cairo:

```
    switch (xft_lcdfilter) {

    case FC_LCD_FILTER_NONE:

       lcd_filter = CAIRO_LCD_FILTER_NONE;

       break;

    case FC_LCD_FILTER_LIGHT:

       lcd_filter = CAIRO_LCD_FILTER_LIGHT;

       break;

    case FC_LCD_FILTER_LEGACY:

       lcd_filter = CAIRO_LCD_FILTER_LEGACY;

       break;

    case FC_LCD_FILTER_DEFAULT:

    default:

       lcd_filter = CAIRO_LCD_FILTER_DEFAULT;

       break;

    }
```

New fontconfig functions names are:

```
    switch (xft_lcdfilter) {

    case FC_LCD_NONE:

       lcd_filter = CAIRO_LCD_FILTER_NONE;

       break;

    case FC_LCD_LIGHT:

       lcd_filter = CAIRO_LCD_FILTER_LIGHT;

       break;

    case FC_LCD_LEGACY:

       lcd_filter = CAIRO_LCD_FILTER_LEGACY;

       break;

    case FC_LCD_DEFAULT:

    default:

       lcd_filter = CAIRO_LCD_FILTER_DEFAULT;

       break;

    }
```

FC_LCD_FILTER_LIGHT now becomes FC_LCD_LIGHT

Fontconfig options are also changed:

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

        <!-- lcdnone, lcddefault, lcdlight, lcdlegacy -->

```

If somebody needs ebuilds PM.

----------

## gkmac

 *GoofyX wrote:*   

> Hey guys, boniek seems to have not replied to this thread for some time now. What's the status with the font rendering patches? I'm still using boniek's overlay, but during the latest weeks, it has been unable to sync, since the host is down. Should I use a new overlay (although the current one seems to work pretty fine)?

 People have been using soor-overlay, but that hasn't been updated for nearly a month now. media-libs/freetype has just been bumped to 2.3.6 in portage due to security issues, but soor-overlay's version is still the vulnerable 2.3.5-r2, so we may have a problem if this overlay isn't updated any more.

Could be time for someone else to make yet another overlay for these font patches; how long will that overlay last?

----------

## GoofyX

The truth is that maintaining an overlay requires time and it's not always the easiest thing to do. Until these patches are accepted in the official portage tree or even better upstream, we will have to deal with this situation...

The least we can do is to thank all those people that maintain overlays such as the soor-overlay.

----------

## bi3l

I've ported the patches to fontconfig-2.6.0, freetype-2.3.6 and cairo-1.6.4 and fixed a few issues. PM me if you want the ebuilds and patches.

----------

## GoofyX

 *bi3l wrote:*   

> I've ported the patches to fontconfig-2.6.0, freetype-2.3.6 and cairo-1.6.4 and fixed a few issues. PM me if you want the ebuilds and patches.

 

Why don't you post them here?

----------

## bi3l

Here it is: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

----------

## GoofyX

Nice, thank you!  :Smile: 

----------

## deno

Thanks.

----------

## natros

thank you

----------

## bi3l

Don't forget to emerge cairo again after upgrading freetype and fontconfig. There is no need to emerge libXft again.

----------

## yabbadabbadont

 *bi3l wrote:*   

> Here it is: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

 

Thank you for taking the time and effort to do this.

I've been wondering though, why the masked version of fontconfig is patched, while the rest are the stable versions?  Is there something special about the 2.6.0 version, or is it just that the original patches were made for that version?

----------

## ubercow

How do you get the patch's spr working with 32 bit binaries on amd64? Ive replaced all the cairo, Xft, fontconfig and freetype emul-linux libraries with compiled patched ones, but for eg. firefox-bin still shows old spr fonts. Any ideas?

----------

## PaulBredbury

firefox-bin has been compiled to *not* use the system's Cairo, I believe.

----------

## yabbadabbadont

 *PaulBredbury wrote:*   

> firefox-bin has been compiled to *not* use the system's Cairo, I believe.

 

When did they change that?  It used to work for me when I was using these patches (actually, the original patches from the start of this thread).  Granted, it was a while ago though.

EDIT: I can confirm that firefox-bin works fine with these patches on x86.  The text is all purrrty now...   :Very Happy: Last edited by yabbadabbadont on Mon Jun 16, 2008 6:20 am; edited 2 times in total

----------

## ubercow

 *PaulBredbury wrote:*   

> firefox-bin has been compiled to *not* use the system's Cairo, I believe.

 

I'd like to compile a firefox package in a 32 bit chroot for installing onto amd64. Would this then use the system emul- libraries? I have tried this but I get this problem whenever I try to use the package: https://forums.gentoo.org/viewtopic-t-693080-highlight-.html

----------

## bosele

 *Quote:*   

> 
> 
> Here it is: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2
> 
> 

 

first of all thanks a lot, but what settings do i use for /etc/fonts/local.conf?

I have this atm 

```

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

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

    <const>lcddefault</const>

  </edit>

</fontconfig>

```

and it's not looking great, so  could you please give an overview of the exact settings needed in order to use the ebuilds in that particular tarball?

----------

## ubercow

 *yabbadabbadont wrote:*   

>  *PaulBredbury wrote:*   firefox-bin has been compiled to *not* use the system's Cairo, I believe. 
> 
> When did they change that?  It used to work for me when I was using these patches (actually, the original patches from the start of this thread).  Granted, it was a while ago though.
> 
> EDIT: I can confirm that firefox-bin works fine with these patches on x86.  The text is all purrrty now...  

 

That's strange how come it doesn't work for an amd64 install? I wish I could get this working, firefox is probably the most important app for text to look nice in!

Also another thing, in KDE some tabs which appear on the left edge of applications have vertical text which doesn't filter very well with the patches and looks blurry and wrong.

----------

## bi3l

 *bosele wrote:*   

> and it's not looking great, so  could you please give an overview of the exact settings needed in order to use the ebuilds in that particular tarball?

 

And without any local.conf ?

----------

## yabbadabbadont

 *bi3l wrote:*   

>  *bosele wrote:*   and it's not looking great, so  could you please give an overview of the exact settings needed in order to use the ebuilds in that particular tarball? 
> 
> And without any local.conf ?

 

I have the following in my ~/.fonts.conf (on an x86, not amd64 system)

```
/home/daffy $ cat .fonts.conf

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

  <match target="font">

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

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

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

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

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

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

          <!-- lcdnone, lcddefault, lcdlight, lcdlegacy -->

  </match>

  <match target="font">

    <test name="weight" compare="more"><const>medium</const></test>

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

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

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

  </match>

  <selectfont>

    <rejectfont>

      <pattern>

        <patelt name="scalable"><bool>false</bool></patelt>

      </pattern>

    </rejectfont>

  </selectfont>

</fontconfig>

```

----------

## ubercow

Never mind, I've moved to Firefox 64 with swfdec, which isn't half bad actually, if a bit high on cpu usage.

----------

## Turingtest

 *bi3l wrote:*   

> Here it is: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

 

Thanks very much for updating these patches. 

However, after upgrading freetype, fontconfig and cairo my system starts complaining... 

 *Quote:*   

> 
> 
> Fontconfig warning: "/etc/fonts/conf.d/53-monospace-lcd-filter.conf", line 17: invalid constant used : lcdlegacy
> 
> 

 

I get the same type of warning if I try to set any of the new lcdfilter constants in /etc/fonts/local.conf. Any idea why this might be? Is anybody else seeing these warnings in ~/.xsession_errors?

----------

## Junkyboy

Yeah, I've been seeing that for quite a while. Other disto's seem to get the error as well. I've tried renaming that field to about 5 variations and none work. I beginning to think that code wont accept any value.  :Sad: 

----------

## briancl

I just installed all of the latest patches from soor with updated patches from the tarball above.  Everything seems to be fine except my monospace fonts are very strange in Firefox.  In Konsole, Bitstream Vera Sans Mono looks prefect.  In Firefox, the same font looks terrible.  See in the screen shot the posting of a code snippet in this forum.  That is supposed to be Bitstream Vera Sana Mono, as indicated by the config window in the screen shot, but it definitely doesn't look like it.  What can I do to make my Firefox monospace font look like it does in Konsole (and everywhere else)? Any ideas?  Thanks.

Screenshot: http://kokshark.techbandits.com/~silent/desktop.png

Package Versions and USE flags

```
briancl@twilo ~/Desktop $ emerge -pv cairo libXft fontconfig freetype mozilla-firefox

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

Calculating dependencies... done!

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

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

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

[ebuild   R   ] x11-libs/cairo-1.6.4  USE="X directfb glitz newspr opengl svg -debug -doc -test -xcb" 0 kB [1]

[ebuild   R   ] www-client/mozilla-firefox-3.0  USE="dbus java xulrunner -bindist -gnome -ipv6 -mozdevelop -restrict-javascript -startup-notification" LINGUAS="en -af -ar -be -ca -cs -da -de -el -en_GB -en_US -es -es_AR -es_ES -eu -fi -fr -fy -fy_NL -ga -ga_IE -gu -gu_IN -he -hu -id -it -ja -ka -ko -ku -lt -mk -mn -nb -nb_NO -nl -nn -nn_NO -pa -pa_IN -pl -pt -pt_BR -pt_PT -ro -ru -si -sk -sl -sq -sr -sv -sv_SE -tr -uk -zh -zh_CN -zh_TW" 0 kB

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

Portage tree and overlays:

 [0] /usr/portage

 [1] /usr/portage/local/soor
```

Xft settings

```
briancl@twilo ~ $ xrdb -query | grep Xft

Xft.antialias:  1

Xft.dpi:        120

Xft.hinting:    1

Xft.hintstyle:  hintfull

Xft.lcdfilter:  lcddefault

Xft.rgba:       rgb
```

/etc/fonts/local.conf

```
briancl@twilo ~ $ cat /etc/fonts/local.conf

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

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

    <const>lcddefault</const>

  </edit>

</fontconfig>
```

fontconfig config

```
briancl@twilo ~ $ 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]  53-monospace-lcd-filter.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 *
```

User settings

```
briancl@twilo ~ $ cat ~/.Xresources

Xft.lcdfilter:  lcddefault

briancl@twilo ~ $ cat ~/.fonts.conf

cat: /home/briancl/.fonts.conf: No such file or directory
```

----------

## Turingtest

 *Turingtest wrote:*   

> ....... 
> 
> However, after upgrading freetype, fontconfig and cairo my system starts complaining... 
> 
>  *Quote:*   
> ...

 

Sorry to reply to my own post, but I've figured out that it's just the 32-bit apps on my amd64 multilib system complaining. The 64 bit apps are fine, so I assume it's just that whatever 32 bit library the multilib uses doesn't understand these constants, and so is not a problem with these ebuilds at all. Please ignore the above post. 

Also, @briancl, the stylesheet for the gentoo forums specifies courier as the monospace font for code blocks. If you want only bitstream vera to be used untick the "allow pages to use their own fonts" box in the preferences dialog.

----------

## briancl

 *Turingtest wrote:*   

> 
> 
> Also, @briancl, the stylesheet for the gentoo forums specifies courier as the monospace font for code blocks. If you want only bitstream vera to be used untick the "allow pages to use their own fonts" box in the preferences dialog.

 

I'd prefer to let websites use their own font, so how do I make the courier font that is used look good?  If you look closely at the screenshot, the 3rd and 4th line down in the first code block start with "-W" or "-We" and those particular characters are very poorly rendered compared to the rest of the characters.  How do I make this more consistent?

----------

## yabbadabbadont

 *briancl wrote:*   

>  *Turingtest wrote:*   
> 
> Also, @briancl, the stylesheet for the gentoo forums specifies courier as the monospace font for code blocks. If you want only bitstream vera to be used untick the "allow pages to use their own fonts" box in the preferences dialog. 
> 
> I'd prefer to let websites use their own font, so how do I make the courier font that is used look good?  If you look closely at the screenshot, the 3rd and 4th line down in the first code block start with "-W" or "-We" and those particular characters are very poorly rendered compared to the rest of the characters.  How do I make this more consistent?

 

If you don't already, try disabling bit-mapped fonts.

----------

## ubercow

 *yabbadabbadont wrote:*   

>  *briancl wrote:*    *Turingtest wrote:*   
> 
> Also, @briancl, the stylesheet for the gentoo forums specifies courier as the monospace font for code blocks. If you want only bitstream vera to be used untick the "allow pages to use their own fonts" box in the preferences dialog. 
> 
> I'd prefer to let websites use their own font, so how do I make the courier font that is used look good?  If you look closely at the screenshot, the 3rd and 4th line down in the first code block start with "-W" or "-We" and those particular characters are very poorly rendered compared to the rest of the characters.  How do I make this more consistent? 
> ...

 

He has disabled bitmap fonts, and that is why the browser is trying to render Bitstream Vera Mono instead of Courier, because Courier is a bitmap font. So that is supposed to be Bitstream Vera Mono in that screenshot, and it therefore should look the same as in the terminal, which it does not. I don't know why it doesn't though, have you tried disabling bitmap fonts without the lcd filter? (set lcdlegacy to see) Does it look equally bad?

----------

## briancl

 *ubercow wrote:*   

> 
> 
> He has disabled bitmap fonts, and that is why the browser is trying to render Bitstream Vera Mono instead of Courier, because Courier is a bitmap font. So that is supposed to be Bitstream Vera Mono in that screenshot, and it therefore should look the same as in the terminal, which it does not. I don't know why it doesn't though, have you tried disabling bitmap fonts without the lcd filter? (set lcdlegacy to see) Does it look equally bad?

 

This is correct.  If you look at my "eselect fontconfig list" output, I have enabled the "70-no-bitmaps.conf".  If there is some other way that I should be disabling bitmap fonts, let me know.  Also, I can try to disable bitmap fonts without the lcd filter, but I don't know how to do that.  What do I need to do?  Thanks.

----------

## Turingtest

 *briancl wrote:*   

> 
> 
> This is correct.  If you look at my "eselect fontconfig list" output, I have enabled the "70-no-bitmaps.conf".  If there is some other way that I should be disabling bitmap fonts, let me know.  Also, I can try to disable bitmap fonts without the lcd filter, but I don't know how to do that.  What do I need to do?  Thanks.

 

If you run "fc-match Courier" the system should tell you what font it's rendering in place of the bitmap Courier font, compare the rendering in your browser to the rendering in some other program maybe, see exactly what the issue is. You can change the font that's being rendered in place of courier by messing around with the files in /etc/fonts/conf.avail also if you want.

----------

## briancl

 *Turingtest wrote:*   

>  *briancl wrote:*   
> 
> This is correct.  If you look at my "eselect fontconfig list" output, I have enabled the "70-no-bitmaps.conf".  If there is some other way that I should be disabling bitmap fonts, let me know.  Also, I can try to disable bitmap fonts without the lcd filter, but I don't know how to do that.  What do I need to do?  Thanks. 
> 
> If you run "fc-match Courier" the system should tell you what font it's rendering in place of the bitmap Courier font, compare the rendering in your browser to the rendering in some other program maybe, see exactly what the issue is. You can change the font that's being rendered in place of courier by messing around with the files in /etc/fonts/conf.avail also if you want.

 

fc-match Courier says I'm getting "Nimbus Mono L" in its place.  How do I change that?  I looked at /etc/fonts/conf.avail, and I see 30-metric-aliases.conf where Nimbus is bound to Courier.  I suppose I should overwrite with a /etc/fonts/local.conf binding of my own?  I tried a few different things, but nothing seems to work.. I still get Nimbus after each reboot.

Thanks.

----------

## yabbadabbadont

 *briancl wrote:*   

> fc-match Courier says I'm getting "Nimbus Mono L" in its place.  How do I change that?  I looked at /etc/fonts/conf.avail, and I see 30-metric-aliases.conf where Nimbus is bound to Courier.  I suppose I should overwrite with a /etc/fonts/local.conf binding of my own?  I tried a few different things, but nothing seems to work.. I still get Nimbus after each reboot.
> 
> Thanks.

 

I just changed it by adding the following to my ~/.fonts.conf file.  I used the DejaVu fonts to replace Helvetica, Times, and Courier.  You may want to use something else, and possibly only for Courier.

```
  <alias binding="same">

    <family>Helvetica</family>

    <accept>

      <family>DejaVu Sans</family>

    </accept>

  </alias>

  <alias binding="same">

    <family>Times</family>

    <accept>

      <family>DejaVu Serif</family>

    </accept>

  </alias>

  <alias binding="same">

    <family>Courier</family>

    <accept>

      <family>DejaVu Sans Mono</family>

    </accept>

  </alias>

```

Edit: Woo Hoo!  4000th post.   :Very Happy:   By the way, here is what firefox looks like with these settings on my system: http://omploader.org/vazJp

Edit2: Pay no attention to the purple.  It was a failed experiment at theme modification on my part.   :Embarassed: 

----------

## mwhitlock

 *bi3l wrote:*   

> Here it is: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

 

Very nice!  I'd been using the ebuilds from gentoo-china, but the Cairo from there was very ugly: lots of color fringing.  These ebuilds and patches from bi3l are perfect.  I am now using all stock Portage ~amd64 except for the four ebuilds from bi3l here.

What's the hold-up getting this stuff put in the official Portage tree?  Seems totally stable.  And if they claim it's a legal issue, well so is the BCI hinter in freetype, but they don't seem to have a problem with that!

Now if only someone would implement fractional metrics in freetype.  It's great that we can render glyphs with subpixel precision, but we should not be constrained to positioning them at whole-pixel boundaries!

Also, why the apparent lack of kerning in libXft?  If you look at "AVAVA" in Corbel 12 pt. in a libXft-rendered program, it's much more spaced out than if you look at it in a Cairo-rendered program.  I've also noticed that libXft doesn't do ligatures: compare "fi" in a libXft program versus in a Cairo program.

----------

## acevery

 *bi3l wrote:*   

> Here it is: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

 

Very helpful, thanks!

----------

## bi3l

I've updated the tarball with freetype-2.3.6-r1.

----------

## briancl

 *bi3l wrote:*   

> I've updated the tarball with freetype-2.3.6-r1.

 

Thanks.. Changelog: http://packages.larrythecow.org/?v=ebuild&s=media-libs%2Ffreetype-2.3.6-r1

Looks like a security fix and font scaling bugfix.

----------

## yabbadabbadont

 *briancl wrote:*   

> Looks like a security fix and font scaling bugfix.

 

The security fix was in 2.3.6, which is already marked stable.  2.3.6-r1 is just the the font scaling bugfix.  Just FYI.

----------

## pmp11y

 *bi3l wrote:*   

> I've updated the tarball with freetype-2.3.6-r1.

 

There is old tarball!

----------

## bi3l

Updated

----------

## yabbadabbadont

 *bi3l wrote:*   

> Updated

 

What did you change compared to the previous one?

----------

## bi3l

I've updated fontconfig to 2.6.0-r2:

 *ChangeLog wrote:*   

> Purposefully dropped the xml USE flag and libxml2 support. Having this is silly since expat is the preferred way to go per upstream and libxml2 support simply exists as a fallback when expat isn't around. expat support is the main way to go and every other distro uses it. By using the xml USE flag to enable libxml2 support, this confuses users and results in most people getting the non-standard behavior of libxml2 usage since most profiles have USE=xml

 

----------

## AaronPPC

Thanks for your work bi3l!  My text looks great again.

----------

## pmp11y

 *bi3l wrote:*   

> I've updated fontconfig to 2.6.0-r2:

 

There is not updated tarball. All files dated 14 Jun

----------

## bi3l

 *pmp11y wrote:*   

> There is not updated tarball. All files dated 14 Jun

 

Are you sure, you downloaded the tarball again ?

----------

## mwhitlock

 *pmp11y wrote:*   

> There is not updated tarball. All files dated 14 Jun

 

Maybe a transparent proxy caching the file? I downloaded it yesterday afternoon, and it does indeed have fontconfig-2.6.0-r2.ebuild, dated 2008-06-27.

----------

## swimmer

 *yabbadabbadont wrote:*   

> I have the following in my ~/.fonts.conf (on an x86, not amd64 system)
> 
> ```
> /home/daffy $ cat .fonts.conf
> 
> ...

 

Thank you very much yabbadabbadont!!! Your settings together with the tarball from bi3l (man thanks for that one as well!!!) my fonts look just stunning   :Razz:  I'm simply amazed how good it all looks now  :Smile: 

JFYI

swimmer

----------

## peteblack

Just downloaded and installed. Looks awesome! Thanks you, great job everyone involved.

----------

## pmp11y

 *bi3l wrote:*   

>  *pmp11y wrote:*   There is not updated tarball. All files dated 14 Jun 
> 
> Are you sure, you downloaded the tarball again ?

 

Sorry, it was proxy  :Sad: 

It's ok now.

Thank you for this great job!

----------

## mwhitlock

Need a 2.3.7.  Thanks for the great work, bi3l!

----------

## bi3l

 *mwhitlock wrote:*   

> Need a 2.3.7.  Thanks for the great work, bi3l!

 Done

----------

## xerxesmc

thx for the config it looks stunning >>

----------

## grahamm

Do you know when this page will be on-line again?

----------

## neuron

 *grahamm wrote:*   

> Do you know when this page will be on-line again?

 

use http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2 it works perfectly  :Smile: 

And thanks a lot bi3l!  Looks very nice  :Smile: 

----------

## GoofyX

bi3l, thanks for your great work! Since you host the scripts in sourceforge, isn't there a way to set up a Subversion reporitory there, so we can update easily? I think sf.net gives you svn ability...

Thanks!!

----------

## mwhitlock

 *GoofyX wrote:*   

> bi3l, thanks for your great work! Since you host the scripts in sourceforge, isn't there a way to set up a Subversion reporitory there, so we can update easily? I think sf.net gives you svn ability...

 

If you go with Subversion, you might as well make your overlay accessible with layman.   :Razz: 

----------

## GoofyX

 *mwhitlock wrote:*   

> If you go with Subversion, you might as well make your overlay accessible with layman.  

 

Well, yes, that's the next step, but I thought each step at the time.  :Smile: 

----------

## bi3l

Sorry, but no, I won't setup an overlay in the subversion repository of this sourceforge project: it's already used for OGMRip.

----------

## GoofyX

OK, no problem. It's nice to have you backing up these patches!  :Smile: 

----------

## mwhitlock

Copying bi3l's libXft-2.1.12.ebuild to libXft-2.1.13.ebuild appears to compile libXft 2.1.13 with the newspr patch just fine.

----------

## Emopig

You no longer need to patch Freetype or Fontconfig, only libXft and Cairo.

The LCD configuration options were merged into fontconfig by Keith Packard sometime in the 2.5.9x timeframe (2.5.93 I think).

It is vaguely worth mentioning the Ubuntu patches are somewhat out of date. The latest rework of the LCD filtering patch for Cairo was done by Sylvain Pasche when he posted a patch back in January. Afaik, the Ubuntu patch for Cairo predates this.

The cairo patch for libXft is fine as far as I know but won't compile against latest (now upstream) version (2.1.13) of Fontconfig unless you make a 2 line change replacing instances of FC_LCD_FILTER_* constants with FC_LCD_*.

I have my own versions of these patches, they can be found here. The broken-out folder contains the Cairo patch patch from Sylvain and a 'reject-fix' patch for Cairo 1.6.4, these are just there so others can check the patch if they wish. 

My patches are named such that they work with bashrcng's patching module (It is what I use), so you can use the ebuilds already in portage.

----------

## bi3l

The patches against fontconfig and freetype does not add lcd filtering (as you said, it's already there). They mainly fix things in the code, modify some conf.avail files, add new ones, and change the default ones in conf.d.

Your patches against libXft and cairo and those provided in the tarball are very similar.

----------

## KejPi

 *neuron wrote:*   

>  *grahamm wrote:*   Do you know when this page will be on-line again? 
> 
> use http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2 it works perfectly 
> 
> And thanks a lot bi3l!  Looks very nice 

 

Hi, did anyone try to build it using paludis? I am geting some strange warning messages concerning USE flags and used EAPI  :Sad: 

----------

## PaulBredbury

 *Emopig wrote:*   

> the Ubuntu patches are somewhat out of date.

 

Well, Hardy is "stable", and Intrepid is bleeding-edge/up-to-date/insert-name-here  :Smile: 

----------

## semdornus

 *KejPi wrote:*   

> Hi, did anyone try to build it using paludis? I am geting some strange warning messages concerning USE flags and used EAPI 

 

You have to add EAPI="1" at the top of the two ebuilds that are missing them. The other two have that line, but the ones with the error are missing it.

----------

## Enlight

Hi there, may anobody post screenshot before and after using this please?

----------

## Aphax

 *Enlight wrote:*   

> Hi there, may anobody post screenshot before and after using this please?

 

Here's the difference between no subpixel filtering and subpixel filtering turned on with these patches. It's somewhat subtle but I still think it's an improvement. I'm not sure why but with Ubuntu the text looks slightly 'bolder'.

Turned off: http://www.aphax.nl/images/lcd-off.png

Turned on: http://www.aphax.nl/images/lcd-on.png

The difference between subpixel filtering and normal rendering without these patches is even smaller and doesn't seem to improve anything.

----------

## m.s.w

It is strange that not many people talk about this patches and lcdfiltering in g eneral. Fonts are so much better with it. In my case I can't stand fonts without it. And here I have problem. I upgraded to libXft-2.1.13 and I do not know how to compile it with all this patches etc. Can you please tell me how to use this patches in ebuilds?

----------

## mwhitlock

 *m.s.w wrote:*   

> It is strange that not many people talk about this patches and lcdfiltering in g eneral. Fonts are so much better with it. In my case I can't stand fonts without it. And here I have problem. I upgraded to libXft-2.1.13 and I do not know how to compile it with all this patches etc. Can you please tell me how to use this patches in ebuilds?

 

Most people are using pre-rolled distributions (like Ubuntu) that already have LCD filtering patches applied.  That's why nobody talks about this stuff; for the majority of people the fonts already look good.

bi3l's overlay already contains a patched ebuild for libXft-2.1.13.  Just extract the tarball into your local overlay, enable the "newspr" USE flag for libXft, and re-emerge libXft.mkdir -p /usr/portage/local/bi3l

cd /usr/portage/local/bi3l

tar -xjf ~/gentoo-lcd-filtering.tar.bz2

echo 'PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/portage/local/bi3l"' >> /etc/make.conf

echo 'x11-libs/libXft newspr' >> /etc/portage/package.use

emerge --oneshot x11-libs/libXft

Edit: Of course, you also need to re-emerge media-libs/freetype and media-libs/fontconfig with the "ubuntu" USE flag enabled. You also probably will want to re-emerge x11-libs/cairo with the "newspr" USE flag enabled.

----------

## PaulBredbury

 *Aphax wrote:*   

> doesn't seem to improve anything

 

You mean the difference between lcddefault and lcdlegacy? Well, the colours are arranged differently. Choose whichever looks better.

Open up the screenshot in e.g. eog and zoom in - notice the colours around the fonts. Right there is the proof. They effectively improve the resolution of fonts on LCD displays, by exploiting the fact that LCD pixels are split into 3 blocks - red, green and blue ("RGB"), in a consistent layout all over the screen. Yes it's subtle, and people with bad eyesight, bad monitors or badly configured software (e.g. wrong DPI settings or RGB in different order) might not be able to see what's right in front of their eyes. Then there's the choice of fonts, the style of LCD rendering ( lcddefault, lcdlight, lcdlegacy) and the huge flexibility possible in /etc/fonts/ and ~/.fonts.conf - here's mine.

 *mwhitlock wrote:*   

> pre-rolled distributions (like Ubuntu) that already have LCD filtering patches applied.

 

Major distros like Fedora and OpenSuSE are still scared of the potential of getting sued. But that's easily fixed [/shameless plug]  :Smile: 

----------

## Aphax

 *PaulBredbury wrote:*   

>  *Aphax wrote:*   doesn't seem to improve anything 
> 
> You mean the difference between lcddefault and lcdlegacy? Well, the colours are arranged differently. Choose whichever looks better.

 

What do you mean by lcddefault and lcdlegacy? In any case I find that my fonts look much better with the patches so that's what I'm using

----------

## PaulBredbury

Read this page and the ones following it, for "lcdlegacy".

----------

## m.s.w

 *mwhitlock wrote:*   

> 
> 
> bi3l's overlay already contains a patched ebuild for libXft-2.1.13. 

 

I don't see it. Here http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2 we have only 2.1.12 version.

----------

## mwhitlock

 *m.s.w wrote:*   

> I don't see it. Here http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2 we have only 2.1.12 version.

 

My apologies, I had copied 2.1.12 to make 2.1.13.  No changes required.

See my post about this earlier in this thread:

https://forums.gentoo.org/viewtopic-p-5142194.html#5142194

----------

## m.s.w

Yes, I already found this about copying.  :Smile: 

It works now (it needed digest though).

I have my fonts back, and I am happy about it. Thank you.

----------

## mwhitlock

To make a newspr-enabled ebuild for the newly released x11-libs/cairo-1.6.4-r1:

```
emerge --sync

cd /usr/portage/local/bi3l/x11-libs/cairo

cp cairo-1.6.4{,-r1}.ebuild

wget -O- 'http://home.mattwhitlock.com/~mattw/cairo-1.6.4-r1.ebuild.patch' | patch

cp /usr/portage/x11-libs/cairo/files/cairo-1.6.4-libpng-api-change.patch files/

ebuild cairo-1.6.4-r1.ebuild digest

```

----------

## Phlogiston

 *mwhitlock wrote:*   

> To make a newspr-enabled ebuild for the newly released x11-libs/cairo-1.6.4-r1:
> 
> ```
> emerge --sync
> 
> ...

 

Could you please post the resulting ebuild? Does this cairo ebuild have an newspr use flag? I'm confused. /edit: fixed, is there a maintained overlay which contains the ebuilds?

We should start updating the wiki or crate a new entry for this, what do you think?

My problem atm is btw that since some updates the fonts in firefox don't look perfect any longer.

----------

## mwhitlock

 *Phlogiston wrote:*   

> Could you please post the resulting ebuild? Does this cairo ebuild have an newspr use flag? I'm confused. /edit: fixed, is there a maintained overlay which contains the ebuilds?

 

I made my patch against bi3l's ebuild, which you can find in his overlay tarball here: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

bi3l's ebuild of cairo does have the newspr flag.

----------

## bi3l

I've just updated the tarball with ebuilds for cairo-1.6.4-r1 and libXft-2.1.13.

----------

## neuron

 *bi3l wrote:*   

> I've just updated the tarball with ebuilds for cairo-1.6.4-r1 and libXft-2.1.13.

 

much appreciated  :Smile: 

----------

## Mr. Tao

I’m glad I found this topic as I’ve used soor overlay which is not updated for a while. I’m going to test these patches right now. Meanwhile I’ve made repo definition for paludis: */etc/paludis/lcd-filtering.conf wrote:*   

> location = ${ROOT}/usr/portage/local/lcd-filtering
> 
> sync = tar+http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2
> 
> sync_options = "--rsync-option=--exclude=profiles"
> ...

 Last edited by Mr. Tao on Sun Aug 24, 2008 9:47 pm; edited 2 times in total

----------

## bi3l

 *Mr. Tao wrote:*   

> I’m glad I found this topic as I’ve used soor overlay which is not updated for a while. I’m going to test these patches right now. Meanwhile I’ve made repo definition for paludis

 

Very good idea, thanks !!!! And I've just discovered that it's possible to do the same with layman !!!!

Here is the definition:

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

<layman>

  <overlays>

    <overlay type="tar" src="http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2" contact="billl@users.sourceforge.net" name="lcd-filtering">

      <link>http://forums.gentoo.org/viewforum-f-12.html</link>

      <description>LCD filtering</description>

    </overlay>

  </overlays>

</layman>
```

Put it in /etc/layman/lcd-filtering.xml and add the definition in /etc/layman/layman.cfg:

```
overlays  : http://www.gentoo.org/proj/en/overlays/layman-global.txt

            file:///etc/layman/lcd-filtering.xml
```

Finally, run:

```
layman -a lcd-filtering.
```

----------

## yabbadabbadont

Thanks for the work.  It is nice to see someone has stepped up and taken over supporting these patches.

If you are going to the trouble of setting it up for use with layman, you might want to make sure that your ebuilds for packages that are marked stable in portage, are also marked stable instead of keyword masked.

----------

## yabbadabbadont

Hmmm.  Just tried it out and it doesn't seem like fontconfig-2.5.0-r1 is actually getting patched properly.  The USE flags look correct and it compiled fine, but when portage ran the updates after emerge finished, it complained about "lcddefault" not being a valid fontconfig option...  Then the cairo-1.6.4 ebuild failed complaining about LCD_* options not being defined, which leads me back to thinking that fontconfig isn't right.

I want to do some more investigating before I submit a proper error report.  (one that actually has exact error messages instead of the crap I just listed.   :Wink: )

----------

## mwhitlock

 *yabbadabbadont wrote:*   

> Hmmm.  Just tried it out and it doesn't seem like fontconfig-2.5.0-r1 is actually getting patched properly.  The USE flags look correct and it compiled fine, but when portage ran the updates after emerge finished, it complained about "lcddefault" not being a valid fontconfig option...  Then the cairo-1.6.4 ebuild failed complaining about LCD_* options not being defined, which leads me back to thinking that fontconfig isn't right.
> 
> I want to do some more investigating before I submit a proper error report.  (one that actually has exact error messages instead of the crap I just listed.  )

 

This might be obvious, but did you emerge fontconfig with the "ubuntu" USE flag enabled?  The "newspr" flag only applies to libXft and cairo, while the "ubuntu" flag applies to freetype and fontconfig.

----------

## yabbadabbadont

I already stated that the USE flags looked correct...  and if you look at the ebuilds, you will see that the correct ones are on by default.    :Razz:   :Very Happy: 

----------

## mwhitlock

 *yabbadabbadont wrote:*   

> I already stated that the USE flags looked correct...  and if you look at the ebuilds, you will see that the correct ones are on by default.    

 

Well the reason I asked is that it "works for me," so something must be different about your setup.   :Rolling Eyes: 

----------

## yabbadabbadont

 *mwhitlock wrote:*   

>  *yabbadabbadont wrote:*   I already stated that the USE flags looked correct...  and if you look at the ebuilds, you will see that the correct ones are on by default.     
> 
> Well the reason I asked is that it "works for me," so something must be different about your setup.  

 

I'm guessing that you added all the packages to your /etc/portage/package.keywords, in which case you are not using the same versions as I listed in my post.

----------

## mwhitlock

 *yabbadabbadont wrote:*   

> I'm guessing that you added all the packages to your /etc/portage/package.keywords, in which case you are not using the same versions as I listed in my post.

 

I have ACCEPT_KEYWORDS="~amd64" in my /etc/make.conf because I like running bleeding edge and don't mind reporting problems on bugs.gentoo.org.

But yes, you are correct, I'm not using the version of fontconfig that you listed, so my "works for me" does not apply here.

```
[ebuild   R   ] x11-libs/cairo-1.6.4-r1  USE="X glitz newspr opengl svg -debug -directfb -doc -test -xcb" 0 kB [1]

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

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

[ebuild   R   ]    media-libs/freetype-2.3.7  USE="X ubuntu -bindist -debug -doc -utils" 0 kB [?=>1]
```

----------

## natros

I'm using:

```
=media-libs/fontconfig-2.6.0-r2

=media-libs/freetype-2.3.7

=x11-libs/cairo-1.6.4-r1

=x11-libs/libXft-2.1.12

```

and works pretty well  :Smile: 

----------

## yabbadabbadont

I just went ahead and keyworded all four of them.  Now everything is fine.

----------

## Phlogiston

 *Mr. Tao wrote:*   

> I’m glad I found this topic as I’ve used soor overlay which is not updated for a while. I’m going to test these patches right now. Meanwhile I’ve made repo definition for paludis: */etc/paludis/lcd-filtering.conf wrote:*   location = ${ROOT}/usr/portage/local/lcd-filtering
> 
> sync = tar+http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2
> 
> sync_options = "--rsync-option=--exclude=profiles"
> ...

 

Oh, thats cool, I did not know that. Is the tarball updated regularly?

----------

## bi3l

 *Phlogiston wrote:*   

> Oh, thats cool, I did not know that. Is the tarball updated regularly?

 

Almost as soon as there is a new version of either cairo, libXft, freetype or fontconfig in portage.

----------

## Phlogiston

 *bi3l wrote:*   

>  *Phlogiston wrote:*   Oh, thats cool, I did not know that. Is the tarball updated regularly? 
> 
> Almost as soon as there is a new version of either cairo, libXft, freetype or fontconfig in portage.

 

Ok I'm curios how long it will last   :Cool: 

----------

## Phlogiston

 *Mr. Tao wrote:*   

> I’m glad I found this topic as I’ve used soor overlay which is not updated for a while. I’m going to test these patches right now. Meanwhile I’ve made repo definition for paludis: */etc/paludis/lcd-filtering.conf wrote:*   location = ${ROOT}/usr/portage/local/lcd-filtering
> 
> sync = tar+http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2
> 
> sync_options = "--rsync-option=--exclude=profiles"
> ...

 

please add profiles/repo_name.

```
paludis@1219682970: [QA e.repo_name.unusable] Couldn't open repo_name file in '/usr/local/portage/lcd-filtering/profiles/', falling back to generated name 'x-lcd-filtering' (ignore this message if you have yet to sync this repository).

```

----------

## aronparsons

 :Smile: 

http://packages.gentoo.org/package/x11-libs/cairo

http://cairographics.org/news/cairo-1.7.2/

 *Quote:*   

> LCD subpixel filtering using FreeType
> 
> - -------------------------------------
> 
> FreeType 2.3.5 added support for various LCD subpixel filtering, and
> ...

 

----------

## mwhitlock

 *aronparsons wrote:*   

> Cairo now relies on FreeType and fontconfig for subpixel filtering.

 

Does this mean we soon won't need cairo in the overlay?  Now if only libXft would pick up the slack!

Does anyone know if Qt4 uses Cairo?

----------

## natros

 *mwhitlock wrote:*   

>  *aronparsons wrote:*   Cairo now relies on FreeType and fontconfig for subpixel filtering. 
> 
> Does this mean we soon won't need cairo in the overlay?  Now if only libXft would pick up the slack!
> 
> Does anyone know if Qt4 uses Cairo?

 

Qt does not use Cairo.

----------

## aronparsons

 *mwhitlock wrote:*   

> Does this mean we soon won't need cairo in the overlay?  Now if only libXft would pick up the slack!

 

That's right.  libXft is the only package that still needs the LCD filter patches applied upstream.  Everything else is in Portage and working great!

----------

## kokoko3k

What about kde4 and/or qt4?

As far as i know, qt4 doesn't use cairo nor Xft.

----------

## Lori

One tiny little request... Can you please add EAPI="1" to the freetype and fontconfig ebuilds? I use paludis and I get these nasty warnings: "+/- prefixed IUSE flag names not allowed in this EAPI". I know I could do it manually, but I already configured your tarball as a paludis repository and would be so much nicer if it came with that fix...  :Razz: 

----------

## mwhitlock

 *kokoko3k wrote:*   

> What about kde4 and/or qt4?
> 
> As far as i know, qt4 doesn't use cairo nor Xft.

 

I have the Last.fm player installed, and it uses Qt4, and its fonts look identical to those of the rest of my system, so I would guess that Qt4 refrains from messing with the glyphs it receives from FreeType, which means they remain properly filtered for LCD.

----------

## aliquid

From cairo 1.8.0 release announcement:

 *Quote:*   

> Note also that the code that had been in cairo 1.7.x calling into
> 
> freetype's optional lcd_filter function was removed from cairo before
> 
> the 1.8.0 release. We do expect this code to come back in some form in
> ...

 

Sad, but no lcd font rendering for now.

Edit:

Here's a reason:

 *Quote:*   

> Remove all lcd_filter code.
> 
> We reverted the public API for setting lcd_filter font options back in 1b42bc8033bc , but we had left the implementation which would examine fontconfig and Xft properties for the option, and which would call into freetype for subpixel glyph rasterization. However, I recently realized, (and the test suite had been trying to tell me for a while), that this approach would cause a regression for users who were previously using sub-pixel text, but without sub-pixel rendering built directly into freetype. That's not acceptable, so all the code is coming out for now. 

 

----------

## ocin

font ebuilds are in "devnull" now too.Last edited by ocin on Mon Oct 06, 2008 7:44 pm; edited 2 times in total

----------

## kokoko3k

 *mwhitlock wrote:*   

>  *kokoko3k wrote:*   What about kde4 and/or qt4?
> 
> As far as i know, qt4 doesn't use cairo nor Xft. 
> 
> I have the Last.fm player installed, and it uses Qt4, and its fonts look identical to those of the rest of my system, so I would guess that Qt4 refrains from messing with the glyphs it receives from FreeType, which means they remain properly filtered for LCD.

 

That's not true for me, as you can check here:

http://www.hdimage.org/images/mycnapq2qgewjs07d36y_zool1.png

qtconfig from qt-3.3.8-r4 on the left (which uses xft), qtconfig from qt-4.3.4-r1- on the right, both uses Lucida Sans Unicode, but they look different.

My .fonts.conf, nothing special:

```

<?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>hintmedium</const>

  </edit>

 </match>

 <match target="font" >

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

   <const>rgb</const>

  </edit>

 </match>

 <match target="font" >

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

   <bool>true</bool>

  </edit>

 </match>

 <match target="font" >

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

   <const>hintslight</const>

  </edit>

 </match>

 <match target="font" >

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

   <const>medium</const>

  </test>

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

   <const>hintfull</const>

  </edit>

 </match>

 <match target="font" >

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

   <bool>true</bool>

  </edit>

 </match>

</fontconfig>

```

By the way, i used: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

----------

## mwhitlock

 *kokoko3k wrote:*   

>  *mwhitlock wrote:*   I have the Last.fm player installed, and it uses Qt4, and its fonts look identical to those of the rest of my system, so I would guess that Qt4 refrains from messing with the glyphs it receives from FreeType, which means they remain properly filtered for LCD. 
> 
> That's not true for me, as you can check here:
> 
> http://www.hdimage.org/images/mycnapq2qgewjs07d36y_zool1.png
> ...

 

My comparison shot: http://img407.imageshack.us/my.php?image=qtcomparisonal0.png

You are right that they aren't identical.  However, I think the Qt4 rendering looks better in my case.  I think Qt4 looks worse in your case.  Of course, this is all subjective.

----------

## natros

just to make clear about qt4 font rendering

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

----------

## kokoko3k

Glad to read your link.

I think sroedal is talking about a bug i submitted some months ago to trolltech, i totally missed it, thanks.

----------

## PaulBredbury

Regarding the cairo bug with qt4, try this patch from my Fedora 9 font packages:

```
-    if (options->base.hint_style == CAIRO_HINT_STYLE_DEFAULT)

+    options->base.hint_style = CAIRO_HINT_STYLE_DEFAULT;

+

+    if (other->base.hint_style != CAIRO_HINT_STYLE_DEFAULT)
```

Taken from bug 11838 and bug 13335.

Edit: Qt4 is broken and doesn't use Cairo anyway. But this patch is useful to make Gnome respect ~/.fonts.conf  :Smile: Last edited by PaulBredbury on Fri Oct 10, 2008 4:14 pm; edited 2 times in total

----------

## octoploid

 *aliquid wrote:*   

> From cairo 1.8.0 release announcement:
> 
>  *Quote:*   Note also that the code that had been in cairo 1.7.x calling into
> 
> freetype's optional lcd_filter function was removed from cairo before
> ...

 

Well, I just reverted the revert and cairo 1.8.0 is working fine here.

(this is what I did:

```

git clone git://anongit.freedesktop.org/git/cairo

cd cairo

git revert 5d887ad5dca5af0f8216830d1b04d08a5aba9bee

git format-patch -k -m --stdout origin > cairo.patch

```

And than added "epatch cairo.patch" to the cairo-1.8.0.ebuild...)

----------

## mwhitlock

 *octoploid wrote:*   

> Well, I just reverted the revert and cairo 1.8.0 is working fine here.

 

Thanks for the instructions, octoploid.

If anyone else wants the patch without needing to emerge git, here it is: http://www.mattwhitlock.com/cairo-1.8.0-lcdfilter.patch

Also, you don't have to hack the cairo-1.8.0 ebuild.  You can just manually do the patch after the unpack phase but before compilation:

```
ebuild /usr/portage/x11-libs/cairo/cairo-1.8.0.ebuild unpack

( cd /var/tmp/portage/x11-libs/cairo-1.8.0/work/cairo-1.8.0/ && patch -p1 < ~/cairo-1.8.0-lcdfilter.patch )

ebuild /usr/portage/x11-libs/cairo/cairo-1.8.0.ebuild merge
```

EDIT: Cairo 1.8.0 with this patch looks terrible. Do I need to do something with my ~/.fonts.conf?

EDIT #2: Apparently, "lcddefault" is not the default for the "lcdfilter" option.  How counter-intuitive!  It appears that "lcdlegacy" is the value used for the "lcdfilter" option if the option is absent.  I added the following to my ~/.fonts.conf:

```
<match target="font">

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

  <const>lcddefault</const>

 </edit>

</match>
```

and now my cairo-1.8.0 looks identical to cairo-1.6.4-r1 with bi3l's patch.

----------

## PaulBredbury

 *mwhitlock wrote:*   

> Apparently, "lcddefault" is not the default for the "lcdfilter" option.  How counter-intuitive!

 

Yep. Happily, Ubuntu does the sensible thing:

 *Quote:*   

>   * add debian/patches/06_ubuntu_lcddefault.patch: set lcddefault as default for the lcd-filter now that Cairo prefers lcdlegacy. This is needed to restore our previous behavior.

 

Although I prefer adding a single line to /etc/X11/Xresources:

```
Xft.lcdfilter: lcddefault
```

----------

## manwe_

Yesterday I was working on OS X and have to say, fonts are looking great on Mac. Is there any way to config Gentoo to display fonts similiar? This is my system now [Segoe UI, 10pt]:

http://img125.imageshack.us/img125/218/segoegentoorf7.png

And this is small comparison between XP and OS X I've found:

http://images.damieng.com/blog/WindowsAt11.png

http://images.damieng.com/blog/MacAt13.png

I just luv this boldness.

----------

## bi3l

I've updated fontconfig-2.6.0 according to fontconfig_2.6.0-1ubuntu4.diff which includes the lcddefault patch, and cairo-1.8.0 so that it applies the lcdfilter patch from mwhitlock. I've also added EAPI="1" to the freetype and fontconfig ebuilds.

The tarball is here: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

----------

## solshark

 *bi3l wrote:*   

> I've updated fontconfig-2.6.0 according to fontconfig_2.6.0-1ubuntu4.diff which includes the lcddefault patch, and cairo-1.8.0 so that it applies the lcdfilter patch from mwhitlock. I've also added EAPI="1" to the freetype and fontconfig ebuilds.
> 
> The tarball is here: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

 

Thx for your great job!

----------

## mwhitlock

 *manwe_ wrote:*   

> Yesterday I was working on OS X and have to say, fonts are looking great on Mac. Is there any way to config Gentoo to display fonts similiar?

 

libXft at 12pt (101 dpi): http://img521.imageshack.us/my.php?image=libxftat12ptjm2.png

I personally think it looks better than both Windows and Mac.

My FreeType config is:

hinting=false

hintstyle=hintnone

antialias=true

rgba=rgb

lcdfilter=lcddefault

----------

## manwe_

 *mwhitlock wrote:*   

> libXft at 12pt (101 dpi): http://img521.imageshack.us/my.php?image=libxftat12ptjm2.png
> 
> I personally think it looks better than both Windows and Mac.
> 
> 

 

 :Shocked:  I've similiar config, and can't get look like this. The only difference is screen DPI [93x92]. Could DPI be a problem?

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

<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

 <match target="font" >

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

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

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

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

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

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

 </match>

</fontconfig>

# ls -1 /etc/fonts/conf.d/

10-antialias.conf@

10-sub-pixel-rgb.conf@

20-fix-globaladvance.conf@

30-metric-aliases.conf@

30-urw-aliases.conf@

40-nonlatin.conf@

45-latin.conf@

49-sansserif.conf@

50-user.conf@

51-local.conf@

53-monospace-lcd-filter.conf@

57-dejavu.conf@

60-latin.conf@

60-liberation.conf@

65-fonts-persian.conf@

65-nonlatin.conf@

69-unifont.conf@

80-delicious.conf@

90-synthetic.conf@

```

Another thing is, cairo-1.8.0 from "lcd-filtering" looks worse [thinner] than 1.6.4-r1. Example: http://img353.imageshack.us/img353/6162/screenshot2008100518193yy5.png It might look like small differece, but with whole screen of code cairo-1.8.0 looks just awful.

----------

## bi3l

Can you reinstall fontconfig and see if your display is better ?

----------

## manwe_

 *bi3l wrote:*   

> reinstall fontconfig and see if your display is better ?

 

It's not. I've upgraded to cairo-1.8.0, reemerged fontconfig-2.6.0-r2 and fonts are still thinner. I've tried even to reemerge freetype-2.3.7 and libXft-2.1.13 but it didn't help either.

----------

## bi3l

After emerging fontconfig, did you change your /etc/fonts/conf.d ? Because you should at least have 11-lcd-filter-lcddefault.conf (it changes the lcd filter to default instead of legacy). Here is my /etc/fonts/conf.d:

```
10-antialias.conf

10-autohint.conf

10-hinting.conf

10-hinting-medium.conf

10-no-sub-pixel.conf

10-sub-pixel-rgb.conf

11-lcd-filter-lcddefault.conf

20-fix-globaladvance.conf

20-unhint-small-vera.conf

25-unhint-nonlatin.conf

30-metric-aliases.conf

30-urw-aliases.conf

40-nonlatin.conf

45-latin.conf

49-sansserif.conf

50-user.conf

51-local.conf

53-monospace-lcd-filter.conf

59-dejavu.conf

60-latin.conf

65-fonts-persian.conf

65-nonlatin.conf

69-unifont.conf

80-delicious.conf

90-synthetic.conf
```

----------

## manwe_

I did't but looks like emerge did. Because right now I have:

```
10-antialias.conf

10-hinting.conf

10-hinting-medium.conf

10-sub-pixel-rgb.conf

11-lcd-filter-lcddefault.conf

20-fix-globaladvance.conf

20-unhint-small-vera.conf

30-metric-aliases.conf

30-urw-aliases.conf

40-nonlatin.conf

45-latin.conf

49-sansserif.conf

50-user.conf

51-local.conf

53-monospace-lcd-filter.conf

57-dejavu.conf

60-latin.conf

60-liberation.conf

65-fonts-persian.conf

65-nonlatin.conf

69-unifont.conf

80-delicious.conf

90-synthetic.conf

```

----------

## nihues

do you had enabled it?

```
eselect fontconfig enable 5
```

if 5 is the number before 11-lcd-filter-lcddefault.conf 

then restart X

----------

## acevery

 *bi3l wrote:*   

> I've updated fontconfig-2.6.0 according to fontconfig_2.6.0-1ubuntu4.diff which includes the lcddefault patch, and cairo-1.8.0 so that it applies the lcdfilter patch from mwhitlock. I've also added EAPI="1" to the freetype and fontconfig ebuilds.
> 
> The tarball is here: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

 

Great works!

Thanks  :Very Happy: 

----------

## swimmer

Time indeed to thank you bi3l - your efforts are very much appreciated!!!

Greetz

swimmer

----------

## manwe_

 *nihues wrote:*   

> do you had enabled it?
> 
> ```
> eselect fontconfig enable 5
> ```
> ...

 

Like I've said, looks like reemerging fontconfig [when bi3l suggested] enabled 11-lcd-filter-lcddefault.conf by itself, because I don't remember doin' it. Before that my config looked like this https://forums.gentoo.org/viewtopic-p-5238170.html#5238170 , and now looks like this https://forums.gentoo.org/viewtopic-p-5238520.html#5238520 . X was also restarted [or to be precise, tested on new session -- :1 ].

-- update:

Config <edit mode="assign" name="lcdfilter">  <const>lcddefault</const>  </edit> accepts only lcdnone, lcddefault, lcdlight and lcdlegacy [any other value throws error], but fonts look doesn't change. Somehow Cairo sees this value, but ignores it.

----------

## GoofyX

 *bi3l wrote:*   

> After emerging fontconfig, did you change your /etc/fonts/conf.d ? Because you should at least have 11-lcd-filter-lcddefault.conf (it changes the lcd filter to default instead of legacy).

 

Where do I find that file?

----------

## bi3l

In /etc/fonts/conf.d. It should be a link to /etc/fonts/conf.avail/11-lcd-filter-lcddefault.conf.

----------

## GoofyX

 *bi3l wrote:*   

> In /etc/fonts/conf.d. It should be a link to /etc/fonts/conf.avail/11-lcd-filter-lcddefault.conf.

 

OK, but I don't seem to have that file at all:

```
/etc/fonts/conf.avail $ ls

10-antialias.conf       20-fix-globaladvance.conf                 53-monospace-lcd-filter.conf

10-autohint.conf        20-unhint-small-dejavu.conf               57-dejavu.conf

10-hinting.conf         20-unhint-small-dejavu-experimental.conf  60-latin.conf

10-hinting-full.conf    20-unhint-small-vera.conf                 61-dejavu-experimental.conf

10-hinting-medium.conf  25-unhint-nonlatin.conf                   65-fonts-persian.conf

10-hinting-slight.conf  30-metric-aliases.conf                    65-khmer.conf

10-no-sub-pixel.conf    30-urw-aliases.conf                       65-nonlatin.conf

10-sub-pixel-bgr.conf   40-nonlatin.conf                          69-unifont.conf

10-sub-pixel-rgb.conf   45-latin.conf                             70-no-bitmaps.conf

10-sub-pixel-vbgr.conf  49-sansserif.conf                         70-yes-bitmaps.conf

10-sub-pixel-vrgb.conf  50-user.conf                              80-delicious.conf

10-unhinted.conf        51-local.conf                             90-synthetic.conf
```

----------

## bi3l

You should reemerge fontconfig.

----------

## GoofyX

 *bi3l wrote:*   

> You should reemerge fontconfig.

 

OK, that's what I'm doing right now.

----------

## manwe_

Found a new thing about my problem with cairo-1.8.0. This is somehow related to GTK. I didn't notice that at first, 'cause I use xfce4 and almost none Qt apps. This is difference between text in QtConfig4 and Mousepad [GTK], font Dejavu Sans 8: http://img411.imageshack.us/img411/395/screenshot2008100914314bu3.png Qt looks fine, no difference between cairo 1.6.4 and 1.8.0. Any ideas what to do with GTK?

----------

## yabbadabbadont

 *manwe_ wrote:*   

> Found a new thing about my problem with cairo-1.8.0. This is somehow related to GTK. I didn't notice that at first, 'cause I use xfce4 and almost none Qt apps. This is difference between text in QtConfig4 and Mousepad [GTK], font Dejavu Sans 8: http://img411.imageshack.us/img411/395/screenshot2008100914314bu3.png Qt looks fine, no difference between cairo 1.6.4 and 1.8.0. Any ideas what to do with GTK?

 

I think that it was said earlier in this thread that Qt does not use cario, so your Qt apps would look the same no matter what version of cairo you have.   :Wink: 

----------

## Phlogiston

 *acevery wrote:*   

>  *bi3l wrote:*   I've updated fontconfig-2.6.0 according to fontconfig_2.6.0-1ubuntu4.diff which includes the lcddefault patch, and cairo-1.8.0 so that it applies the lcdfilter patch from mwhitlock. I've also added EAPI="1" to the freetype and fontconfig ebuilds.
> 
> The tarball is here: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2 
> 
> Great works!
> ...

 

Is this still updated?

Please fix:

```
  ... When querying use flag 'directfb' for 'x11-libs/cairo-1.8.0:0::lcdfiltering' in Paludis environment:

  ... When parsing metadata key 'IUSE' from 'x11-libs/cairo-1.8.0:0::lcdfiltering':

  ... When extracting USE flag state from IUSE flag '+newspr':

  ... +/- prefixed IUSE flag names not allowed in this EAPI

```

----------

## bi3l

Should be fixed, even though you're quite unpleasant and do not say clearly what the problem is.

----------

## Phlogiston

 *bi3l wrote:*   

> Should be fixed, even though you're quite unpleasant and do not say clearly what the problem is.

 

The message should explain it: You sound not have + or - before use flags in the ebuilds.

Sorry I don't want to insult you.

----------

## bi3l

 *Phlogiston wrote:*   

> Sorry I don't want to insult you.

 

I don't feel insulted.

 *Phlogiston wrote:*   

> Ok I'm curios how long it will last

 

 *Phlogiston wrote:*   

> Is this still updated? 

 

But this kind of comments is not very pleasant.

----------

## Lori

The fix is not to remove the + sign, but to add a line EAPI="2" at the top of the ebuild.

----------

## bi3l

 *Lori wrote:*   

> The fix is not to remove the + sign, but to add a line EAPI="2" at the top of the ebuild.

 

That's what I did.

----------

## Phlogiston

 *bi3l wrote:*   

>  *Lori wrote:*   The fix is not to remove the + sign, but to add a line EAPI="2" at the top of the ebuild. 
> 
> That's what I did.

 

Yes the problem went away! Thanks a lot.

----------

## manwe_

I need a small help with font config. Yesterday I've switched my system to font Candara [from vista-fonts]. Looks great. But have a problem with bold text. This is how it looks with 96dpi: http://img368.imageshack.us/img368/6813/screenshot2008101700091rl5.png . As you can see, there is almost no difference between normal and bold up to 10pt. Some of the letters are a bit thicker [like w or x] which makes it ever look worse. Any ideas how can I get bold font at least from 9pt? Current config: lcddefault, hintslight, cairo-1.8.0, libXft-2.1.13.

----------

## PaulBredbury

 *manwe_ wrote:*   

> how can I get bold font at least from 9pt?

 

I would suggest creating a rule in ~/.fonts.conf to change to hintfull at <= 9pt for that font.

You might need my patch from the previous page in this thread, to get cairo to respect the rule.

----------

## manwe_

For a quick test, without need to use patch or another rule, I've changed to hintfull for all fonts... Doesn't look any different for me: http://img90.imageshack.us/img90/9762/screenshot2008101701072am7.png

----------

## PaulBredbury

Oh well. Would have to do something else to distinguish it. Maybe need to switch to a different font when that small.

Edit: Don't you have candarab.ttf - Candara Bold? That sounds like the perfect font to switch to  :Wink: 

Edit2: Nah, that practically changes to non-bold Candara at small sizes, just as you've shown. Maybe change to bold-italic - at least that looks different.

----------

## manwe_

Yup, I have candarab.ttf. What's funny, vista-fonts are somehow different than fonts from micro$oft. Now I have normal and bold thin, but when I've tried oryginal fonts [PowerPointViewer installation] I had normal and bold .. thick [in all sizes, also without difference between those two]. Unfortunately candara.ttf from vista-fonts + candarab.ttf from PPV also didn't work out. 

Bold + italic is some kind of solution, but how can I force italic when bold? In .gtkrc-2.0 I have just Candara 9, bold style is used by some programs, like liferea to highlight something. And that's what pisses me off, this lack of distinction. But not enogh to change font, looks too good for me  :Wink: 

Thanks anyway.

----------

## PaulBredbury

Here ya go:

```
   <!-- From http://forums.gentoo.org/viewtopic-t-511382-start-650.html

   To create difference between small Candara and small Candara bold -->

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

      <test name="family" qual="any">

         <string>Candara</string>

      </test>

      <test compare="less_eq" name="size">

         <double>10</double>

      </test>

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

         <const>medium</const>

      </test>

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

         <bool>true</bool>

      </edit>

   </match>
```

It makes the "small Candara bold" very wide, but at least it's distinguishable.

I don't know why this is needed - maybe a bug with the font's definition file  :Confused: 

----------

## manwe_

 *PaulBredbury wrote:*   

> It makes the "small Candara bold" very wide, but at least it's distinguishable.

 

Wider than oryginal bold, but imho not very wide. Blurry, that's for sure (even with hintfull added to this <match>) : http://img264.imageshack.us/img264/5535/screenshot2008101704241ui3.png

Never mind though, works for me. Definitely better than nothing. Many thanks 4 help  :Smile: 

----------

## ocin

Seriously, the patched ebuilds are better than the default ones - but the fonts still suck.

Comparing gentoos fonts with the patched ebuilds to a debian systems with font related .debs (libxft, libcairo and libfreetype) from ubuntu:

Gentoo: http://nico.core.ws/tmp/gentoo_sq.png

Ubuntu: http://nico.core.ws/tmp/ubuntu_sq.png

Both screenshots show squirrelmails option page in mozilla firefox 3.x.x with the following options set in about:config:

```
font.FreeType2.autohinted true

font.FreeType2.enable true

font.Freetype2.unhinted false
```

The gentoo system uses following settings:

All font packages are compiled with newspr and ubuntu useflags.

eselect fontconfig list:

 *Quote:*   

>    [1]   10-antialias.conf *
> 
>   [2]   10-autohint.conf *
> 
>   [3]   10-hinting.conf *
> ...

 

The debian/ubuntu system uses autohint/hintfull and subpixel rendering (set in gnomes settings)

The difference is clear. Gentoos fonts suck hard.

Are those ebuilds including all patches which are used by ubuntu?

The fonts under archlinux are looking like the ubuntu ones just for your info.

Do we need to change the ebuilds and add more/other patches? Or am I missing something?

----------

## swimmer

Try with 70-no-bitmaps.conf enabled ...

HTH

swimmer

----------

## PaulBredbury

 *mostidiot wrote:*   

> the fonts still suck.

 

It's blatantly obvious that you're seeing a bitmap font - can't you see that??

The problem is, some weirdos actually prefer bitmap fonts sometimes, so we can't have one perfect ruleset to suit everyone. This is why you have to use your brain, read this thread, and create your own ruleset.

----------

## ocin

ah, thx.

The fonts look nice now in firefox but my urxvt font is broken now.

http://nico.core.ws/tmp/nobitmap.png

URxvt*font: xft:Terminus:pixelsize=14

edit: fixed it with http://nico.core.ws/misc/50-enable-terminus.conf

edit2: the fontconfig ebuilds have errors:

In the ebuilds there is a line

```
cp "${FILESDIR}"/30-replace-bitmap-fonts.conf conf.d/
```

this does not work because the patches need to be adjusted too (fontconfig-2.6.0-ubuntu.diff and fontconfig-2.5.0-ubuntu-3.diff)

files: fontconfig-2.6.0/conf.d/Makefile.am, fontconfig-2.5.0/conf.d/Makefile.in and fontconfig-2.5.0/conf.d/Makefile.am

this is a bit of botch.

edit3: cairo-1.8.2 is in portage now tooLast edited by ocin on Wed Nov 05, 2008 4:13 pm; edited 1 time in total

----------

## overkll

Cairo-1.8.2 was released yesterday as stable into the portage tree.  It has (-newspr%*).  Will a new cairo ebuild be added to the lcd-brightness overlay, or is 1.8.2 ok to use?

----------

## bi3l

I've just spent some time synchronizing the overlay with portage ebuilds and ubuntu patches. I've also removed old ebuilds and patches and fixed the issue with 30-replace-bitmap-fonts.conf. As for cairo-1.8.2, it's not used by ubuntu yet, so there are no patches at the moment. I'll see if the old patches can be used as is.

As always, the overlay is available here: http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2

----------

## PaulBredbury

 *bi3l wrote:*   

> if the old patches can be used as is.

 

The cairo directfb-no-accel patch doesn't apply. That's all I found, in Fedora.

----------

## bi3l

Thanks Paul, I've fixed the directfb-no-accel patch and updated to 1.8.2 in the overlay.

----------

## ocin

Thanks for your work, I have updated devnull overlay too.

----------

## briancl

I have my fonts setup the way I want using the devnull overlay and configs I copies from this thread, but for some reason the bold fonts are fuzzy.  Can anyone identify what I am missing?  Also, one thing I notice is a bit odd.  I have hinting set to full in all possible places, but xrdb -query shows "Xft.hintstyle" is set to medium.  Why is that?

In this screenshot you can see the non-bold text looks good, but the bold text in the titlebar and in the webpage is fuzzy. http://kokshark.techbandits.com/~silent/font.png

build options and overlay:

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

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

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

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

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

Portage tree and overlays:

 [0] /usr/portage

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

```

fontconfig:

```
  [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-urw-aliases.conf *

  [19]  40-nonlatin.conf *

  [20]  45-latin.conf *

  [21]  49-sansserif.conf *

  [22]  50-user.conf *

  [23]  51-local.conf *

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

  [25]  59-dejavu.conf *

  [26]  60-latin.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 *
```

/etc/fonts/local.conf:

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

<?xml version='1.0'?>

<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>

<fontconfig>

 <selectfont>

  <rejectfont>

   <pattern>

    <patelt name="scalable" >

     <bool>false</bool>

    </patelt>

   </pattern>

  </rejectfont>

 </selectfont>

  <alias binding="same">

    <family>Helvetica</family>

    <accept>

      <family>DejaVu Sans</family>

    </accept>

  </alias>

  <alias binding="same">

    <family>Times</family>

    <accept>

      <family>DejaVu Serif</family>

    </accept>

  </alias>

  <alias binding="same">

    <family>Courier</family>

    <accept>

      <family>DejaVu Sans Mono</family>

    </accept>

  </alias>

</fontconfig>
```

my user's .fonts.conf

```
# cat ~/.fonts.conf

<?xml version='1.0'?>

<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>

<fontconfig>

 <match target="font" >

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

   <bool>true</bool>

  </edit>

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

   <const>rgb</const>

  </edit>

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

   <bool>false</bool>

  </edit>

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

   <bool>true</bool>

  </edit>

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

   <const>hintfull</const>

  </edit>

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

   <const>lcddefault</const>

  </edit>

  <!-- lcdnone, lcddefault, lcdlight, lcdlegacy -->

 </match>

 <selectfont>

  <rejectfont>

   <pattern>

    <patelt name="scalable" >

     <bool>false</bool>

    </patelt>

   </pattern>

  </rejectfont>

 </selectfont>

 <match target="font">

  <test name="weight" compare="more"><const>medium</const></test>

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

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

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

 </match>

</fontconfig>
```

xrdb:

```
xrdb -query | grep Xft

Xft.antialias:  1

Xft.hinting:    1

Xft.hintstyle:  hintmedium

Xft.lcdfilter:  lcddefault

Xft.rgba:       rgb

```

----------

## mwhitlock

briancl, your system is doing exactly what you told it to do, but as is often the case with computers, maybe not what you want it to do.

Remove the last <match> section from your ~/.fonts.conf.  That section is disabling hinting for bold fonts, but evidently you like the look of hinted fonts, so you should remove that override.

----------

## Phlogiston

 *bi3l wrote:*   

> Thanks Paul, I've fixed the directfb-no-accel patch and updated to 1.8.2 in the overlay.

 

Thanks for your great work and constant updates!

----------

## orangeluna

thanks to bi3l and to whomever else it responsible to getting great font rendering on my Gentoo box.  I have one question that I can't figure out though,  I have selected "[15]  20-unhint-small-dejavu.conf" but my nine point dejavu fonts are still being hinted.  Here's my "eselect fontconfig list" and my ".fonts.conf":

```
[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.conf *                

  [16]  20-unhint-small-dejavu-experimental.conf *   

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

  [18]  25-unhint-nonlatin.conf                      

  [19]  30-metric-aliases.conf *                     

  [20]  30-replace-bitmap-fonts.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]  52-languageselector.conf *

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

  [29]  57-dejavu.conf

  [30]  60-latin.conf *

  [31]  60-liberation.conf *

  [32]  61-dejavu-experimental.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]  80-delicious.conf *

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

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

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">                  

<fontconfig>                                              

<!-- default setting for everything. -->

<!-- set system-wide by "eselect fontconfig" -->

<!--   antialias, hinting-slight (no autohint!?), no sub-pixel -->

<fontconfig>

 <match target="font" >

  <!-- lcdnone, lcddefault, lcdlight, lcdlegacy -->

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

   <const>lcddefault</const>                       

  </edit>                                          

 </match>                                          

<!-- Fonts in this size range render unreliably using the LCD filter; 

  problems with tracking and kerning, predominantly. The solution is  

  to disable autohinting so the BCI takes over. -->                   

 <match target="font" >                                               

  <test compare="more" name="pixelsize" qual="all" >                  

   <double>9</double>                                                 

  </test>                                                             

  <test compare="less" name="pixelsize" qual="all" >                  

   <double>13</double>                                                

  </test>                                                             

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

   <bool>false</bool>                                                 

  </edit>                                                             

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

   <const>none</const>                                                

  </edit>                                                             

 </match>                                                             

<!-- Turn off autohinting for Arial medium sizes -->

 <match target="font" >                             

  <test compare="less" name="pixelsize" qual="all" >

   <double>14</double>                              

  </test>                                           

  <test compare="more" name="pixelsize" qual="all" >

   <double>11.75</double>                           

  </test>                                           

  <test name="family" qual="all" >                  

   <string>Arial</string>                           

  </test>                                           

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

   <bool>false</bool>                               

  </edit>                                           

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

   <const>none</const>                              

  </edit>                                           

 </match>                                           

<!-- Turn off autohinting for Verdana small sizes -->

 <match target="font" >                              

  <test compare="less" name="pixelsize" qual="all" > 

   <double>11</double>                               

  </test>                                            

  <test name="family" qual="all" >                   

   <string>Verdana</string>                          

  </test>                                            

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

   <bool>false</bool>                                

  </edit>                                            

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

   <const>none</const>                               

  </edit>                                            

 </match>                                            

<!-- Prevent smaller boldfaced serif text from becoming too big.-->

 <match target="font" >                                            

  <test name="weight" qual="all" >                                 

   <const>bold</const>                                             

  </test>                                                          

  <test compare="less" name="pixelsize" qual="all" >               

   <double>15</double>                                             

  </test>                                                          

  <test compare="more" name="pixelsize" qual="all" >               

   <double>7</double>                                              

  </test>                                                          

  <test name="family" qual="any" >                                 

   <string>Georgia</string>                                        

   <string>Gentium</string>                                        

   <string>Times New Roman</string>                                

   <string>Garamond</string>                                       

   <string>Apple Garamond</string>                                 

   <string>serif</string>                                          

   <string>Linux Libertine</string>                                

   <string>Linux Libertine OTF</string>                            

  </test>                                                          

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

   <const>hintfull</const>                                         

  </edit>                                                          

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

   <bool>false</bool>                                              

  </edit>                                                          

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

   <const>none</const>                                             

  </edit>                                                          

 </match>                                                          

        <!-- Replace Courier with a better-looking font -->

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

                <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                                                                 

        <!-- Replace Courier New with a better-looking font -->

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

                <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>

        <!-- To fix Calibri font - http://forums.fedoraforum.org/showthread.php?p=1045807#post1045807 -->

        <match target="font">

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

                        <bool>false</bool>

                </edit>

        </match>

</fontconfig>
```

How can I fix this?

----------

## mwhitlock

 *orangeluna wrote:*   

> thanks to bi3l and to whomever else it responsible to getting great font rendering on my Gentoo box.  I have one question that I can't figure out though,  I have selected "[15]  20-unhint-small-dejavu.conf" but my nine point dejavu fonts are still being hinted.

 

Unless you've edited 20-unhint-small-dejavu.conf, it'll only unhint DejaVu fonts at sizes less than 7.5 pixels.  Unless you're running your X at less than 60 dpi, 9-point text is going to be rendered using more than 7.5 pixels.

----------

## orangeluna

 *mwhitlock wrote:*   

>  *orangeluna wrote:*   thanks to bi3l and to whomever else it responsible to getting great font rendering on my Gentoo box.  I have one question that I can't figure out though,  I have selected "[15]  20-unhint-small-dejavu.conf" but my nine point dejavu fonts are still being hinted. 
> 
> Unless you've edited 20-unhint-small-dejavu.conf, it'll only unhint DejaVu fonts at sizes less than 7.5 pixels.  Unless you're running your X at less than 60 dpi, 9-point text is going to be rendered using more than 7.5 pixels.

 

Thanks mwhitlock you got me on the right track.  The configurations for the system (eselect fontconfig...) were right (i.e. dejavu was doing what it was supposed to do).  I discovered that this line in my ".fonts.conf" made the low-pixel fonts hinted:

```
 <match target="font" >                                               

  <test compare="more" name="pixelsize" qual="all" >                 

   <double>9</double>                                                 

  </test>                                                             

  <test compare="less" name="pixelsize" qual="all" >                 

   <double>13</double>                                               

  </test>                                                             

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

   <bool>false</bool>                                                 

  </edit>                                                             

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

   <const>none</const>                                               

  </edit>                                                             

 </match>  
```

I got the DE setup now and all the font configured nicely.  Thanks mwhitlock, I got a nicely font rendered screen and I don't even need a ~/.fonts.conf!

Thanks to bi3l for ebuilds.

----------

## orangeluna

A bug in one of these programs I discovered is rendering fonts unpredictably if I don't have a "~/.fonts.conf" so it is a good idea to create a basic setup:

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

 <match target="font" >

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

   <bool>true</bool>

  </edit>

 </match>

 <match target="font" >

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

   <const>rgb</const>

  </edit>

 </match>

 <match target="font" >

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

   <bool>true</bool>

  </edit>

 </match>

 <match target="font" >

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

   <const>hintmedium</const>

  </edit>

 </match>

</fontconfig>
```

----------

## GoofyX

cairo-1.8.4 was committed in portage.

----------

## bi3l

And the overlay has been updated.

----------

## swimmer

 *bi3l wrote:*   

> And the overlay has been updated.

 

Thanks bi3l for your good & fast work  :Smile: 

----------

## acevery

 *bi3l wrote:*   

> And the overlay has been updated.

 

Thanks bi3l, you greatly help us   :Very Happy: 

----------

## AaronPPC

It is a good update.  My text is noticeably better.

----------

## na641

hmm, am i the only one not seeing this newest cairo in my overlay after updating? am i missing something?

----------

## tuqs

 *na641 wrote:*   

> hmm, am i the only one not seeing this newest cairo in my overlay after updating? am i missing something?

 

I updated the devnull overlay.  :Smile: 

----------

## Evilguru

I have followed the instructions to the letter, however, they seem to have had no effect whatsoever.

```

freddie@iodine ~ $ xrdb -query

[...]

Xft.antialias:   1

Xft.dpi:   99

Xft.hinting:   1

Xft.hintstyle:   hintslight

Xft.rgba:   none

```

```

iodine freddie # emerge -pv libXft cairo freetype fontconfig

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

Calculating dependencies... done!

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

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

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

[ebuild   R   ] x11-libs/cairo-1.8.4  USE="X newspr opengl svg -debug -directfb -doc -glitz -xcb" 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

iodine freddie # 

```

```

freddie@iodine ~ $ cat ~/.fonts.conf 

<?xml version='1.0'?> 

<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> 

<fontconfig> 

 <match target="font" > 

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

   <bool>true</bool> 

  </edit> 

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

   <const>rgb</const> 

  </edit> 

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

   <bool>true</bool> 

  </edit> 

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

   <const>hintfull</const> 

  </edit> 

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

   <const>lcddefault</const> 

  </edit> 

  <!-- lcdnone, lcddefault, lcdlight, lcdlegacy --> 

 </match> 

 <selectfont> 

  <rejectfont> 

   <pattern> 

    <patelt name="scalable" > 

     <bool>false</bool> 

    </patelt> 

   </pattern> 

  </rejectfont> 

 </selectfont> 

</fontconfig>

```

I get huge amounts of colour fringing in all applications. What am I doing wrong? I run GNOME, but am unsure if the config options are breaking things.

Regards, Freddie.

----------

## PaulBredbury

 *Evilguru wrote:*   

> colour fringing in all applications.

 

Try changing "rgb" to one of: bgr, vrgb, vbgr

Use the almighty Google to see what's the right value for your monitor.

----------

## Evilguru

 *PaulBredbury wrote:*   

>  *Evilguru wrote:*   colour fringing in all applications. 
> 
> Try changing "rgb" to one of: bgr, vrgb, vbgr
> 
> Use the almighty Google to see what's the right value for your monitor.

 

I have tried them all; however, I can assure that it is RGB (Ubuntu live-cd for the win!). Therefore, it is a Gentoo related issue.

I have tried removing ~/.fonts.conf. Running eselect fontconfig list:

```

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]  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]  65-fonts-persian.conf *

  [29]  65-khmer.conf

  [30]  65-nonlatin.conf *

  [31]  69-unifont.conf *

  [32]  70-no-bitmaps.conf

  [33]  70-yes-bitmaps.conf

  [34]  80-delicious.conf *

  [35]  90-synthetic.conf *

```

However, xrdb -query still gives the same as above (as if it is ignoring the fontconfig eselect stuff totally).

FF, GNOME and Qt apps all show colour fringing, OpenOffice.org still uses plain-old greyscale AA. I wish I knew where all of these applications were getting their info from.

Regards, Freddie.

----------

## Phlogiston

I have no idea why, but in kde4 suddenly the nice fonts disappeared. They are still great in gtk apps, but not in kde. They look hinted but like that newspr thing is not applied.

Here is eselect. What else should I check?

```

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-lohit-gujarati.conf                         

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

  [17]  25-unhint-nonlatin.conf                        

  [18]  30-amt-aliases.conf                            

  [19]  30-metric-aliases.conf *

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

  [21]  30-urw-aliases.conf *

  [22]  40-generic.conf

  [23]  40-nonlatin.conf *

  [24]  45-latin.conf *

  [25]  49-sansserif.conf *

  [26]  50-user.conf *

  [27]  51-local.conf *

  [28]  52-languageselector.conf *

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

  [30]  60-latin.conf *

  [31]  65-fonts-persian.conf *

  [32]  65-khmer.conf

  [33]  65-nonlatin.conf *

  [34]  69-unifont.conf *

  [35]  70-no-bitmaps.conf *

  [36]  70-yes-bitmaps.conf

  [37]  80-delicious.conf *

  [38]  90-synthetic.conf *

```

----------

## ocin

```
[4]   10-hinting-full.conf * 

[5]   10-hinting-medium.conf * 
```

you can only use one of them

----------

## devsk

Can anyone tell me where are the instructions? the link mentioned in the first post is dead.

Is everything required for this to work, in portage now?

I have horrible fonts in both kde and gtk apps. I have yet to update to cairo-1.8.4 though.

----------

## Phlogiston

 *ocin wrote:*   

> 
> 
> ```
> [4]   10-hinting-full.conf * 
> 
> ...

 

Thanks, I think that did the trick!

----------

## devsk

What provides 10-hinting-*.conf ? I only seem to have the following:

```
# 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 *

```

Can someone please tell me where the instructions are? My fonts have a fuzzy look at full hinting and subpixel vrgb (rgb gives a color fringe).

----------

## Phlogiston

You need that tarball as an overlay and then set the new useflags: ubuntu and newspr.

----------

## devsk

 *Phlogiston wrote:*   

> You need that tarball as an overlay and then set the new useflags: ubuntu and newspr.

 I need little help here. Which tarball are you referring to? So, does this mean that not all the stuff is in the portage as yet? Is there a link for a howto?

----------

## bi3l

layman -a devnull

echo "media-libs/fontconfig ~x86" >> /etc/portage/package.keywords

echo "media-libs/freetype ~x86" >> /etc/portage/package.keywords

echo "x11-libs/cairo ~x86" >> /etc/portage/package.keywords

echo "x11-libs/libXft ~x86" >> /etc/portage/package.keywords

echo "media-libs/fontconfig ubuntu" >> /etc/portage/package.use

echo "media-libs/freetype ubuntu" >> /etc/portage/package.use

echo "x11-libs/cairo newspr" >> /etc/portage/package.use

echo "x11-libs/libXft newspr" >> /etc/portage/package.use

emerge -uDN world

----------

## Phlogiston

 *devsk wrote:*   

>  *Phlogiston wrote:*   You need that tarball as an overlay and then set the new useflags: ubuntu and newspr. I need little help here. Which tarball are you referring to? So, does this mean that not all the stuff is in the portage as yet? Is there a link for a howto?

 

http://ogmrip.sourceforge.net/misc/gentoo-lcd-filtering.tar.bz2 <- this one... dunno where you could find the howto though.

----------

## devsk

 *bi3l wrote:*   

> layman -a devnull
> 
> echo "media-libs/fontconfig ~x86" >> /etc/portage/package.keywords
> 
> echo "media-libs/freetype ~x86" >> /etc/portage/package.keywords
> ...

 THANK YOU!

Can someone please put this stuff right at the first page?

----------

## devsk

I knew I was missing something... :Smile:  Fonts look better now.

Now question: How do I improve 32-apps?

----------

## Evilguru

I have tried the exact same thing on a KDE system and fonts are looking fantastic. But not GNOME.

I think GNOMEs silly font configuration dialogue is overriding whatever eselect fontconfig does. How can I disable this?

Regards, Freddie.

----------

## PaulBredbury

 *Evilguru wrote:*   

> GNOMEs silly font configuration dialogue is overriding

 

I suggest you add cairo-respect-fontconfig.patch  :Wink: 

----------

## devsk

I have some color fringe around some letters like 'l', 'n', 'f' and 'i'. How do I get rid of this? What is the fix for gnome not following eselect stuff?

----------

## PaulBredbury

 *devsk wrote:*   

> around some letters

 

Add a rule in ~/.fonts.conf to change the rendering for that particular font and/or fontsize.

----------

## devsk

This applies to all fonts. Its weird behavior. 'i' and 'y' are thicker. But thunderbird-2.0.0.18 has fonts come out better. KDE and tk+ apps  except thunderbird-2.0.0.18 seems to having the problem. I have no idea. Do I need to recompile kdelibs/pango etc.?

Also, thunderbird seems to follow eselect selections of font rules while other gnome/kde use/modify ~/.fonts.conf and Xft.* rules in xrdb. So many sources of truth, and utter confusion.

Any more suggestions?

----------

## devsk

So, far the only fonts that I have liked are in thunderbird-2.0.0.18. I don't know what it compiled with or what options it uses or where it gets its options from, but it has no fringe, no coloring, no thicker 'i' or 'y', just smooth good looking fonts. How do I make the rest of the system behave that way?

----------

## devsk

Seems to be happening with Segoe UI and Consolas fonts I copied from my Vista machine. Hmmm...some conspiracy here... :Smile: 

These had become my favorite fonts... :Sad:  Tahoma and Lucia seem to be work fine.

----------

## Evilguru

 *PaulBredbury wrote:*   

>  *Evilguru wrote:*   GNOMEs silly font configuration dialogue is overriding 
> 
> I suggest you add cairo-respect-fontconfig.patch 

 

What would be the easiest way to add this? I do not really want to have to add my own custom overlay (and by extension, my own ebuild). Is there an easier way?

Regards, Freddie.

----------

## Phlogiston

 *Evilguru wrote:*   

>  *PaulBredbury wrote:*    *Evilguru wrote:*   GNOMEs silly font configuration dialogue is overriding 
> 
> I suggest you add cairo-respect-fontconfig.patch  
> 
> What would be the easiest way to add this? I do not really want to have to add my own custom overlay (and by extension, my own ebuild). Is there an easier way?
> ...

 

Yes this should be added to the ebuild as use flag.

----------

## ocin

I can add the patch to cairo in devnull overlay, however I need the link (can't find it in the fedoraforums) and it has to apply against cairo-1.8.4.

Also you don't need to add "newspr" and "ubuntu" useflags, they are enabled by default (+prefixed).

If you have problems with kde+fonts and you are using nvidia-drivers, update them or disable glyph cache.

----------

## devsk

 *ocin wrote:*   

> If you have problems with kde+fonts and you are using nvidia-drivers, update them or disable glyph cache.

 I am using the latest nvidia drivers: 180.16. What do I need to do? How do I disable glyph cache? Does it even exist on 6600GT?

----------

## PaulBredbury

 *ocin wrote:*   

> however I need the link (can't find it in the fedoraforums) and it has to apply against cairo-1.8.4.

 

Gotta be kidding me. Read the thread and look at the cairo src.rpm. It's not a magical file. It contains the patch (and the patch is available on my FTP site as a file in its own right anyway), and full build instructions in the .spec file, plus a ton of useful URLs.

$ rpm -q cairo

cairo-1.8.4.20081118-1.fc9.i386

cairo-1.8.4.20081118-2.fc9.x86_64

So yes, it works with 1.8.4

----------

## devsk

 *PaulBredbury wrote:*   

> and the patch is available on my FTP site as a file in its own right anyway

 I think he (and me) just want that link. Where is the link to your FTP site?

----------

## ocin

 *devsk wrote:*   

>  *ocin wrote:*   If you have problems with kde+fonts and you are using nvidia-drivers, update them or disable glyph cache. I am using the latest nvidia drivers: 180.16. What do I need to do? How do I disable glyph cache? Does it even exist on 6600GT?

 

It should work with 180.16, but try "nvidia-settings -a GlyphCache=0" but before update the devnull overlay and recompile cairo

I have added all patches to cairo in devnull overlay, please update the overlay and rebuild cairo

----------

## justinkb

I've been watching this thread for a while, and decided to try this out. Added all keywords and use flags to /etc/paludis, yet I can't seem to lose this error:

```
paul@yoga ~ $ winecfg

Fontconfig warning: "/etc/fonts/conf.d/11-lcd-filter-lcddefault.conf", line 9: invalid constant used : lcddefault

Fontconfig warning: "/etc/fonts/conf.d/53-monospace-lcd-filter.conf", line 17: invalid constant used : lcdlegacy

Fontconfig warning: "/etc/fonts/conf.d/11-lcd-filter-lcddefault.conf", line 9: invalid constant used : lcddefault

Fontconfig warning: "/etc/fonts/conf.d/53-monospace-lcd-filter.conf", line 17: invalid constant used : lcdlegacy

```

Now, I assume this means that the lcdfilter-ing is broken, and fonts - I think - don't look quite right. I have recompiled fontconfig, libXft, freetype and cairo numerous times without effect... Also tried changing the constants in the .conf files to lcdfilter{default,legacy} but that didn't work either. Any idea what I could do to fix this guys?

----------

## PaulBredbury

 *justinkb wrote:*   

> $ winecfg

 

Wine is 32-bit. I bet you're on 64-bit  :Wink: 

So wine uses your 32-bit libs and doesn't know/care about the 64-bit libs. Recompiling the 64-bit libs makes no difference whatsoever to wine.

Recompile your 32-bit libs - if Gentoo lets you, I forget its multilib foibles. Otherwise, just ignore the warning message.

----------

## mwhitlock

 *PaulBredbury wrote:*   

> Wine is 32-bit. I bet you're on 64-bit 

 

You'd have to compile these four libs on a 32-bit Gentoo system (do you have a 32-bit chroot system?) and copy them over the ones that come with the emul-linux packages.  I have the same problem with Wine, but I don't use it enough to care that its fonts aren't spectacular like the rest of my Gentoo system.  :Smile: 

----------

## justinkb

Thanks PaulBredbury and mwhitlock, that put my mind at ease. I second your not-caring-enough to fix this  :Smile:  I hardly ever use wine anyway.

----------

## justinkb

Sorry for the double post, but I have one last issue. Please refer to the following image...

[IMG]http://img355.imageshack.us/img355/6706/fontrendernz1.png[/IMG]

I am loving the fonts how they are rendering on the web site, and in my menu. However, the fonts near buttons and for example all the fonts in my aMule aren't quite as pretty and I've got no idea why. Hope you guys can help me out again  :Smile: 

edit: It's *not* because they are bold... because they are not. Furthermore, my window title font is bold and looks great.

----------

## ocin

the image looks good to me, post an image of amule so we can see what you mean

----------

## justinkb

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).

----------

## GoofyX

Merry Christmas to all!  :Smile: 

I just want to say that cairo 1.8.6 is in the portage (~).  :Smile: 

----------

## NeddySeagoon

Locked to due thread size, continued in part 2

----------

