Make it look nice, aka fonts in Linux

Now that I have the Toshiba setup with SliTaz it’s time for tweaks.  Since this machine is mainly for surfing the web I want web pages to render nicely.  A lot of Linux distributions don’t tend to address this well and it can make a big difference without much effort.

Installing the Microsoft core web fonts (Verdana, Tahoma, Times New Roman, Arial, Trebuchet, Comic Sans, Impact etc.). See if you can track down a .tar.gz of all the Web Core fonts.  Google to the rescue also while you are there grab the Droid font from Google’s Android SDK.

Now unzip the fonts into /usr/share/fonts/truetype


ross@toshiba:~$ su
Password:
root@toshiba:/home/ross# cd /usr/share/fonts/truetype/
root@toshiba:/usr/share/fonts/truetype# tar zxf /home/ross/fonts/droid-fonts.tar.gz

Do the same for the web core fonts. Now we’ll need to update the font cache.

root@toshiba:/usr/share/fonts/truetype# fc-cache -f -v
/usr/share/fonts: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/X11: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/X11/misc: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/X11/util: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/truetype: caching, new cache contents: 47 fonts, 1 dirs
/usr/share/fonts/truetype/ttf-dejavu: caching, new cache contents: 3 fonts, 0 dirs
/root/.fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded

To verify that the fonts are installed you can run fc-list

Now we have a good set of fonts for the desktop and the web we need to tell the font renderer how to draw them in the best light.

As root create the file /etc/fonts/local.conf and add the following content:-


<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font" >
<!-- No hinting for bold fonts -->
<test name="weight" compare="more"> <const>medium</const> </test>
<edit name="autohint" mode="assign"> <bool>false</bool> </edit>
</match>
<match target="font">
<!-- hintstyle can be hintslight, hintmedium, hintfull -->
<edit name="hintstyle" mode="assign"> <const>hintfull</const> </edit>
</match>
<match target="font">
<!-- set the subpixel type of the LCD (99% of the time it's rgb -->
<!-- may conflict with hinting above. If so turn it off -->
<!-- edit name="rgba" mode="assign"> <const>rgb</const> </edit -->
</match>
<match target="font">
<!-- Turn on antialiasing on big fonts sizes to remove those jaggies -->
<edit name="antialias" mode="assign"> <bool>true</bool> </edit>
<!-- edit name="antialias" mode="assign"> <bool>false</bool> </edit -->
<!-- lcd filter -->
<edit mode="assign" name="lcdfilter"> <const>lcddefault</const> </edit>
</match>
<match target="font" >
<!-- Turn on antialiasing on big fonts sizes to remove those jaggies -->
<test name="size" qual="any" compare="more"> <double>12</double> </test>
<edit name="antialias" mode="assign"> <bool>true</bool> </edit>
</match>
<match target="font" >
<!-- Turn on antialiasing on big fonts sizes to remove those jaggies -->
<test name="pixelsize" qual="any" compare="more"> <double>17</double> </test>
<edit name="antialias" mode="assign"> <bool>true</bool> </edit>
</match>
<!-- turn on hinting -->
<match target="font">
<edit name="autohint" mode="assign"> <bool>true</bool> </edit>
</match>
<!-- Alias the vanilla fonts to Droid -->
<alias>
<family>serif</family>
<prefer>
<family>Droid Serif</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Droid Sans</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Droid Sans Mono</family>
</prefer>
</alias>
</fontconfig>

Logout and log back in and you should be looking a lot better.

Enjoy 😀

Advertisements

One Response

  1. I have been looking around tuxonomy.wordpress.com and really am impressed by the amazing content material here. I work the nightshift at my job and it is so boring. I’ve been coming here for the past couple nights and reading. I just needed to let you know that I have been enjoying what I’ve seen and I look ahead to reading more.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: