CAPS Universe documentation  1.0.4
All you need to know to be successful
Font Setup

Many document creators assume the fonts they're use are always present on any other system, too and thus, do not embed these fonts in their document (or they haven't the permission to do so due to copyright issues).

For this use case some standard fonts should be present on the system. At least to enable the rasterizer to have some font replacements available to be able to print something.

While on a usual host system most of the time more fonts are installed than ever used, on an embedded system there might be no font file at all. In this case some documents will just print empty pages.

Just run the fc-list command for an impression, what fonts are installed on your host system:

 $ fc-list
/usr/share/fonts/truetype/NimbusSanL-RegIta.otf: Nimbus Sans L,NimbusSanL:style=Regular Italic,Italic
/usr/share/fonts/truetype/NimbusRomNo9L-MedIta.otf: Nimbus Roman No9 L,NimbusRomNo9L:style=Bold Italic
/usr/share/fonts/truetype/NimbusMono-Bold.otf: Nimbus Mono:style=Bold
/usr/share/fonts/truetype/NimbusMono-Regular.otf: Nimbus Mono:style=Regular
/usr/share/fonts/truetype/NimbusRomNo9L-RegIta.otf: Nimbus Roman No9 L,NimbusRomNo9L:style=Regular Italic,Italic
/usr/share/fonts/truetype/NimbusRomNo9L-Reg.otf: Nimbus Roman No9 L,NimbusRomNo9L:style=Regular
/usr/share/fonts/truetype/NimbusSanL-BolIta.otf: Nimbus Sans L,NimbusSanL:style=Bold Italic
/usr/share/fonts/Type1/usyr.pfb: Standard Symbols L:style=Regular
/usr/share/fonts/truetype/NimbusMono-Oblique.otf: Nimbus Mono:style=Regular Oblique,Italic
/usr/share/fonts/truetype/NimbusSanL-Bol.otf: Nimbus Sans L,NimbusSanL:style=Bold
/usr/share/fonts/truetype/NimbusMono-BoldOblique.otf: Nimbus Mono:style=Bold Oblique,Bold Italic
/usr/share/fonts/truetype/NimbusSanL-Reg.otf: Nimbus Sans L,NimbusSanL:style=Regular
/usr/share/fonts/truetype/NimbusRomNo9L-Med.otf: Nimbus Roman No9 L,NimbusRomNo9L:style=Bold
/usr/share/fonts/Type1/uzdr.pfb: Dingbats:style=Regular

If the reported font list by this command is empty, you need to install some font files. At least the following mandatory fonts (or their equivalent):

  • Helvetica (sans serife)
  • Times (serife)
  • Courier New (monospace)
  • ZapfDingbats
  • Symbols

    If you have the default PostScript font files around you are in luck. But most users don't and they need some replacements. The replacements could be very compatible, but mostly the printed result looks a little bit different than with the original fonts. And it depends how close a "little bit different" is compared with the original font.

With the help of fontconfig you can define a mapping from the original PostScript font to its replacement on your system.

A few examples:

A font close to the default Helvetica is Nimbus Sans L. To force this font to be used if the documents calls for Helvetica, add the following rule to the fontconfig configuration directory:

 <alias binding="same">
   <family>Helvetica</family>
   <accept>
      <family>Nimbus Sans L</family>
   </accept>
 </alias>

A font close to Times New Roman is Nimbus Roman No9 L. The following rule forces it:

 <alias binding="same">
   <family>Times</family>
   <accept>
      <family>Nimbus Roman No9 L</family>
   </accept>
 </alias>

And for Courier New a close replacement is Nimbus Mono:

 <alias binding="same">
    <family>Courier New</family>
    <accept>
       <family>Nimbus Mono</family>
    </accept>
 </alias>

After having these rules in place (usually in /etc/fonts/conf.d), running the following commands show if they work as expected:

 $ fc-match Helvetica
 NimbusSanL-Reg.otf: "Nimbus Sans L" "Regular"
 $ fc-match Times
 NimbusRomNo9L-Reg.otf: "Nimbus Roman No9 L" "Regular"
 $ fc-match "Courier New"
 NimbusMono-Regular.otf: "Nimbus Mono" "Regular"

If the rasterizer queries for the original PostScript fonts, it will use your defined replacements instead.