[f45b1953] | 1 | <sect1 id="x-installing-truetype">
|
---|
| 2 | <?dbhtml filename="truetype.html" dir="x"?>
|
---|
| 3 | <title>Adding TrueType font support to XFree86</title>
|
---|
| 4 |
|
---|
| 5 | <para>
|
---|
| 6 | TrueType font support is now built into XFree86. The following items need to
|
---|
| 7 | be completed to make the fonts available.
|
---|
| 8 | </para>
|
---|
| 9 | <itemizedlist>
|
---|
| 10 |
|
---|
| 11 | <listitem><para>Establish a directory for the fonts and move any TrueType fonts
|
---|
| 12 | you want into that directory.
|
---|
| 13 | </para></listitem>
|
---|
| 14 | <listitem><para>Create the <filename>fonts.scale</filename> and
|
---|
| 15 | <filename>fonts.dir</filename> files in the TrueType font directory.
|
---|
| 16 | </para></listitem>
|
---|
| 17 | <listitem><para>Ensure the truetype module is loaded in
|
---|
| 18 | <filename>XF86Config</filename>.
|
---|
| 19 | </para></listitem>
|
---|
| 20 | <listitem><para>Ensure the <parameter>FontPath</parameter> in
|
---|
| 21 | <filename>XF86Config</filename> contains the TrueType font directory.
|
---|
| 22 | </para></listitem>
|
---|
| 23 | </itemizedlist>
|
---|
| 24 |
|
---|
| 25 | <sect2><title>Establish a TrueType font directory</title>
|
---|
| 26 | <para>The build of XFree86 as given above automatically creates a TrueType
|
---|
| 27 | font directory: <filename>/usr/X11R6/lib/Xll/fonts/TTF</filename>. This
|
---|
| 28 | directory is already has some TrueType fonts and is set up correctly.
|
---|
| 29 | If this directory is satisfactory, copy any other TrueType fonts you want
|
---|
| 30 | into that directory. If not, create a new directory, preferably in
|
---|
| 31 | the <filename>/usr/X11R6/lib/Xll/fonts/</filename> directory and put
|
---|
| 32 | your TrueType fonts there.
|
---|
| 33 | </para></sect2>
|
---|
| 34 |
|
---|
| 35 | <sect2><title>Create <filename>fonts.scale</filename> and
|
---|
| 36 | <filename>fonts.dir</filename></title>
|
---|
| 37 | <para>To make the <filename>fonts.scale</filename> file, you have to build the
|
---|
| 38 | program <filename>ttmkfdir</filename>. Unfortunately, this program needs
|
---|
| 39 | libraries from the <filename>freetype</filename> project, so we need to make
|
---|
| 40 | that first.</para>
|
---|
| 41 |
|
---|
| 42 | <screen>Download location:
|
---|
| 43 | <ulink url="http://prdownloads.sourceforge.net/freetype/freetype-1.3.1.tar.gz"/></screen>
|
---|
| 44 |
|
---|
| 45 | <para>Unpack the file and build with
|
---|
| 46 | <screen>./configure --prefix=/usr &&
|
---|
| 47 | make &&
|
---|
| 48 | make install &&
|
---|
| 49 | ldconfig</screen>
|
---|
| 50 | </para>
|
---|
| 51 |
|
---|
| 52 | <para>
|
---|
| 53 | Now build the <filename>ttmkfdir</filename> utility.
|
---|
| 54 |
|
---|
| 55 | <screen>Download location: <ulink url="http://freshmeat.net/projects/ttmkfdir"/></screen>
|
---|
| 56 | The filename is <filename>ttmkfdir.tar.gz</filename>.
|
---|
| 57 | </para>
|
---|
| 58 |
|
---|
| 59 | <para>
|
---|
| 60 | This is a very short program that unpacks it is files in the current
|
---|
| 61 | directory, so its best to make a separate directory.
|
---|
| 62 | <screen>mkdir ttmkfdir &&
|
---|
| 63 | cd ttmkfdir &&
|
---|
| 64 | tar zxvf ../ttmkfdir.tar.gz</screen>
|
---|
| 65 | </para>
|
---|
| 66 |
|
---|
| 67 | <para>Edit the <filename>Makefile</filename> to make the following changes:
|
---|
| 68 | <screen>FREETYPE_BASE=/usr
|
---|
| 69 | FREETYPE_INCL=$(FREETYPE_BASE)/include/freetype
|
---|
| 70 | FREETYPE_LIB=-L$(FREETYPE_BASE)/lib -lttf</screen>
|
---|
| 71 | </para>
|
---|
| 72 |
|
---|
| 73 | <para>Run
|
---|
| 74 | <screen>make &&
|
---|
| 75 | install -m755 ttmkfdir /usr/bin</screen>
|
---|
| 76 | </para>
|
---|
| 77 |
|
---|
| 78 | <para>Now change to the directory where you have your TrueType fonts and run
|
---|
| 79 | <screen>ttmkfdir -o fonts.scale &&
|
---|
| 80 | mkfontdir</screen></para>
|
---|
| 81 | </sect2>
|
---|
| 82 |
|
---|
| 83 | <sect2><title>Ensure TrueType is loaded in <filename>XF86Config</filename>
|
---|
| 84 | </title>
|
---|
| 85 | <para>The "Module" section should look like:
|
---|
| 86 | <screen>Section "Module"
|
---|
| 87 | ...
|
---|
| 88 | Load "freetype"
|
---|
| 89 | Load "speedo"
|
---|
| 90 | EndSection</screen>
|
---|
| 91 | </para></sect2>
|
---|
| 92 |
|
---|
| 93 | <sect2><title>Ensure the <parameter>FontPath</parameter> in
|
---|
| 94 | <filename>XF86Config</filename> points to the TrueType font directory</title>
|
---|
| 95 | <para>The "Files"section should look like
|
---|
| 96 | <screen>Section "Files"
|
---|
| 97 | ...
|
---|
| 98 | FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
|
---|
| 99 | EndSection</screen>
|
---|
| 100 | </para>
|
---|
| 101 |
|
---|
| 102 | <para>XFree86 will now be able to use TrueType fonts when it is restarted.
|
---|
| 103 | You can check to see if the new fonts are available with the
|
---|
| 104 | <userinput>xlsfonts</userinput> program.
|
---|
| 105 | </para>
|
---|
| 106 | </sect2>
|
---|
| 107 |
|
---|
| 108 | </sect1>
|
---|
| 109 |
|
---|