Difference between revisions of "Font configuration/Examples"

From ArchWiki
Jump to: navigation, search
m (Web developer's: removed out of date config (circa 2004) - BCI is enabled by default now, etc)
(Pointed at fontconfig rules for Infinality rather than Ubuntu rendering)
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
[[Category:Fonts]]
 
Configurations can vary to a degree.  Please feel free to post your fontconfig configurations and the rationale behind them.
 
Configurations can vary to a degree.  Please feel free to post your fontconfig configurations and the rationale behind them.
  
 
== 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==
Line 11: Line 12:
 
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
 
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
 
<fontconfig>
 
<fontconfig>
<match target="font" >
+
  <match target="font" >
<edit mode="assign" name="autohint"> <bool>true</bool></edit>
+
    <edit mode="assign" name="autohint"> <bool>true</bool></edit>
<edit mode="assign" name="hinting"> <bool>false</bool></edit>
+
    <edit mode="assign" name="hinting">   <bool>false</bool></edit>
<edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit>
+
    <edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit>
<edit mode="assign" name="hintstyle"> <const>hintslight</const></edit>
+
    <edit mode="assign" name="hintstyle"> <const>hintslight</const></edit>
<edit mode="assign" name="antialias"> <bool>true</bool></edit>
+
    <edit mode="assign" name="antialias"> <bool>true</bool></edit>
<edit mode="assign" name="rgba"> <const>rgb</const></edit>
+
    <edit mode="assign" name="rgba">     <const>rgb</const></edit>
</match>
+
  </match>
  
<match target="font">
+
  <match target="font">
<test name="pixelsize" qual="any" compare="more"><double>15</double></test>
+
    <test name="pixelsize" qual="any" compare="more"><double>15</double></test>
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
+
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit></match>
+
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
 +
  </match>
  
<match target="font">
+
  <match target="font">
<test name="weight" compare="more"><const>medium</const></test>
+
    <test name="weight" compare="more"><const>medium</const></test>
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
+
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit></match>
+
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
 +
  </match>
  
<match target="font">
+
  <match target="font">
<test name="slant" compare="not_eq"><double>0</double></test>
+
    <test name="slant" compare="not_eq"><double>0</double></test>
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
+
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
<edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit></match>
+
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
 +
  </match>
  
 
</fontconfig>
 
</fontconfig>

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>