Debian demystified: installing bitmap fonts

Jan 20, 2019, by Hugo Lefeuvre.

Bitmap fonts are special. "a bitmap font stores each glyph as an array of pixels", in opposition to vector fonts which "are collections of vector images defining the boundary of glyphs"ยน.

Bitmap fonts are fast and simple to render. They are very appropriate where the font needs to be fine-tuned to display clearly (terminal emulators, among others). On the other hand, they tend to render very poorly when scaled or transformed in any way. This is why bitmap fonts are disabled by default in recent Debian systems: most users just don't want them.

That being said, some bitmap fonts are still used for specific purposes like terminal fonts (for example terminus). Since bitmap fonts are disabled globally these fonts have to define exception rules in order to be available on the system.

tl;dr

Manually installing a bitmap font on your Debian system ? You have to either enable bitmap fonts globally or define an exception rule.

Enabling bitmap fonts globally

I do not recommend to enable bitmap fonts globally because unexpected things might happen (like a bitmap Helvetica font being chosen over vector ones on some web pages, screwing up GitHub and dozens of other websites).

If you still want to go for it, it's very simple:

$ dpkg-reconfigure fontconfig-config

with root permissions.

Creating a new exception rule

Not much harder: create new /etc/fonts/conf.avail/50-enable-YOUR_FONT.conf with following content:

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

and enable the rule with

$ ln -s /etc/fonts/conf.avail/50-enable-YOUR_FONT.conf /etc/fonts/conf.d/50-enable-YOUR_FONT.conf

Example

siji font:

$ cat /etc/fonts/conf.avail/50-enable-siji.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <selectfont>
    <acceptfont>
      <pattern>
        <patelt name="family"><string>siji</string></patelt>
      </pattern>
    </acceptfont>
  </selectfont>
</fontconfig>

Sources, further reading