[Fontconfig] Courier New overrides monospace

Raimund Steger rs at mytum.de
Tue Jul 16 09:02:20 PDT 2013

Trung Ngo wrote:
> Ngày 15/07/2013 17:37, Raimund Steger viết:
>  >
>> Courier New should really render OK if you turn off AA for small pixel
>> sizes and use the bytecode hinter. (That's what it was designed for,
>> after
>> all.)
> I'm not familiar with how to use the bytecode hinter. Nevertheless, your
> two solutions yield unsatisfactory result, unfortunately. Turning off AA

You should get it automatically if your FreeType version is recent 
enough. You don't need to turn off AA for the whole configuration, just 
for Courier New. That'll get you the traditional GDI look of the font 
(with some very negligible differences, such as lowercase 'a'):

<match target="font">
   <test name="family"><string>Courier New</string></test>
   <test name="pixelsize" compare="more"><double>7</double></test>
   <test name="pixelsize" compare="less"><double>24</double></test>
   <edit name="hinting"><bool>true</bool></edit>
   <edit name="autohint"><bool>false</bool></edit>
   <edit name="antialias"><bool>false</bool></edit>

> is a painful experience for my eyes and emboldening is, well, too bold
> for a regular typeface.

Have you tried it? It's not that bad. It renders with about the same 
weight as unmodified Liberation Mono. I'd say it's just about right for 
on-screen AA rendering. Of course, YMMV. I've put an example here:


I do admit though that this amount of config would be stretching things 
a bit, if all you want to do is demote Courier New. It will also cause 
suboptimal results for printing, as a lot of applications don't set DPI 
in the pattern.

> How about putting Liberation Mono right before Courier New so that at
> least it has a chance to match?

If you're putting together a specialized Linux distribution, you are in 
a good position to do exactly that! As Felix suggested, just ship an 
additional config file between position 50 and 60 with the single rule:

<match target="pattern">
   <test name="family"><string>monospace</string></test>
   <edit name="family" mode="prepend"><string>Liberation 

Maybe this even creates some traction so that other distros pick it up; 
I'm just not sure if changing it in upstream first is the right way to 
proceed here, particularly as I think there (still) are a lot of people 
who don't use AA below a certain pixelsize, and following Akira's 
suggestion I just checked a more recent version of Liberation Mono and 
indeed, somebody seems to have removed the hinting. What a shame, it 
used to be such a nicely hinted font.


Worringer Str 31 Duesseldorf 40211 DE  home: <rs at mytum.de>
+49-179-2981632 icq 16845346           work: <rs at interface-ag.de>

More information about the Fontconfig mailing list