View Single Post
Old 12-07-02, 03:03 PM   #1
Join Date: Jul 2002
Location: /dev/null
Posts: 1,556
Default Tutorial: Antialiased fonts in Mozilla | Redhat 8.0

You can get my tutorial in here:

I don't know if you care or not, I certainly do because browsing the web with default font handler in linux sucked.

I've spent over 2 days trying to figure out how to get those nice antialised fonts everyone was talking about. For me changing couple of lines and adding TTF font paths in /usr/local/mozilla/defaults/pref/unix.js did not work. Sure I was getting antialised fonts but they were bulky and very hard to read. So I sat down and browsed the web for an asnwer.

First you need some TrueType Fonts if you DONT HAVE IT. RH 8 comes with *some* ttf fonts.
They are loaded from XF86Config file (/etc/X11)
I believe RH 8 comes with TrueType handler installed so make sure
your XF86Config file has the following (this is my part of my config):

Section "Module"
Load "xft" # loads x font server instead of xfs
Load "freetype" # TrueType font handler
Load "type1" # Adobe Type 1 font handler

(Of course you should have the rest of the section: Glcore, dri etc. So just add the above lines
if you dont have them)

If you don't have any TrueType fonts, then you need some :]

Get them from
Follow the instructions that they wrote and you should be fine! If you are lazy, no problem! hehe. I've included my my file so all you have to do is install it. Here it is:
Put the source file in /usr/src/redhat/RPMS/noarch. To install them simply type: rpm -ivh /usr/src/redhat/RPMS/noarch/msttcorefonts-1.3-3.noarch.rpm
Because you are lazy to follow the instructions your fonts will be installed in /usr/share/fonts/msttcorefonts
That's where mine are.

Now for the cool stuff.

Note if you are lazy (again) you can download my compiled mozilla-1.2.1 package:
Then just go down to step #11, #12 and #13.
Make sure you put the tarball in /opt/mozilla-source/mozilla/dist or somewhere else

If not, then follow the instructions:

Downloaded the mozilla-1.2.1 source file:

Most likely you have the file in your home dir.
I suggest you do the below steps using your root account. Don't relogin, just type 'su' in your console and it will prompt you for a root password.

Note that I've done this on a Redhat 8.0 system. Should be VERY similar for other distros. The only thing you may want to change is the mozilla installation path. It will be installed in usr/local/mozilla by default

1. Type: mkdir /opt/mozilla-source
2. Type: cd /opt/mozilla-source
3. Type: tar xvjf ./mozilla-source-1.2.1.tar.bz2 (that will unzip the source you downloaded into /opt/mozilla-source)
4. Now type cd mozilla (enters the directory of the extracted source file)
5. Now go ahead and create a mozilla config file by typing: touch .mozconfig
6 You now have to edit it. Using 'gedit' 'vi' or whatever editor you prefer.
7. Put the following in your file:

ac_add_options --enable-crypto
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --enable-strip
ac_add_options --enable-strip-libs
ac_add_options --enable-optimize="-O2 -march=i686"
ac_add_options --enable-xft

(substitute i686 for appropriate system tag)

ac_add_options --disable-mailnews
ac_add_options --disable-composer

(I enabled both, if you leave them as 'disable' you wont get mailnews and composer support so think twice)


(that is all for the .mozconfig file), you can now save the file.

8. Now we have to compile our Mozilla. Type ./configure (make sure you are still in /opt/mozilla-source/mozilla). This will tell 'how' to compile mozilla and with what features. Those we specified in .mozconfig (not all of them of course, just the ones we need for antialiased fonts)

9. Now that you have configured your Mozilla, let's compile it. To my surprising it took over ONE HOUR on 1.6GHz system.
Type: make

10. DO NOT install the package
Type: cd xpinstall/packager. Now type: make. This will create a tarball file for future use so you won't have to compile it again.
The tarball file will be in /opt/mozilla-source/mozilla/dist

11. Remove previous version of Mozilla and install the new one in /usr/local:

Type: cd /usr/local
Type: rmdir mozilla
Now type: tar xzvf /opt/mozilla-source/mozilla/dist/mozilla-i686-pc-linux-gnu.tar.gz
(or whatever your tarball is called)

12. That's all. Your new mozilla is installed. To fire it up type: /usr/local/mozilla/mozilla
/usr/local/mozilla/mozilla -email (mail-news client)
/usr/local/mozilla/mozilla -edit (composer)

13. Update your desktop links, and you should be done.

Once you open mozilla it will ask you for a profile bla bla bla.
Go to Edit->preferences->appearance->fonts. You should see bunch of cool TTF fonts in there.
Set the one you want and voila!

This is a rough tutorial. Some of you will probably get confused, so if you have any questions don't hesitate.
I hope I will be able to answer

And here is how it looks:
(large files)
[b]Optimization guidelines by Koji Ashida of NVIDIA:[/b][list][*]Use fx12 instructions whenever possible[*]Use lowest pixel shader version[/list][url=]source[/url]

[size=1]The politics are invading the technology. We don't really like to mess with politics because that kind of adversarial relationship has nothing to do with pure technical operations and the technical specifications of what we like to play with, the hardware![/size]

Last edited by volt; 12-29-02 at 10:51 PM.
volt is offline   Reply With Quote