292 lines
12 KiB
HTML
292 lines
12 KiB
HTML
<!--startcut ======================================================= -->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<html>
|
|
<head>
|
|
<META NAME="generator" CONTENT="lgazmail v1.2N.d">
|
|
<TITLE>The Answer Guy 46: Adding Fonts</TITLE>
|
|
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
|
|
LINK="#3366FF" VLINK="#A000A0">
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
|
|
<P> <hr> <P>
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<center>
|
|
<H1><A NAME="answer">
|
|
<img src="../../gx/dennis/qbubble.gif" alt="(?)"
|
|
border="0" align="middle">
|
|
<font color="#B03060">The Answer Guy</font>
|
|
<img src="../../gx/dennis/bbubble.gif" alt="(!)"
|
|
border="0" align="middle">
|
|
</A></H1>
|
|
<BR>
|
|
<H4>By James T. Dennis,
|
|
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
|
|
LinuxCare,
|
|
<A HREF="http://www.linuxcare.com/">http://www.linuxcare.com/</A>
|
|
</H4>
|
|
</center>
|
|
|
|
<p><hr><p>
|
|
<!-- endcut ======================================================= -->
|
|
<!-- begin 12 -->
|
|
<H3 align="left"><img src="../../gx/dennis/qbubble.gif"
|
|
height="50" width="60" alt="(?) " border="0"
|
|
>Adding Fonts</H3>
|
|
|
|
|
|
<p><strong>From Swami Atmarupananda on Wed, 22 Sep 1999
|
|
</strong></p>
|
|
<!-- ::
|
|
Adding Fonts
|
|
~~~~~~~~~~~~
|
|
:: -->
|
|
<P><STRONG>
|
|
I've got a long shelf of linux books, and none of them say anything
|
|
about how to add fonts. They all tell you in great detail what fonts
|
|
are on the system, but not how to add them. I'm using
|
|
<A HREF="http://www.suse.com/">S.u.S.E.</A> 6.1 (shortly
|
|
to upgrade to 6.2), but have used RedHat also (5.2 and 6.0).
|
|
</STRONG></P>
|
|
<P><STRONG>
|
|
I understand that TrueType support is not yet built into the kernel (can
|
|
be used with limited success in Star Office 5.1), but perhaps soon will
|
|
be. But going with the present font support, how can one add fonts?
|
|
</STRONG></P>
|
|
<P><STRONG>
|
|
Thanks.
|
|
<br>Swami Ananda
|
|
</STRONG></P>
|
|
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
I assume you're talking about adding display fonts to your X
|
|
system.
|
|
</BLOCKQUOTE>
|
|
|
|
<p><em>[ It's worth noting that in Linux terms, X is </em>not<em> the kernel.
|
|
The console driver isn't going to support TrueType, although
|
|
it can be convinced to use special raster fonts, and if I
|
|
recall correctly SuSE actually makes it quite easy to set
|
|
those (use YaST). -- Heather ]</em></p>
|
|
|
|
<BLOCKQUOTE>
|
|
I've never added any X fonts to any of my Linux boxes. As
|
|
many of my long time readers know I mostly work with servers
|
|
and text. However, Heather, my lovely wife (and assistant
|
|
LG TAG editor) does use X quite a bit more.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
From what she says you should be able to just add your new
|
|
fonds (BDF or Type 1) into any of one the directories that's
|
|
listed in your XF86Config file's FontPath. Edit the config
|
|
file, look for the "files" section and you should see the
|
|
list of FontPath entries. Alternatively you can put your
|
|
new fonts in a new directory (<TT>/usr/local/X11/fonts</TT>, maybe)
|
|
and add that to your FontPath.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
After that you MUST RUN the '<tt>mkfontdir</tt>' command to generate
|
|
the <TT>.../fonts.dir</TT> files in each of these directories. Read
|
|
the '<tt>mkfontdir</tt>' man page for more details on that.
|
|
</BLOCKQUOTE>
|
|
|
|
<p><em>[ The mkfontdir is really important because the resulting text files
|
|
help tell X how to internally map between a font name you and I
|
|
might consider normal (for example, "fixed"), the file name
|
|
(<tt>6x13.pcf.gz</tt>),
|
|
and the much longer font designator created by X applications
|
|
(ex: "<tt>-misc-fixed-medium-r-normal-*-15-*-75-75-c-90-iso8859-1</tt>").
|
|
It's certainly possible to create the entries yourself, by hand,
|
|
and I generally do, just to improve my understanding. The important
|
|
thing is to look at the files that should already be there. And of
|
|
course, it won't take effect until your font server gets restarted.
|
|
-- Heather ]</em></p>
|
|
|
|
<BLOCKQUOTE>
|
|
Other subsystems have their own font handling.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
For example you can add fonts to the LaTeX (teTeX) system
|
|
using their '<tt>fontimport</tt>' script (read its man pages, the
|
|
teTeX.FAQ, and or browse Thomas Esser's web pages at:
|
|
<A HREF="http://tug.org/teTeX"
|
|
>http://tug.org/teTeX</A>). teTeX is a distribution of the
|
|
TeX/LaTeX typesetting system. LaTeX is a set of TeX macros,
|
|
style sheets and document class definitions and TeX is a
|
|
Donald Knuth's typesetting language: a programming language
|
|
for describing typeset pages (and typeset pages of technical
|
|
information, mathematical formulae in particular).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
There is another text driven typesetting package on a
|
|
typical Linux system called '<tt>roff</tt>' (which is actually
|
|
'<tt>groff</tt>' the GNU '<tt>roff</tt>' suite).
|
|
'<tt>roff</tt>' is short for '<tt>runoff</tt>'
|
|
(apparently an old typesetting term). Your man pages are in
|
|
<tt>*roff</tt> format, and there are pakages like '<tt>tbl</tt>' (table
|
|
typesetter) and '<tt>pic</tt>' (picture typesetting language), and
|
|
'<tt>eqn</tt>' (for equations and formulae). You can add fonts to
|
|
the '<tt>groff</tt>' subsystem using commands like '<tt>afmtodit</tt>' and
|
|
'<tt>tfmtodit</tt>'.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Of course your printing subsystem might have many fonts of
|
|
its own. For example you might be using GhostScript (<tt>gs</tt>) to
|
|
render PostScript into your printer's native page
|
|
description language (PDL). GhostScript allows you to make
|
|
many printers emulate a PostScript printer. This allows you
|
|
to transparently use applications that only know how to
|
|
generate plain text or PostScript (many) without paying for
|
|
a PostScript printer.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Generally you print LaTeX files using '<tt>dvips</tt>' (<tt>.dvi</tt>, or
|
|
"DeVice Independent," is the intermediate or "object"
|
|
file output of TeX and LaTeX), or '<tt>grops</tt>' (the '<tt>groff</tt>' to
|
|
PostScript) tool to print TeX and/or <tt>*roff</tt> files. However,
|
|
there are many utilities (dviware) that can directly
|
|
drive many printers in their own native PDL.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
As for TrueType support. You are correct. The current
|
|
releases of XFree86 don't include support for TrueType.
|
|
However, they do point out a number of alternative solutions
|
|
in their FAQ at <A HREF="http://www.xfree86.org"
|
|
>http://www.xfree86.org</A> (where most people
|
|
with questions about X under Linux should go instead of me!)
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
They mention that they are planning to incorporate TrueType
|
|
support into the next major release (presumably that will be
|
|
4.0). Meanwhile individual programs can implement their own
|
|
TrueType or other independent font support as needed. It's a
|
|
shame for them to do that, as the windowing system should
|
|
provide it in one place rather than having each client do it
|
|
separately. However it can be done.
|
|
</BLOCKQUOTE>
|
|
<p><em>[ On my primary graphics workstation (betelgeuse, our VARstation II)
|
|
I run a copy of <tt>xfs</tt> (the X external font server) that
|
|
understands TrueType as well as the usual run of fonts. Running
|
|
font services externally means canopus, deneb, and if I was really
|
|
crazy antares, can all share all these TTFs that I took the effort
|
|
to set up. It was part of a binary package available for <tt>xfstt</tt>,
|
|
which I found when I read an LG article about some other app trying
|
|
to provide TrueType support.</em></p>
|
|
<p><em> Anyways, with this, I can use TTF's in the GIMP very easily. I now
|
|
have too many fonts to view them effectively in <tt>xfontsel</tt>,
|
|
but I don't care. It is frustrating that Netscape won't properly
|
|
scale TrueType fonts for me, but that appears to be Netscape's
|
|
problem, not mine.
|
|
-- Heather ]</em></p>
|
|
|
|
<BLOCKQUOTE>
|
|
I gather that the GTK canvas has some support for PostScript
|
|
fonts (GTK is the GIMP Toolkit, a set of programming
|
|
libraries originally written for the GIMP, GNU Image
|
|
Manipulation Program, and used as the display technology for
|
|
<A HREF="http://www.gnome.org/">GNOME</A>). Perhaps they'll add
|
|
TrueType to that, and/or to DGS
|
|
(Display GhostScript, part of the GNUStep project) before
|
|
XFree86 4.x ships.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
As you can see, fonts are a complex issue. However, you
|
|
probably were mainly interested in just displaying them, and
|
|
possibly adding printer support. I suspect you aren't using
|
|
LaTeX or '<tt>groff</tt>' typesetting.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
The '<tt>gs</tt>' (GhostScript) installation often gets installed
|
|
with your distribution and just works without much further
|
|
thought. However, I don't know if you can find a <tt>.ttf</tt> to
|
|
<tt>.afm</tt> conversion tool. It would probably need that to
|
|
get printing to work.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Hello! Here's a link:
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE><DL><DT>
|
|
The (preliminary) TrueType HOWTO
|
|
<DD><A HREF="http://www.moisty.org/linux/TrueType-HOWTO.html"
|
|
>http://www.moisty.org/linux/TrueType-HOWTO.html</A>
|
|
</DL></BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Look at questions 3.1 and 3.2!
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Often I don't find the best FAQs in my web searches until
|
|
I've written most of my message for LG. That's because I
|
|
write "off the cuff" and do the research (usually
|
|
in '<tt>lynx</tt>', in another '<tt>screen</tt>' window as I type).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
It looks like newer versions of GhostScript can be compiled
|
|
to support TrueType fonts. I guess that would have been
|
|
in your '<tt>gs</tt>' man pages if you had the new version.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
I've copied Brion Vibber, the author of this (prelimary)
|
|
HOWTO to encourage him to submit that HOWTO to the
|
|
LDP as soon as possible. (Brion, don't worry if it's
|
|
done! It's info we want to see in the LDP tree NOW!).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
I hope all of that helps.
|
|
</BLOCKQUOTE>
|
|
<!-- sig -->
|
|
|
|
<!-- end 12 -->
|
|
<!--startcut ======================================================= -->
|
|
<P> <hr> <P>
|
|
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
|
|
>Copyright ©</a> 1999, James T. Dennis
|
|
<BR>Published in <I>The Linux Gazette</I> Issue 46 October 1999</H5>
|
|
<H6 ALIGN="center">HTML transformation by
|
|
<A HREF="mailto:star@starshine.org">Heather Stern</a> of
|
|
Starshine Technical Services,
|
|
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
|
|
</H6>
|
|
<P> <hr> <P>
|
|
<!-- begin tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::-->
|
|
<TABLE WIDTH="96%"><TR VALIGN="center" ALIGN="center">
|
|
<TD colspan="2" align="left"><A
|
|
HREF="../lg_answer46.html"
|
|
><IMG SRC="../../gx/dennis/answernew.gif"
|
|
ALT="[ Answer Guy Current Index ]"></A></td>
|
|
<TD WIDTH="12%"><A HREF="1.html">1</A></TD>
|
|
<TD WIDTH="12%"><A HREF="2.html">2</A></TD>
|
|
<TD WIDTH="12%"><A HREF="3.html">3</A></TD>
|
|
<TD WIDTH="12%"><A HREF="4.html">5</A></TD>
|
|
<TD WIDTH="12%"><A HREF="5.html">5</A></TD>
|
|
<TD WIDTH="12%"><A HREF="6.html">6</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD WIDTH="12%"><A HREF="7.html">7</A></TD>
|
|
<TD WIDTH="12%"><A HREF="8.html">8</A></TD>
|
|
<TD WIDTH="12%"><A HREF="9.html">9</A></TD>
|
|
<TD WIDTH="12%"><A HREF="10.html">10</A></TD>
|
|
<TD WIDTH="12%"><A HREF="11.html">11</A></TD>
|
|
<TD WIDTH="12%"><A HREF="12.html">12</A></TD>
|
|
<TD align="right" colspan="2"><A
|
|
HREF="../../tag/kb.html"
|
|
><IMG SRC="../../gx/dennis/answertoc.gif"
|
|
ALT="[ Index of Past Answers ]"></A></td>
|
|
</TR></TABLE>
|
|
<!-- end tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::::-->
|
|
<P> <hr> <P>
|
|
<!-- begin lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<A HREF="../index.html"
|
|
><IMG SRC="../../gx/indexnew.gif" ALT="[ Table Of Contents ]"></A>
|
|
<A HREF="/index.html"
|
|
><IMG SRC="../../gx/homenew.gif" ALT="[ Front Page ]"></A>
|
|
<A HREF="../lg_bytes46.html"
|
|
><IMG SRC="../../gx/back2.gif" ALT="[ Previous Section ]"></A>
|
|
<A HREF="../../faq/index.html"
|
|
><IMG SRC="../../gx/dennis/faq.gif"
|
|
ALT="[ Linux Gazette FAQ ]"></A>
|
|
<A HREF="../lg_tips46.html"
|
|
><IMG SRC="../../gx/fwd.gif" ALT="[ Next Section ]"></A>
|
|
<!-- end lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
</BODY></HTML>
|
|
<!--endcut ========================================================= -->
|