Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using Windows fonts in Redhat Linux 9

0 views
Skip to first unread message

John A. Prose

unread,
Aug 24, 2003, 9:35:42 AM8/24/03
to
A lot of people are asking how to get fonts looking as good in RH9 as
in Windows- there are a few guides to doing this around, but it seems
each one needs a slight amount of adjustment to get it to work, given
that different versions of Linux do things slightly differently.
Having now got the Windows fonts working fine in RH9, here's how I did
it:

I mostly followed the instructions at
http://feenix.burgiss.net/ldp/fdu/, though these need a tiny bit of
adjustment for RH9. The instructions below (based loosely on the
above guide) are for installing and using Windows TTF fonts
specifically in RH9. Make sure you take backup copies of all the
files edited as root, just in case you need to reverse the changes.


1. Installing the fonts
========================

As root, make a directory to hold the TTF files, and copy your Windows
files into here. It is assumed you have mounted your "C" drive at the
location used.

# mkdir -p /usr/share/fonts/ttfonts
# cp /mnt/c/windows/fonts/*ttf !$

Change to this directory and do the following to generate two files,
fonts.scale and fonts.dir.

# ttmkfdir -o fonts.scale
# mkfontdir

Edit /etc/X11/fs/config. Find the line starting "catalogue = ", and
add the directory used above to the TOP of the list, so it looks like
this:

catalogue = /usr/share/fonts/ttfonts,
/usr/X11R6/lib/X11/fonts/misc:unscaled,
/usr/X11R6/lib/X11/fonts/75dpi:unscaled,
...etc...

Run the following as root, to ensure the font server is up to date:

# xset fp rehash
# /etc/rc.d/init.d/xfs restart


Now try running something where you can change the fonts (e.g.
Mozilla) and see if you can now use the Windows fonts. If so, then
great. There is a chance that the fonts look terrible, however,
either through being too blurred from anti-aliasing or being rather
jagged. If so, continue reading to sort this out.


2. Turning off anti-aliasing
=============================

Anti-aliasing works well on large or small text, but tends to make
more "normal" sized text (e.g. around 12pt) look rather blurred. It
can be switched off for such sizes by doing the following:

Edit /etc/fonts/fonts.conf as root. Go to the bottom of the file, and
just above the line that reads "</fontconfig>", insert the following:

<match target="font">
<test name="pixelsize" compare="less_eq">
<double>16</double>
</test>
<test name="pixelsize" compare="more_eq">
<double>2</double>
</test>
<edit name="antialias" mode="assign">
<bool>false</bool>
</edit>
</match>

This turns off anti-aliasing (aka blurring) for all medium-sized text.
Adjust the size range if necessary, as you like.

Now are the fonts better? If so, good. If not, you may need to
recompile FreeType so it renders your TTF fonts better.


3. Recompiling FreeType
=======================

Download the latest stable version from here, and uncompress/untar the
files.

http://prdownloads.sourceforge.net/freetype/freetype-2.1.4.tar.gz?download

# gunzip freetype-2.1.4.tar.gz
# tar xvf freetype-2.1.4.tar
# cd freetype-2.1.4

You now need to make some changes to enable the "TrueType native
hinter". These changes are mentioned in the docs/TRUETYPE file, but
the change mentioned here is not quite right (it mentions an #undef
command that doesn't actually exist.)

Edit include/freetype/config/ftoption.h, and add the following line
after the #include line (at about line 25 should be fine)

#define without_bytecode_interpreter 0

Now go to line 373, read the message and uncomment the #define to
enable the following:

#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER

Save and close the file. Now simply run the following to compile and
update FreeType on your Linux installation:

# ./configure --prefix=/usr
# make
# make install

The last "make" should give a few messages about having updated
various files. To verify that you've updated FreeType, do the
following. It should report 9.3.3.

# freetype-config --version

(You may need to restart Linux at this point- I'm not sure.) In any
case, try Mozilla etc. and choose the newly installed fonts. They
should now work!

John A. Prose

Lenard

unread,
Aug 24, 2003, 12:48:03 PM8/24/03
to
On Sun, 24 Aug 2003 06:35:42 -0700, John A. Prose typed:

> A lot of people are asking how to get fonts looking as good in RH9 as in
> Windows- there are a few guides to doing this around, but it seems each
> one needs a slight amount of adjustment to get it to work, given that
> different versions of Linux do things slightly differently.

I did it this way;

Headed over to;
http://www.ibiblio.org/pub/Linux/distributions/contrib/texstar/mandrake/9.1/rpms/

Downloaded and installed;

msfonts-1.2.1-2tex.noarch.rpm
msfonts-style-1.2.1-2tex.noarch.rpm


--
If it's Thursday it must be Micro$oft patching day!!!

0 new messages