11

On OS X, monospaced fonts are slightly more weighted than the other fonts. This (I feel) helps bring out the colors more vividly. screenshot

Since I am on Linux, I'm trying to replicate the behavior. I'm trying to do this by editing the property "weight" in ~/.fonts.conf,

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <test name="family">
      <string>DejaVu Sans Mono</string>
      <string>Bitstream Vera Sans Mono</string>
    </test>
    <edit name="weight" mode="assign">
        <const>medium</const>
    </edit>
  </match>
</fontconfig>

Apparently, this does not work properly. What happens is that bold face DejaVu or Bitstream mono fonts becomes more bold, and nothing happens to the other. screenshot

So how do I fix this?

Mat
  • 52,586

1 Answers1

11

Okay, I figured this out. From the man page of fonts-conf, the property weight sets the weight of the bold face, and not the weight of the font. This was why changing weight lead to a bolder boldface rather than change the whole font. What I was looking for was emboldening which enables synthetic font emboldening. Using that in ~/.fonts.conf solved the problem.

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
    <test name="family">
    <string>Inconsolata</string>
    </test>
    <edit name="embolden" mode="assign">
        <bool>true</bool>
    </edit>
</match>
</fontconfig>

Before and after using Inconsolata 12 pt. font (I also disabled font hinting while taking this screenshot).

before screenshot

after screenshot

It would be nice if the amount of emboldening could also be controlled.

  • 4
    I would also love to figure out how to control the weight of the emboldening. Maybe half-embolden would be closest to Mac OS X style. – Christopher Poile Jan 12 '14 at 18:22