JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 11.1 Desktop Administrator's Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Administering the Oracle Solaris Desktop

2.  Managing User Preferences With GConf

3.  Customizing Menus

4.  Installing Themes

5.  Customizing Fonts

Fonts Overview

fontconfig Library

Adding Fonts

How to Add a Font for All Users

How to Add a Font for an Individual User

Legacy X11 Font System

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

Substituting Fonts

6.  Working With MIME Types

7.  Managing Screensavers

8.  Managing Sessions

9.  Overview of the Yelp Help Browser

10.  Improving the Performance of the Oracle Solaris Desktop System

11.  Disabling Features in the Oracle Solaris Desktop System

12.  Working With the X Window System

A.  Hidden Directories

Glossary

Index

Fonts Overview

This section describes the fontconfig library and explains how to add fonts to it. It also describes the legacy X11 font system and how to use it to add bitmap fonts.

fontconfig Library

The Oracle Solaris Desktop uses the fontconfig configuration and customization library. The fontconfig library can use all types of fonts, including PostScript Type 1 fonts and TrueType fonts.

Many applications in the Oracle Solaris Desktop, including those that are part of the GNOME Desktop Environment, use the fontconfig system for finding fonts. The fontconfig library provides a list of all the fonts available on the Oracle Solaris Desktop. To compile this list, fontconfig searches the directories listed in the /etc/fonts/fonts.conf file.

Installing fonts to be accessed by the fontconfig library is as simple as copying them to the $HOME/.fonts subdirectory. Fonts accessed through this library are addressed with simple names such as DejaVu Sans or Liberation Mono.

The fc-list command provides a list of all fonts known to this library. You can specify specific sizes or styles by using the patterns described in the fonts.conf(4) man page. 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 -fa "DejaVu Mono-12:style=Bold"

For more information about the fontconfig library, see http://freedesktop.org/software/fontconfig.

For information about adjusting font configuration, see Adjusting Font Configuration in International Language Environments Guide for Oracle Solaris 11.1.

Adding Fonts

This section describes how to add fonts for all users or for an individual user.

How to Add a Font for All Users

  1. Copy the font file to one of the directories in the /etc/fonts/fonts.conf file.

    Typically, fonts are stored in the /usr/share/fonts/ directory. The fontconfig library updates the list of fonts automatically.

  2. If the list of fonts is not updated, type the following command:
    # fc-cache directory-name

How to Add a Font for an Individual User

  1. Copy the font file to the $HOME/.fonts directory of the user.

    The fontconfig library updates the list of fonts automatically.

  2. If the list of fonts is not updated, type the following command:
    # fc-cache directory-name

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:

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 http://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.