Skip to main content

How Do I Install Fonts in Linux?

The fonts used by a template on the machine where the template was created must also be installed on the machine where an Engine is used to generate output from that template. This is generally not an issue when the template-creation server and the Engine server both run Windows. But this can be problematic when the template-creation server and the Engine server run different operating systems, such as Linux.

The Importance of Matching Fonts and Font Substitution

There is a significant difference between the measurements (font metrics) of different fonts; e.g. Courier, Arial, and Trebuchet.

Windward Studios Report Engines use font metrics to determine how tall each line of text is, where to put in soft line breaks, where to put in soft page breaks, etc., when generating output from a report template. Otherwise, if the Report Engines always used an arbitrary font such as Arial when calculating the output layout, but the actual font used in the report template is Courier, then the Report Engine output will have too much text on each line with letters overlapping.

In addition, the person designing the report template expects the generated output to look a certain way. Like Word, the Report Engines automatically perform font substitution if a font used in the report template isn't present on the server where the Report Engine is installed. For example, if the Report Engine output needs to use Lucida Sans, but that font hasn't been installed on the Report Engine server, the Report Engine may instead substitute Times New Roman, which can create a very different look as well as disturb the layout due to the size of the text.

TrueType vs OpenType Fonts

Windward Studios products don't distinguish between TrueType and OpenType fonts; instead, fonts and font metrics are determined by the font's name. However, even when having the same name, fonts from different vendors or intended for different operating systems can have subtle differences. When picking fonts to use on your Report Designer and Report Engine machines, it is best practice to choose fonts from the same vendor, and intended for the target operating system.

Installing Fonts on Your Server

For Windows

  • Type fonts in the Cortana search bar
  • Click on Fonts Control Panel, which brings up the Font Viewer
  • Drag and drop the font file into the Font Viewer

For Linux

Here are installation instructions for some popular Linux distributions.

Red Hat

ref: Customer Portal Chapter 6. Fonts

For one user:

  • Double-click the Computer icon on your desktop.
  • In the File menu, choose Open Location...
  • Type in: fonts://
  • When the fonts window appears, drag and drop the fonts to be installed into this window.

For all users:

  • Login as root.

  • Create a directory in /usr/share/fonts/

    • For example: /usr/share/fonts/custom
  • Copy the fonts to this directory and run:

    • fc-cache -f /usr/share/fonts/

SuSE

KDE Desktop:

Use the Control Center -> System Administration -> Font Installer utility

GNOME Desktop:

To install for only one user:

  • Simply place the font files into the ~/.fonts directory.
  • Note that this directory is hidden. Use the command ls -a in the terminal to display it.
  • Log out and log back in.

To install for all users:

  • Log in as root.
  • Place the fonts into the /usr/local/share/fonts directory.
  • Log out and log back in.

Ubuntu

ref: Ubuntu Wiki Fonts

Via Synaptic:

  • Enable the Universe and Multiverse repositories (see Adding Repositories).
  • Once these are enabled, search for font in Synaptic and install any desired fonts.
  • You may need to restart applications, and log out then log back in for the new fonts to be recognized.

Manually:

  • Create a new folder in /usr/local/share/fonts
  • Place your font files into this new directory.
  • Rebuild the font cache by entering at a terminal: sudo fc-cache -f -v

CentOS

ref: CentOS Fonts

To install for only one user:

  • Simply place the font files into the ~/.fonts folder
  • Note that this folder is hidden. Use the command ls -a in the terminal to display it.
  • At a terminal execute the command: fc-cache -c -v

To install for all users:

  • Log in as root.
  • Create a directory in the /usr/local/fonts.
  • Place the fonts into the directory you just created.
  • At a terminal execute the command: fc-cache -c -v