|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris 11.1 Desktop Administrator's Guide Oracle Solaris 11.1 Information Library|
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.
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.
This section describes how to add fonts for all users or for an individual user.
Typically, fonts are stored in the /usr/share/fonts/ directory. The fontconfig library updates the list of fonts automatically.
# fc-cache directory-name
The fontconfig library updates the list of fonts automatically.
# fc-cache directory-name
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 http://www.x.org/releases/X11R7.6/doc/xorg-docs/fonts/fonts.html.
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.
Although bitmap fonts are normally distributed in the BDF format, the binary PCF format is more efficient.
For example, to convert a courier12.bdf file, you would type:
$ bdftopcf courier12.bdf
$ gzip courier12.pdf
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/
$ mkfontdir /usr/local/share/fonts/bitmap/
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.
$ xset +fp /usr/local/fonts/Type1 $ xset fp+ /usr/local/fonts/bitmap
For more information, see the xset man page.
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
FontPath "/usr/local/fonts/Type1" ... FontPath "/usr/local/fonts/bitmap"
For more information see the xorg.conf man page.