Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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 at 18:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.