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