Installing fonts in Linux and Mozilla
Installing fonts in Linux and Mozilla
==========================
Mozilla fonts suck big time. Especially if you visit a page with Trebuchet MS font like I've recently started using on mahmood.tv. True to my promise of using Linux exclusively over the next couple of weeks, I thought I'd better do something about the font display on my linux laptop.
In order to do that, I needed to copy the fonts I use for Windows XP Pro to Linux, that started the journey, however I must say that there is a wealth of information in this regard on the net, all you have to do is search for it.
Here are the steps I did to get my fonts over to Linux and how I activated them:
1. if you don't have a /usr/share/fonts/TrueType directory, create one
2. make sure that all the font files you're copying have lower-case extensions, so if you have files like
font.TTF, rename that to font.ttf
3. copy the fonts to /usr/share/fonts/TrueType
4. change into that directory: cd /usr/share/fonts/TrueType
5. issue the following commands to build the necessary fonts.scale and fonts.dir:
ttmkfdir -o fonts.scale
mkfontdir
6. this should have now created the fonts.scale and fonts.dir files
7. now go to you /etc/X11 directory so that you can add the new font directory to the search path of your
X server by adding it to the fonts section of XF86Config
8. edit XF86Config
go to the �Files� section and add the FontPath there, mine looks like the following
after editing:
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "unix/:7100"
FontPath "/usr/share/fonts/TrueType"
9. Now for the Mozilla part! Go to the directory you installed Mozilla in, mine is located
at /usr/local/mozilla. Change into /usr/local/mozilla/defaults/prefs
10. backup the �unix.js� preference file so that you can get back to it if anything screws
up:
11. cp unix.js unix.js.bak
12. edit the unix.js file and look for the �TrueType� section and change it to look like
the following snippet:
// TrueType
pref("font.FreeType2.enable", true);
pref("font.freetype2.shared-library", "libfreetype.so.6");
// if libfreetype was built without hinting compiled in
// it is best to leave hinting off
pref("font.FreeType2.autohinted", false);
pref("font.FreeType2.unhinted", false);
// below a certian pixel size anti-aliased fonts produce poor results
pref("font.antialias.min", ;
pref("font.embedded_bitmaps.max", 1000000);
pref("font.scale.tt_bitmap.dark_text.min", 0);
pref("font.scale.tt_bitmap.dark_text.gain", "0.7");
// sample prefs for TrueType font dirs
pref("font.directory.truetype.1", "/usr/share/fonts/TrueType");
pref("font.directory.truetype.2", "/usr/X11R6/lib/X11/fonts/TTF");
//pref("font.directory.truetype.3", "/u/sam/tt_font3");
pref("font.FreeType2.printing", true);
Now you'll enjoy a MUCH clearer veiw of websites you visit!
I'm still not very happy as the fonts are not kerned properly and look a bit spaced out on my laptop. I'll
have a look at that next and let you know if I get better display.
For OpenOffice.org, you can simply run the �spadmin� program and add your fonts by pointing to the TrueType directory and �add all�, close the panel and start up OpenOffice and you'll be happy to see that you now have all the fonts to play with in your documents
==========================
Mozilla fonts suck big time. Especially if you visit a page with Trebuchet MS font like I've recently started using on mahmood.tv. True to my promise of using Linux exclusively over the next couple of weeks, I thought I'd better do something about the font display on my linux laptop.
In order to do that, I needed to copy the fonts I use for Windows XP Pro to Linux, that started the journey, however I must say that there is a wealth of information in this regard on the net, all you have to do is search for it.
Here are the steps I did to get my fonts over to Linux and how I activated them:
1. if you don't have a /usr/share/fonts/TrueType directory, create one
2. make sure that all the font files you're copying have lower-case extensions, so if you have files like
font.TTF, rename that to font.ttf
3. copy the fonts to /usr/share/fonts/TrueType
4. change into that directory: cd /usr/share/fonts/TrueType
5. issue the following commands to build the necessary fonts.scale and fonts.dir:
ttmkfdir -o fonts.scale
mkfontdir
6. this should have now created the fonts.scale and fonts.dir files
7. now go to you /etc/X11 directory so that you can add the new font directory to the search path of your
X server by adding it to the fonts section of XF86Config
8. edit XF86Config
go to the �Files� section and add the FontPath there, mine looks like the following
after editing:
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "unix/:7100"
FontPath "/usr/share/fonts/TrueType"
9. Now for the Mozilla part! Go to the directory you installed Mozilla in, mine is located
at /usr/local/mozilla. Change into /usr/local/mozilla/defaults/prefs
10. backup the �unix.js� preference file so that you can get back to it if anything screws
up:
11. cp unix.js unix.js.bak
12. edit the unix.js file and look for the �TrueType� section and change it to look like
the following snippet:
// TrueType
pref("font.FreeType2.enable", true);
pref("font.freetype2.shared-library", "libfreetype.so.6");
// if libfreetype was built without hinting compiled in
// it is best to leave hinting off
pref("font.FreeType2.autohinted", false);
pref("font.FreeType2.unhinted", false);
// below a certian pixel size anti-aliased fonts produce poor results
pref("font.antialias.min", ;
pref("font.embedded_bitmaps.max", 1000000);
pref("font.scale.tt_bitmap.dark_text.min", 0);
pref("font.scale.tt_bitmap.dark_text.gain", "0.7");
// sample prefs for TrueType font dirs
pref("font.directory.truetype.1", "/usr/share/fonts/TrueType");
pref("font.directory.truetype.2", "/usr/X11R6/lib/X11/fonts/TTF");
//pref("font.directory.truetype.3", "/u/sam/tt_font3");
pref("font.FreeType2.printing", true);
Now you'll enjoy a MUCH clearer veiw of websites you visit!
I'm still not very happy as the fonts are not kerned properly and look a bit spaced out on my laptop. I'll
have a look at that next and let you know if I get better display.
For OpenOffice.org, you can simply run the �spadmin� program and add your fonts by pointing to the TrueType directory and �add all�, close the panel and start up OpenOffice and you'll be happy to see that you now have all the fonts to play with in your documents

0 Comments:
Post a Comment
<< Home