Added a section about using TrueType fonts in XFree86.

This commit is contained in:
Murray Stokely 2000-10-25 03:02:20 +00:00
parent a3a093bfb4
commit d412de32ca
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=8191
2 changed files with 152 additions and 8 deletions

View file

@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
$FreeBSD: doc/en_US.ISO_8859-1/books/handbook/x11/chapter.sgml,v 1.11 2000/06/08 01:56:23 jim Exp $
$FreeBSD: doc/en_US.ISO_8859-1/books/handbook/x11/chapter.sgml,v 1.12 2000/06/14 20:30:40 jim Exp $
-->
<chapter id="x11">
@ -10,9 +10,9 @@
<para><emphasis>This chapter has been graciously donated by &a.grog;
from his book, <ulink
url="http://www.cdrom.com/titles/freebsd/bsdcomp_bkx.phtml">The
Complete FreeBSD</ulink>, and remains copyright of
him. Modifications for the handbook made by
&a.jim;.</emphasis></para>
Complete FreeBSD</ulink>, and remains copyright of him.
Modifications for the handbook made by &a.jim;. The section on
fonts in XFree86 was contributed by &a.murray;.</emphasis></para>
<sect1>
<title>Synopsis</title>
@ -1314,6 +1314,78 @@ For further configuration, refer to /usr/X11R6/lib/X11/doc/README.Config.</scree
</sect3>
</sect2>
</sect1>
<sect1 id="x-fonts">
<title>Using Fonts in XFree86</title>
<sect2 id="truetype">
<title>TrueType Fonts</title>
<para>The default fonts that ship with
<application>XFree86</application> are less than ideal for typical
desktop publishing applications. Large presentation fonts show up
jagged and unprofessional looking and small fonts in Netscape are
almost completely unintelligable. Fortunately,
<application>XFree86</application> can be configured to use
TrueType fonts with a minimum of effort.</para>
<para><application>XFree86</application> 4.0 has built in support
for rendering TrueType fonts. There are two different modules
that can enable this functionality. The "freetype" module is used
in this example because it is more consistent with the other font
rendering backends. To enable the freetype module just add the
following line to the module section of your
<filename>/etc/X11/XF86Config</filename> file.
<screen>
Load "freetype"
</screen>
</para>
<para>For <application>XFree86</application> 3.3.X you will need
to run a seperate TrueType font
server. <application>Xfstt</application> is commonly used for this
purpose. To install <application>Xfstt</application> on your
FreeBSD system simply install the port from
<filename>/usr/ports/x11-servers/Xfstt</filename></para>
<para>You should now make a directory for your TrueType fonts
(e.g. <filename>/usr/X11R6/lib/X11/fonts/TrueType</filename>) and
copy all of your TrueType fonts into this directory. Keep in mind
that you can not take TrueType fonts directly from a Macintosh;
they must be in Unix/DOS/Windows format for use by
<application>XFree86</application>. Once you have copied the files
into this directory you need to use
<application>ttmkfdir</application> to create a
<filename>fonts.dir</filename> file so that the X font renderer
knows that you've installed these new files. There is a FreeBSD
port for <application>ttmkfdir</application> in
<filename>/usr/ports/x11-fonts/ttmkfdir</filename>.</para>
<screen>
&prompt.root; <userinput>cd /usr/X11R6/lib/X11/fonts/TrueType</userinput>
&prompt.root; <userinput>ttmkfdir > fonts.dir</userinput>
</screen>
<para>Now you need to add your TrueType directory to your fonts
path. The easiest way to do this is to add the following entries
into your <filename>~/.xinitrc</filename> file.</para>
<screen>
&prompt.user; <userinput>xset fp+ /usr/X11R6/lib/X11/fonts/TrueType</userinput>
&prompt.user; <userinput>xset fp rehash</userinput>
</screen>
<para>That's it. Now Netscape, Gimp, StarOffice, and all of your
other X applications should now recognize your installed TrueType
fonts. Extremely small fonts (as with text in a high resolution
display on a web page) and extremely large fonts (within
StarOffice) will look much better now.</para>
<para>One Caveat : XFree86 does not currently support anti-aliased
font rendering. This is less of an issue at higher screen resolutions
but the output is still less than optimal when compared with MacOS or
Microsoft Windows.</para>
</sect2>
</sect1>
</chapter>
<!--

View file

@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
$FreeBSD: doc/en_US.ISO_8859-1/books/handbook/x11/chapter.sgml,v 1.11 2000/06/08 01:56:23 jim Exp $
$FreeBSD: doc/en_US.ISO_8859-1/books/handbook/x11/chapter.sgml,v 1.12 2000/06/14 20:30:40 jim Exp $
-->
<chapter id="x11">
@ -10,9 +10,9 @@
<para><emphasis>This chapter has been graciously donated by &a.grog;
from his book, <ulink
url="http://www.cdrom.com/titles/freebsd/bsdcomp_bkx.phtml">The
Complete FreeBSD</ulink>, and remains copyright of
him. Modifications for the handbook made by
&a.jim;.</emphasis></para>
Complete FreeBSD</ulink>, and remains copyright of him.
Modifications for the handbook made by &a.jim;. The section on
fonts in XFree86 was contributed by &a.murray;.</emphasis></para>
<sect1>
<title>Synopsis</title>
@ -1314,6 +1314,78 @@ For further configuration, refer to /usr/X11R6/lib/X11/doc/README.Config.</scree
</sect3>
</sect2>
</sect1>
<sect1 id="x-fonts">
<title>Using Fonts in XFree86</title>
<sect2 id="truetype">
<title>TrueType Fonts</title>
<para>The default fonts that ship with
<application>XFree86</application> are less than ideal for typical
desktop publishing applications. Large presentation fonts show up
jagged and unprofessional looking and small fonts in Netscape are
almost completely unintelligable. Fortunately,
<application>XFree86</application> can be configured to use
TrueType fonts with a minimum of effort.</para>
<para><application>XFree86</application> 4.0 has built in support
for rendering TrueType fonts. There are two different modules
that can enable this functionality. The "freetype" module is used
in this example because it is more consistent with the other font
rendering backends. To enable the freetype module just add the
following line to the module section of your
<filename>/etc/X11/XF86Config</filename> file.
<screen>
Load "freetype"
</screen>
</para>
<para>For <application>XFree86</application> 3.3.X you will need
to run a seperate TrueType font
server. <application>Xfstt</application> is commonly used for this
purpose. To install <application>Xfstt</application> on your
FreeBSD system simply install the port from
<filename>/usr/ports/x11-servers/Xfstt</filename></para>
<para>You should now make a directory for your TrueType fonts
(e.g. <filename>/usr/X11R6/lib/X11/fonts/TrueType</filename>) and
copy all of your TrueType fonts into this directory. Keep in mind
that you can not take TrueType fonts directly from a Macintosh;
they must be in Unix/DOS/Windows format for use by
<application>XFree86</application>. Once you have copied the files
into this directory you need to use
<application>ttmkfdir</application> to create a
<filename>fonts.dir</filename> file so that the X font renderer
knows that you've installed these new files. There is a FreeBSD
port for <application>ttmkfdir</application> in
<filename>/usr/ports/x11-fonts/ttmkfdir</filename>.</para>
<screen>
&prompt.root; <userinput>cd /usr/X11R6/lib/X11/fonts/TrueType</userinput>
&prompt.root; <userinput>ttmkfdir > fonts.dir</userinput>
</screen>
<para>Now you need to add your TrueType directory to your fonts
path. The easiest way to do this is to add the following entries
into your <filename>~/.xinitrc</filename> file.</para>
<screen>
&prompt.user; <userinput>xset fp+ /usr/X11R6/lib/X11/fonts/TrueType</userinput>
&prompt.user; <userinput>xset fp rehash</userinput>
</screen>
<para>That's it. Now Netscape, Gimp, StarOffice, and all of your
other X applications should now recognize your installed TrueType
fonts. Extremely small fonts (as with text in a high resolution
display on a web page) and extremely large fonts (within
StarOffice) will look much better now.</para>
<para>One Caveat : XFree86 does not currently support anti-aliased
font rendering. This is less of an issue at higher screen resolutions
but the output is still less than optimal when compared with MacOS or
Microsoft Windows.</para>
</sect2>
</sect1>
</chapter>
<!--