Difference between revisions of "Font configuration/Examples"

From ArchWiki
Jump to: navigation, search
m (Basic config with no hinting for italic or bold and some other tuning: - very nice brebs, clean up style a little bit)
(Pointed at fontconfig rules for Infinality rather than Ubuntu rendering)
Line 4: Line 4:
 
== brebs' configuration ==
 
== brebs' configuration ==
  
This is a quest to get all fonts looking beautiful at all sizes, weights, etc., by tweaking the fontconfig rules. The latest version is [http://forums.gentoo.org/viewtopic-p-6183606.html#6183606 maintained here] -- brebs
+
This is a quest to get all fonts looking beautiful at all sizes, weights, etc., by tweaking the fontconfig rules for [http://www.infinality.net/blog/ Infinality rendering]. The latest version is [http://forums.gentoo.org/viewtopic-p-7273876.html#7273876 maintained here] -- brebs
  
 
== Basic config with no hinting for ''italic'' or '''bold''' and some other tuning==
 
== Basic config with no hinting for ''italic'' or '''bold''' and some other tuning==

Revision as of 11:26, 19 April 2013

Configurations can vary to a degree. Please feel free to post your fontconfig configurations and the rationale behind them.

brebs' configuration

This is a quest to get all fonts looking beautiful at all sizes, weights, etc., by tweaking the fontconfig rules for Infinality rendering. The latest version is maintained here -- brebs

Basic config with no hinting for italic or bold and some other tuning

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

  <match target="font">
    <test name="pixelsize" qual="any" compare="more"><double>15</double></test>
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
  </match>

  <match target="font">
    <test name="weight" compare="more"><const>medium</const></test>
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
  </match>

  <match target="font">
    <test name="slant"  compare="not_eq"><double>0</double></test>
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
  </match>

</fontconfig>

Sharp fonts

It took me a while to find font settings that are sharp and not overly blurred. This font config does exactly that and seems to work fine everywhere. I searched for this because "Chromium" wasn't looking good with no aliasing at all. The below config fixes that as well.

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <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>
    <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
  </match>
</fontconfig>