> ChrisAcheson.net_

How to get ProFont working in Ubuntu

At the suggestion of a friend, I’ve recently started using a font called “ProFont” for my programming and other terminal-related activities.  It’s quite nice, and designed to be readable at small sizes.  I use it at 8 point:

8 point ProFont in an 80x24 terminal

8 point ProFont in an 80x24 terminal

I don’t actually use 80×24 anymore, but you get the idea.

It didn’t immediately work when I installed it on my main machine (which runs Kubuntu), and it took some digging to figure out why.  It turns out that fonts on modern Linux machines are handled by a horrible chimera.  There’s the new font system, “fontconfig”, as well as the old “core X font subsystem”.  The instructions that I had found online installed ProFont into the old font system, but not into the new one.  I also tried using the GUI font configuration tool provided by KDE, but it did nothing.

After much searching and frustration, I discovered that Ubuntu and its variants have fontconfig configured to not use bitmap fonts by default.  ProFont is a bitmap font, and such fonts are usually used by old X applications that use the old font system.  The reason for this configuration is that a lot of the bitmap fonts have the same name as other fonts on your system, and if they’re enabled they may in some instances end up being used instead of the typically better-looking vector fonts that you usually see.

In order to get ProFont working, you’ll need to add an exception to your fontconfig configuration.  I suggest editing the ~/.fonts.conf file, which contains user-specific options.  Here’s mine, with the part that I added in bold:

<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="font" >
  <edit mode="assign" name="rgba" >
   <const>none</const>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="hinting" >
   <bool>true</bool>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="hintstyle" >
   <const>hintfull</const>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="antialias" >
   <bool>true</bool>
  </edit>
 </match>
 <selectfont>
  <acceptfont>
   <pattern>
    <patelt name="family"><string>ProFont</string></patelt>
   </pattern>
  </acceptfont>
 </selectfont>
</fontconfig>

If ~/.fonts.conf doesn’t exist, just create it with your a text editor and copy the following into it:

<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <selectfont>
  <acceptfont>
   <pattern>
    <patelt name="family"><string>ProFont</string></patelt>
   </pattern>
  </acceptfont>
 </selectfont>
</fontconfig>

Once that’s done, download ProFont for Linux from Tobias Jung’s ProFont page, extract the tarball, and copy the .pcf files inside into your ~/.fonts/ directory (create it first if it doesn’t exist).  On the command line, run:

fc-cache -fv

This will force fontconfig to rebuild the font cache, and load ProFont in the process.  Now restart any running apps that you want to use ProFont in, and you should be good to go.

Tags: , ,

4 Responses to “How to get ProFont working in Ubuntu”

  1. Ah! Thank you /so/ freakin’ much for this! After about an hour of trying to get ProFont working with debian, I stumbled across this, which worked perfectly!

  2. parab0l says:

    Works like a charm, thanks a lot for your howto!

  3. Athunye says:

    Wonderful! Thank you for spending your time writing this helpful how to. May the force be with you. Always!

  4. Claudio says:

    Works flawlessly on Xubuntu 10.04
    Thank you very much

Leave a Reply

You must be logged in to post a comment.