ACC SHELL

Path : /usr/share/doc/manual/opensuse-manuals_en/manual/
File Upload :
Current File : //usr/share/doc/manual/opensuse-manuals_en/manual/cha.fontconfig.html

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 12. Installing and Configuring Fonts for the Graphical User Interface</title><link rel="stylesheet" href="susebooks.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Documentation"><link rel="up" href="part.reference.administration.html" title="Part III. Administration"><link rel="prev" href="cha.p.html" title="Chapter 11. Printer Operation"><link rel="next" href="cha.util.html" title="Chapter 13. System Monitoring Utilities"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header" border="0" class="bctable"><tr><td width="80%"><div class="breadcrumbs"><p><a href="index.html"> Documentation</a><span class="breadcrumbs-sep"> &gt; </span><a href="book.opensuse.reference.html">Reference</a><span class="breadcrumbs-sep"> &gt; </span><a href="part.reference.administration.html">Administration</a><span class="breadcrumbs-sep"> &gt; </span><strong><a accesskey="p" title="Chapter 11. Printer Operation" href="cha.p.html"><span>&#9664;</span></a>  <a accesskey="n" title="Chapter 13. System Monitoring Utilities" href="cha.util.html"><span>&#9654;</span></a></strong></p></div></td></tr></table></div><div class="chapter" title="Chapter 12. Installing and Configuring Fonts for the Graphical User Interface"><div class="titlepage"><div><div><h2 class="title"><a name="cha.fontconfig"></a>Chapter 12. Installing and Configuring Fonts for the Graphical User Interface<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#cha.fontconfig">¶</a></span></h2></div></div></div><div class="toc"><p><b>Contents</b></p><dl><dt><span class="sect1"><a href="cha.fontconfig.html#sec.fontconfig.x11core">12.1. X11 Core Fonts</a></span></dt><dt><span class="sect1"><a href="cha.fontconfig.html#sec.fontconfig.xft">12.2. Xft</a></span></dt></dl></div><a class="indexterm" name="id452916"></a><a class="indexterm" name="id452924"></a><a class="indexterm" name="id452933"></a><a class="indexterm" name="id452941"></a><a class="indexterm" name="id452950"></a><p>
  The installation of additional fonts in openSUSE® is very easy.
  Simply copy the fonts to any directory located in the X11 font path (see
  <a class="xref" href="cha.fontconfig.html#sec.fontconfig.x11core" title="12.1. X11 Core Fonts">Section 12.1, &#8220;X11 Core Fonts&#8221;</a>). To the enable use of the fonts,
  the installation directory should be a subdirectory of the directories
  configured in <code class="filename">/etc/fonts/fonts.conf</code> (see
  <a class="xref" href="cha.fontconfig.html#sec.fontconfig.xft" title="12.2. Xft">Section 12.2, &#8220;Xft&#8221;</a>) or included into this file with
  <code class="filename">/etc/fonts/suse-font-dirs.conf</code>.
 </p><p>
  The following is an excerpt from
  <code class="filename">/etc/fonts/fonts.conf</code>. This file is the standard
  configuration file that should be appropriate for most configurations. It
  also defines the included directory
  <code class="filename">/etc/fonts/conf.d</code>. In this directory, all files or
  symbolic links starting with a two digit number are loaded by fontconfig.
  For a more detailed explanation of this functionality, have a look at
  <code class="filename">/etc/fonts/conf.d/README</code>.
 </p><pre class="screen">&lt;!-- Font directory list --&gt;
&lt;dir&gt;/usr/share/fonts&lt;/dir&gt;
&lt;dir&gt;/usr/X11R6/lib/X11/fonts&lt;/dir&gt; 
&lt;dir&gt;/opt/kde3/share/fonts&lt;/dir&gt;
&lt;dir&gt;/usr/local/share/fonts&lt;/dir&gt;
&lt;dir&gt;~/.fonts&lt;/dir&gt;
</pre><p>
  <code class="filename">/etc/fonts/suse-font-dirs.conf</code> is automatically
  generated to pull in fonts that ship with (mostly third party)
  applications like OpenOffice.org, Java or Adobe Acrobat Reader. A typical
  entry would look like the following:
 </p><pre class="screen">&lt;dir&gt;/usr/lib/Adobe/Reader9/Resource/Font&lt;/dir&gt;
&lt;dir&gt;/usr/lib/Adobe/Reader9/Resource/Font/PFM&lt;/dir&gt;
 </pre><p>
  To install additional fonts systemwide, manually copy the font files to a
  suitable directory (as <code class="systemitem">root</code>),
  such as <code class="filename">/usr/share/fonts/truetype</code>. Alternatively, the
  task can be performed with the KDE font installer in the KDE Personal
  Settings. The result is the same.
 </p><p>
  Instead of copying the actual fonts, you can also create symbolic links.
  For example, you may want to do this if you have licensed fonts on a
  mounted Windows partition and want to use them. Subsequently, run
  <span class="command"><strong>SuSEconfig <code class="option">--module fonts</code></strong></span>.
 </p><p>
  <span class="command"><strong>SuSEconfig <code class="option">--module fonts</code></strong></span> executes the
  script <code class="filename">/usr/sbin/fonts-config</code>, which handles the font
  configuration. For more information on this script, refer to its manual
  page (<span class="command"><strong>man <code class="option">fonts-config</code></strong></span>).
 </p><a class="indexterm" name="id453067"></a><p>
  The procedure is the same for bitmap fonts, TrueType and OpenType fonts,
  and Type 1 (PostScript) fonts. All these font types can be installed into
  any directory known to <code class="literal">fonts-config</code>.
 </p><a class="indexterm" name="id453085"></a><a class="indexterm" name="id453093"></a><p>
  X.Org contains two completely different font systems: the old
  <span class="guimenu">X11 core font system</span> and the newly designed
  <span class="guimenu">Xft and fontconfig</span> system. The following sections
  briefly describe these two systems.
 </p><div class="sect1" title="12.1. X11 Core Fonts"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.fontconfig.x11core"></a>12.1. X11 Core Fonts<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.fontconfig.x11core">¶</a></span></h2></div></div></div><a class="indexterm" name="id453120"></a><a class="indexterm" name="id453128"></a><p>
   Today, the X11 core font system supports not only bitmap fonts but also
   scalable fonts, like Type 1 fonts, TrueType, and OpenType fonts. Scalable
   fonts are only supported without antialiasing and subpixel rendering and
   the loading of large scalable fonts with glyphs for many languages may
   take a long time. Unicode fonts are also supported, but their use may be
   slow and require more memory.
  </p><p>
   The X11 core font system has a few inherent weaknesses. It is outdated
   and can no longer be extended in any meaningful way. Although it must be
   retained for reasons of backward compatibility, the more modern Xft and
   fontconfig system should be used if at all possible.
  </p><p>
   For its operation, the X server needs to know which fonts are available
   and where in the system it can find them. This is handled by a
   <code class="literal">FontPath</code> variable, which contains the path to all
   valid system font directories. In each of these directories, a file named
   <code class="filename">fonts.dir</code> lists the available fonts in this
   directory. The <code class="literal">FontPath</code> is generated by the X server
   at start-up. It searches for a valid <code class="filename">fonts.dir</code> file
   in each of the <code class="literal">FontPath</code> entries in the configuration
   file <code class="filename">/etc/X11/xorg.conf</code>. These entries are found in
   the <code class="literal">Files</code> section. Display the actual
   <code class="literal">FontPath</code> with
   <span class="command"><strong>xset</strong></span> <code class="option">q</code>. This path may also be
   changed at runtime with <span class="command"><strong>xset</strong></span>. To add an additional
   path, use <span class="command"><strong>xset</strong></span> <code class="option">+fp &lt;path&gt;</code>.
   To remove an unwanted path, use <span class="command"><strong>xset</strong></span> <code class="option">-fp
   &lt;path&gt;</code>.
  </p><p>
   If the X server is already active, newly installed fonts in mounted
   directories can be made available with the command
   <span class="command"><strong>xset</strong></span> <code class="option">fp rehash</code>. This command is
   executed by <span class="command"><strong>SuSEconfig</strong></span> <code class="option">--module
   fonts</code>. Because the command <span class="command"><strong>xset</strong></span> needs access
   to the running X server, this only works if
   <span class="command"><strong>SuSEconfig</strong></span> <code class="option">--module fonts</code> is
   started from a shell that has access to the running X server. The easiest
   way to achieve this is to acquire
   <code class="systemitem">root</code> permissions by
   entering <span class="command"><strong>su</strong></span> and the <code class="systemitem">root</code> password.
   <span class="command"><strong>su</strong></span> transfers the access permissions of the user who
   started the X server to the <code class="systemitem">root</code> shell. To check if the fonts were
   installed correctly and are available by way of the X11 core font system,
   use the command <span class="command"><strong>xlsfonts</strong></span> to list all available fonts.
  </p><p>
   By default, openSUSE uses UTF-8 locales. Therefore, Unicode fonts
   should be preferred (font names ending with <code class="literal">iso10646-1</code>
   in <span class="command"><strong>xlsfonts</strong></span> output). All available Unicode fonts can
   be listed with <span class="command"><strong>xlsfonts</strong></span>  <code class="option">|
   grep iso10646-1</code>. Nearly all Unicode fonts available in
   openSUSE contain at least the glyphs needed for European languages
   (formerly encoded as <code class="literal">iso-8859-*</code>).
  </p></div><div class="sect1" title="12.2. Xft"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.fontconfig.xft"></a>12.2. Xft<span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#sec.fontconfig.xft">¶</a></span></h2></div></div></div><a class="indexterm" name="id453317"></a><a class="indexterm" name="id453326"></a><a class="indexterm" name="id453334"></a><p>
   From the outset, the programmers of Xft made sure that scalable fonts
   including antialiasing are well supported. If Xft is used, the fonts are
   rendered by the application using the fonts, not by the X server as in
   the X11 core font system. In this way, the respective application has
   access to the actual font files and full control of how the glyphs are
   rendered. This constitutes the basis for the correct display of text in a
   number of languages. Direct access to the font files is very useful for
   embedding fonts for printing to make sure that the printout looks the
   same as the screen output.
  </p><p>
   In openSUSE, the two desktop environments (KDE and GNOME), Mozilla
   and many other applications already use Xft by default. Xft is already
   used by more applications than the old X11 core font system.
  </p><p>
   Xft uses the fontconfig library for finding fonts and influencing how
   they are rendered. The properties of fontconfig are controlled by the
   global configuration file <code class="filename">/etc/fonts/fonts.conf</code>.
   Special configurations should be added to
   <code class="filename">/etc/fonts/local.conf</code> and the user-specific
   configuration file <code class="filename">~/.fonts.conf</code>. Each of these
   fontconfig configuration files must begin with
  </p><pre class="screen">&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
&lt;fontconfig&gt;</pre><p>
   and end with
  </p><pre class="screen">&lt;/fontconfig&gt;</pre><p>
   To add directories to search for fonts, append lines such as the
   following:
  </p><pre class="screen">&lt;dir&gt;/usr/local/share/fonts/&lt;/dir&gt;</pre><p>
   However, this is usually not necessary. By default, the user-specific
   directory <code class="filename">~/.fonts</code> is already entered in
   <code class="filename">/etc/fonts/fonts.conf</code>. Accordingly, all you need to
   do to install additional fonts is to copy them to
   <code class="filename">~/.fonts</code>.
  </p><p>
   You can also insert rules that influence the appearance of the fonts. For
   example, enter
  </p><pre class="screen">
&lt;match target="font"&gt;
 &lt;edit name="antialias" mode="assign"&gt;
  &lt;bool&gt;false&lt;/bool&gt;
 &lt;/edit&gt;
&lt;/match&gt;</pre><p>
   to disable antialiasing for all fonts or
  </p><pre class="screen">&lt;match target="font"&gt;
 &lt;test name="family"&gt;
  &lt;string&gt;Luxi Mono&lt;/string&gt;
  &lt;string&gt;Luxi Sans&lt;/string&gt;
 &lt;/test&gt;
 &lt;edit name="antialias" mode="assign"&gt;
 &lt;bool&gt;false&lt;/bool&gt;
 &lt;/edit&gt;
&lt;/match&gt;</pre><p>
   to disable antialiasing for specific fonts.
  </p><p>
   By default, most applications use the font names
   <code class="literal">sans-serif</code> (or the equivalent
   <code class="literal">sans</code>), <code class="literal">serif</code>, or
   <code class="literal">monospace</code>. These are not real fonts but only aliases
   that are resolved to a suitable font, depending on the language setting.
  </p><p>
   Users can easily add rules to <code class="filename">~/.fonts.conf</code> to
   resolve these aliases to their favorite fonts:
  </p><pre class="screen">&lt;alias&gt;
 &lt;family&gt;sans-serif&lt;/family&gt;
 &lt;prefer&gt;
  &lt;family&gt;FreeSans&lt;/family&gt;
 &lt;/prefer&gt;
&lt;/alias&gt;
&lt;alias&gt;
 &lt;family&gt;serif&lt;/family&gt;
 &lt;prefer&gt;
  &lt;family&gt;FreeSerif&lt;/family&gt;
 &lt;/prefer&gt;
&lt;/alias&gt;
&lt;alias&gt;
 &lt;family&gt;monospace&lt;/family&gt;
 &lt;prefer&gt;
  &lt;family&gt;FreeMono&lt;/family&gt;
 &lt;/prefer&gt;
&lt;/alias&gt;</pre><p>
   Because nearly all applications use these aliases by default, this
   affects almost the entire system. Thus, you can easily use your favorite
   fonts almost everywhere without having to modify the font settings in the
   individual applications.
  </p><p>
   Use the command <span class="command"><strong>fc-list</strong></span> to find out which fonts are
   installed and available for use. For instance, the command
   <span class="command"><strong>fc-list</strong></span> returns a list of all fonts. To find out which
   of the available scalable fonts (<code class="option">:scalable=true</code>) contain
   all glyphs required for Hebrew (<code class="option">:lang=he</code>), their font
   names (<code class="option">family</code>), their style (<code class="option">style</code>),
   their weight (<code class="option">weight</code>) and the name of the files
   containing the fonts, enter the following command:
  </p><pre class="screen">fc-list ":scalable=true:lang=he" family style weight</pre><p>
   The output of this command could look like the following:
  </p><pre class="screen">
Lucida Sans:style=Demibold:weight=200
DejaVu Sans:style=Bold Oblique:weight=200
Lucida Sans Typewriter:style=Bold:weight=200
DejaVu Sans:style=Oblique:weight=80
Lucida Sans Typewriter:style=Regular:weight=80
DejaVu Sans:style=Book:weight=80
DejaVu Sans:style=Bold:weight=200
Lucida Sans:style=Regular:weight=80</pre><p>
   Important parameters that can be queried with <span class="command"><strong>fc-list</strong></span>:
  </p><div class="table"><a name="tab.x11.fonts.fclist"></a><p class="title"><b>Table 12.1. Parameters of <span class="command">fc-list</span></b><span class="permalink"><a alt="Permalink" title="Copy Permalink" href="#tab.x11.fonts.fclist">¶</a></span></p><div class="table-contents"><table summary="Parameters of fc-list" border="1"><colgroup><col><col></colgroup><thead><tr><th>
       <p>
        Parameter
       </p>
      </th><th>
       <p>
        Meaning and Possible Values
       </p>
      </th></tr></thead><tbody><tr><td>
       <p>
        <code class="option">family</code>
       </p>
      </td><td>
       <p>
        Name of the font family, for example, <code class="literal">FreeSans</code>.
       </p>
      </td></tr><tr><td>
       <p>
        <code class="option">foundry</code>
       </p>
      </td><td>
       <p>
        The manufacturer of the font, for example, <code class="literal">urw</code>.
       </p>
      </td></tr><tr><td>
       <p>
        <code class="option">style</code>
       </p>
      </td><td>
       <p>
        The font style, such as <code class="literal">Medium</code>,
        <code class="literal">Regular</code>, <code class="literal">Bold</code>,
        <code class="literal">Italic</code> or <code class="literal">Heavy</code>.
       </p>
      </td></tr><tr><td>
       <p>
        <code class="option">lang</code>
       </p>
      </td><td>
       <p>
        The language that the font supports, for example,
        <code class="literal">de</code> for German, <code class="literal">ja</code> for
        Japanese, <code class="literal">zh-TW</code> for traditional Chinese or
        <code class="literal">zh-CN</code> for simplified Chinese.
       </p>
      </td></tr><tr><td>
       <p>
        <code class="option">weight</code>
       </p>
      </td><td>
       <p>
        The font weight, such as <code class="literal">80</code> for regular or
        <code class="literal">200</code> for bold.
       </p>
      </td></tr><tr><td>
       <p>
        <code class="option">slant</code>
       </p>
      </td><td>
       <p>
        The slant, usually <code class="literal">0</code> for none and
        <code class="literal">100</code> for italic.
       </p>
      </td></tr><tr><td>
       <p>
        <code class="option">file</code>
       </p>
      </td><td>
       <p>
        The name of the file containing the font.
       </p>
      </td></tr><tr><td>
       <p>
        <code class="option">outline</code>
       </p>
      </td><td>
       <p>
        <code class="literal">true</code> for outline fonts or
        <code class="literal">false</code> for other fonts.
       </p>
      </td></tr><tr><td>
       <p>
        <code class="option">scalable</code>
       </p>
      </td><td>
       <p>
        <code class="literal">true</code> for scalable fonts or
        <code class="literal">false</code> for other fonts.
       </p>
      </td></tr><tr><td>
       <p>
        <code class="option">bitmap</code>
       </p>
      </td><td>
       <p>
        <code class="literal">true</code> for bitmap fonts or <code class="literal">false</code>
        for other fonts.
       </p>
      </td></tr><tr><td>
       <p>
        <code class="option">pixelsize</code>
       </p>
      </td><td>
       <p>
        Font size in pixels. In connection with fc-list, this option only
        makes sense for bitmap fonts.
       </p>
      </td></tr></tbody></table></div></div><br class="table-break"><p>Find more information at <a class="ulink" href="http://fontconfig.org/fontconfig-user.html" target="_top">http://fontconfig.org/fontconfig-user.html</a>.
</p></div></div><div class="navfooter"><table width="100%" summary="Navigation footer" border="0" class="bctable"><tr><td width="80%"><div class="breadcrumbs"><p><a href="index.html"> Documentation</a><span class="breadcrumbs-sep"> &gt; </span><a href="book.opensuse.reference.html">Reference</a><span class="breadcrumbs-sep"> &gt; </span><a href="part.reference.administration.html">Administration</a><span class="breadcrumbs-sep"> &gt; </span><strong><a accesskey="p" title="Chapter 11. Printer Operation" href="cha.p.html"><span>&#9664;</span></a>  <a accesskey="n" title="Chapter 13. System Monitoring Utilities" href="cha.util.html"><span>&#9654;</span></a></strong></p></div></td></tr></table></div></body></html>

ACC SHELL 2018