The following was taken from an excellent Linux newbie document at http://home.powertech.no/rkaa/linux.html#ttf or mirrored locally at newbietips1.html
TrueType fonts
Alternative 1
RedHat6 has support for displaying TrueType fonts. It won't automatically let you print with truetype fonts but things sure look better. xfsft - a truetype fontserver - is made a part of xfs, the x fontserver. In order to make this work you should install the Freetype library and ghostscript rpm from the install CD. To install a rpm package you must be user root. Logged in as a common user: just write su in a terminal window, provide root's password, write gnorpm & and a graphical rpm administration program starts. Mount the CD-rom, click "add", find freetype and ghostscript and install. So far, so good.
Quirk 1: Font-names must be in lowercase and contain no spaces. If you already have tt-fonts on a partition containing Windows, a quick way to copy them all in lowercase is to mount the partition as a DOS filesystem instead of fat32. This way they'll all seem to be lowercase without spaces, whatever they might look like on a fat32 partition. Afterwards you can change partition type back to whatever is relevant. The file that needs modyfying if you want to do this is /etc/fstab. Unmount first - change filesystem - remount and the files will be 8.3 type DOS files se seen from Linux. If you don't feel comfortable with editing this file by hand, use linuxconf to unmount. change filesystem, and remount. That way you don't risk typos.
Quirk 2: Fonts can be more or less broken, and not so "true" to their type as the name indicate. Below is a reference to a little program you shall run: "ttmkfdir". We testrun this first and watch the output, to see if some fonts look completely crappy. You'll know when that happens IF it happens - it looks pretty wild. Delete offending fonts and try again. If you think it ALL looks wild, it's probably OK. If unsure, compare with an existing file called fonts.dir in /usr/X11R6/lib/X11/fonts/misc
Here the suggested approach to get TT fonts up and running. Commands are done as user root. What you write is annotated in bold fonts. Open a console window, su root, then:
cd /usr/X11R6/lib/X11/fonts
ls -la
If a directory
called TrueType is not there - make it with
mkdir
TrueType
then
cd TrueType
Now copy your
truetype fonts to the new directory
cp /dir/with/ttfonts/*.*
.
(the last dot is a
pointer to "current directory" - here applied as your
target directory)
When that is done (still
in the TrueType directory) we do the mentioned testrun of
ttmkfdir, to see that the font descriptions we store afterwards
is set up ok in the long unix-wise manner. If one or more fonts
seem to vary wildly from the other descriptions there's something
crappy with the internal font description of that font. Delete it
(rm somefont.ttf) and try again - till the output seems
reasonable uniform. The line-lengths can vary but should contain
the same "elements".
/usr/sbin/ttmkfkfdir
If the output seem
to follow the same type of pattern for all fonts we proceed:
/usr/sbin/ttmkfdir
fonts.scale
/usr/X11R6/bin/mkfontdir
/usr/sbin/chkfontpath
--add /usr/X11R6/lib/X11/fonts/TrueType
(Remember Linux "fill out" paths/filenames for you when you hit the tab, once you've written enough to make it unique. You don't HAVE to type your fingers off.)
Your fonts should now be
readable in X . Check it with "xlsfonts". If you later
add or remove fonts in the truetype font directories you must
make a new fonts.scale and fonts.dir file there. (It's only fonts
of variable width, like truetype fonts, that you have to make a
fonts.scale file before you make the fonts.dir). Then you remove
and add the fontpath again, to make xfs restart with the new
information:
chkfontpath
--remove /usr/X11R6/lib/X11/fonts/TrueType
chkfontpath
--add /usr/X11R6/lib/X11/fonts/TrueType
OR you can restart it
the "old" way: /etc/rc.d/init.d/xfs restart
Many TT fonts don't
contain a full character set. ttmkfdir by default only tolerate
max 5 missing characters. This you can easily change. "ttmkfdir
--help" to see options.
ttmkfdir -m
100 -o fonts.scale tells ttmkfdir to tolerate up to 100
missing characters in a font, and write the output to fonts.scale.
This is useful if you know a font to be very limited - often the
case with various decorative fonts.
NOTE: RH6 version
of xfs now listen to a different port than earlier (now set to -1)
If you've upgraded from an earlier version of RedHat: Edit
/etc/X11/XF86Config and replace all references to fontpaths with:
FontPath ``tcp/localhost:7100''
You must also make
sure that xfs runs and is started at boot time - to ensure that
write:
/sbin/chkconfig --add xfs
Those with fresh
installs do not have to bother about this point.
Alternative 2
xfstt is another truetype fontdisplay server for X and doesn't require any additional libraries. It's easy to set up and can use the fonts right from your windows-disk, if you have fonts there.
In the Makefile for
xfstt a default path to your windows fonts is given. Modify the
relevant line to reflect where your Windows disk is mounted, if
you want to use the fonts located there. (they're in /whatevermount/windows/fonts)
Then "make" and (as root) "make install".
Then - as whoever you want to - from the commandline run:
xfstt --synch &
Now WAIT... some 4
seconds BEFORE starting X, so xfstt gets time to unwind :)
After X is started -
with startx or what you use - you must set a fontpath that xfstt
will find fonts at. xfstt doesn't cooperate with the native xfs
fontserver. Write:
xset fp+ unix/:7101
This tells X that
there's an additional fp = fontpath found at that port. Since
xfstt runs independently of xfs, the command "chkfontpath"
does not affect it.
NOTE: It is only
the very first time you start xfstt you need the --synch
parameter. This creates a database of the installed fonts.
Synchronizing is only required when xfstt needs to know about
added or removed fonts.
| Fuzzy small fonts on web |
Some webpages use tiny fonts, unreadable in Netcape unless we tune for them. A "font deuglification" page is out there, but I found the suggested fix of perm "swapping" the 100 and 75 dpi fonts result in too big fonts in menus and elsewhere. Instead: Here is THE fix for those with the truetype font Arial installed:
This fix assumes RH6*
xfs (or xfsft) correct set up and working already. Furthermore TT
fonts in /usr/X11R6/lib/X11/fonts/TrueType and ISO8859-1
character set. (All easily adjustable to other dir's / character
sets.)
If you haven't got a
file there called fonts.alias: make it (must be saved as user
root). Use the contents below. This will give you size 14 as an
option under preferences/fonts in Netscape. After the file is
created, to rehash xfs you can write
/usr/sbin/chkfontpath
--remove /usr/X11R6/lib/X11/fonts/TrueType
/usr/sbin/chkfontpath
--add /usr/X11R6/lib/X11/fonts/TrueType
Make a typo and xfs will fail - and X won't start. If that happens, check your fonts.alias file for typos. The error is guaranteed your own. If it still doesn't work you have to rename or delete fonts.alias and rehash xfs again to get X working.
Restart Netscape. Go to "preferences/fonts" and select "Allow Scaling" for variable width font AND "use document-specified fonts". Select "Arial (monotype)" as your Variable Width Font. Then choose font-size 14 (or 15) in the upper dropbox, where there now are several selectable pont sizes for for Arial. Click ok. Here is a comparition of the looks "after" in Netscape, under Linux and Windows - and here the contents of a fonts.alias - the file should end with one linefeed!
-monotype-Arial-medium-r-normal--6-60-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--6-60-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--7-70-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--7-70-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--8-80-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--8-80-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--9-90-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--9-90-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--10-100-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--10-100-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--11-110-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--11-110-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--12-120-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--12-120-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--13-130-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--13-130-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--14-140-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--14-140-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--15-150-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--15-150-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--18-180-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--18-180-75-75-p-0-iso8859-1 -monotype-Arial-medium-r-normal--24-240-0-0-p-0-iso8859-1 -monotype-Arial-medium-r-normal--24-240-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--6-60-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--6-60-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--7-70-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--7-70-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--8-80-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--8-80-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--9-90-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--9-90-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--10-100-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--10-100-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--11-110-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--11-110-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--12-120-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--12-120-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--13-130-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--13-130-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--14-140-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--14-140-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--15-150-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--15-150-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--18-180-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--18-180-75-75-p-0-iso8859-1 -monotype-Arial-bold-r-normal--24-240-0-0-p-0-iso8859-1 -monotype-Arial-bold-r-normal--24-240-75-75-p-0-iso8859-1
| CharacterMap |
| Netscape JAVA crashes |
Due to a slip in the RPM
install, the fontpath to the unscaled 75dpi fonts isn't always
set.
This cause JAVA
crashes in Netscape. If you have a problem with Netscape crashing
whenever it tries to load a java applet, that is the
problem. Here the solution, extracted from RedHat's own fix:
Write:
chkfontpath --list
You should get output that looks something like the following:
Current directories in font path:
1: /usr/X11R6/lib/X11/fonts/misc:unscaled
2: /usr/X11R6/lib/X11/fonts/75dpi:unscaled
3: /usr/X11R6/lib/X11/fonts/100dpi:unscaled
4: /usr/X11R6/lib/X11/fonts/misc
5: /usr/X11R6/lib/X11/fonts/Type1
6: /usr/X11R6/lib/X11/fonts/Speedo
If /usr/X11R6/lib/X11/fonts/75dpi isn't listed: Verify they are
installed:
ls -la /X11R6/lib/X11/fonts/75dpi
If you get a long list of files, now add them to your fontpath
like this:
chkfontpath --add /usr/X11R6/lib/X11/fonts/75dpi
If javascript pages give
you problems even after this, check your ~/.mailcap file (cat
.mailcap)
Remove this line if
you find it:
application/x-javascript;;\
x-mozilla-flags=save
RedHat offer an upgrade to version 4.7-1. Find a suitable mirror site close to you. Download the files from the update directory - here's how you upgrade of the full communicator suite:
CLOSE ALL your Netscape
stuff, and (as user root) write:
rpm -Uvh --force
--nodeps netscape-common-4.7-1.i386.rpm
rpm -Uvh --force
netscape-communicator-4.7-1.i386.rpm
For changes in v.4.7,
see: http://home.netscape.com/eng/mozilla/4.7/relnotes/unix-4.7.html