Go to main content

Oracle® Solaris 11.3 Desktop Administrator's Guide

Exit Print View

Updated: March 2018
 
 

Legacy X11 Font System

Some applications still use the original X Window System font mechanisms. They allow less styling choices, have a more complex font naming scheme, and do not include anti-aliasing or LCD font smoothing. For more information about the X11 font naming scheme, see the X Logical Font Description specification. Some of the X11 font commands include:

  • xlsfonts – Provides a list of all fonts known to the system

  • xfontsel – Provides a simple font selection application for the fonts known to the system

You can specify specific styles and sizes by using fields in the X Logical Font Description (XLFD) name. For example, to start an xterm using the bold variant of the DejaVu Mono font at a 12–point size, you would type the following command:

$ xterm -fn '-misc-dejavu sans mono-bold-r-normal--12-120-72-72-m-*-iso10646-1'

To install fonts by using the legacy X11 font system, you must create metadata files with the mkfontdir or mkfontscale commands and add the directory to the X server font path with the xset command. The font path changes made with the xset command are reset to the default setting for every new session.


Note - Font paths can be permanently added to the default X11 font path for all sessions by adding links to the font directories in the /etc/X11/fontpath.d file. For more information, see the FONTS and FONTPATH.D sections in the Xorg(1) man page.

Because the /etc/X11/fontpath.d directories are included in the default fonts.conf files in the Oracle Solaris OS, fonts added in this way are automatically available to the applications by using the fontconfig library.


For more information about the legacy X11 font system and installing the bitmap and scalable fonts, see https://www.x.org/releases/X11R7.6/doc/xorg-docs/fonts/fonts.html.

How to Install Bitmap Fonts by Using the Legacy X11 Font System

When installing fonts, you first need to create a font directory that contains all the relevant font files as well as some index files. You then need to inform the X server of the existence of this new directory by including it in the font path.

  1. (Optional)Convert BDF format font files to the PCF format.

    Although bitmap fonts are normally distributed in the BDF format, the binary PCF format is more efficient.

    1. Use the bftopcf command to convert BDF format files.

      For example, to convert a courier12.bdf file, you would type:

      $ bdftopcf courier12.bdf
    2. Compress the resulting PCF format files.

      For example:

      $ gzip courier12.pdf
  2. Copy all font files that you want to make available into a directory.

    For example, to use the /usr/local/share/fonts/bitmap/ directory:

    $ mkdir /usr/local/share/fonts/bitmap/
    $ cp *.pcf.gz /usr/local/share/fonts/bitmap/
  3. Create the fonts.dir index file.
    $ mkfontdir /usr/local/share/fonts/bitmap/
  4. Set the font path to let the X server know about the new font directory.
    • To set the font path for the current session only, use the fp option.

      Putting a plus sign (+) before the option adds the directory to the beginning of the font path. Putting it after the option adds the directory to the end of the font path.

      For example:

      $ xset +fp /usr/local/fonts/Type1
      $ xset fp+ /usr/local/fonts/bitmap

      For more information, see the xset man page.

    • To set the font path permanently, specify it in the X server's xorg.conf file.

      The path is computed by appending all the directories mentioned in the FontPath entries of the Files section of the file in the order in which they appear

      For example:

      FontPath "/usr/local/fonts/Type1"
      ...
      FontPath "/usr/local/fonts/bitmap"

    For more information see the xorg.conf man page.