5. X Window

Welcome! This is where you will find the most useful tools for Tamil. Even for basic users, it is now possible to have close to a total Tamil-localized office suite. Tamil GUI is achieved in KDE or GNOME environment with localization settings (more about this later in this document), and Tamil character input is achieved using keymanager programs. But first you need to get some fonts to do all this.

5.1. Installing fonts

Linux, by default, uses pcf fonts and one can also use bsd fonts; these are bitmapped fonts that display under X and can be printed. But, as is common with all bitmapped fonts, these are not always WYSIWYG in print. For high-quality printing you need Type-I fonts (Adobe), with Ghostscript you need PS fonts and for afm fonts (American Font metrics) are used. But most of the Tamil fonts that are freely available are TrueType (ttf). We will see next how to get all these fonts working.

5.2. Bitmapped fonts

A bitmapped font is a matrix of dots; because of this, these fonts are device-independent. A 75 dpi font, which is good enough for displaying, is still a 75 dpi font in your 1200 dpi printer. So usually bitmapped fonts are created for a specific purpose, such as for displaying on a monitor or for printing. Linux usually uses bdf or pcf font for console or X display. Fonts like those created by dvips or dvi are printer-related bitmapped fonts. These fonts occupy large sizes, but programs circumvent this by dynamically creating them as and when they are needed, and at a specific resolution.

You can get bitmapped Tamil fonts for various applications from:

When an application makes a font request to the X Server, XFree86 looks for fonts in specific directories. This means that when you add fonts to your system and you want them to be recognized by X Server, you need to tell X about the location of these fonts. Simply add a directory to your font path with the commands:

      mkfontdir
      xset fp+ <directory>
      

where the family directory is the name of the directory where you have fonts. Once you have done this you have to ask the server to get this registered for the session, with the command

xset fp rehash

Since you will want these commands to run automatically, you should put them in your .xinitrc file ( or possibly your .Xclients or .xsession file -- this depends on how you start X. Another way to have the commands set automatically is edit XF86Config. For example, to add /usr/share/fonts/myfonts to the font path when X is started, edit XF86Config like this:

	...
	Section "Files"
	...
	FontPath /usr/share/fonts/myfonts
	...
	EndSection
		...

The advantage of editing XF86Config is that the resulting changes are system wide.

5.3. TrueType fonts

You may get TrueType fonts for TSCII, TAB and TSCII1.7 encoding from the download section of http://tamil.homelinux.org/. Alternate sources for these fonts are

TSCII - http://www.tamil.net/tscii/

TAB - http://www.tamilnet99.org/ and http://www.thinnai.com

TSCII-1.7 (experimental) - http://groups.yahoo.com/group/tscii/files/

Installing these fonts are either too easy or too difficult. Too easy if you have one of the latest distributions, like RedHat7.x or Mandrake7.x. This is because RedHat (and Mandrake, maybe SuSE) come with xfs pre-packaged. It is also easy to find xfs for Debian, but as far as I know, Debian does not come with xfs packaged.

Debian users are now redirected to this mini-howto on TrueType fonts in Debian - http://www.linuxdoc.org/HOWTO/mini/TT-Debian-3.html

There is also another utility, xfstt, which is easier to install and use, but xfs is becoming popular as it can handle Adobe Type1 in addition to TrueType fonts.

If you do not have either of these, consider getting either xfs (not to be confused with Silicon Graphics (SGI) sponsored XFS journaling file system) from http://www.xfree86.org.

or xfstt from http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/. You may also get xfstt binaries from http://independence.seul.org/, or reading an article about xfstt in the Linux Gazette at

5.3.1. Installing TrueType Fonts

You need to run these commands as root. If you are currently logged in as a normal user, you can use su to do this now.

You should now have xfs availability, otherwise use the steps in the previous section to obtain it.

In some distributions like Mandrake, installing TrueType fonts is a cakewalk. Just go to DrakConf and use the font install utility - follow a few easy steps there and you'll have them all.

Put your TrueType fonts in whatever directory you want. For example, /usr/share/tamiltt.

From within the directory containing your new fonts, type:

ttmkfdir -m 50 -o fonts.scale

This makes a file that will contain the necessary information about the fonts for the xfs server. The option -m 50 specifies the magnification for the fonts; I have seen some Tamil fonts working well only with -m 100.

Then type:

mkfontdir

Now you can add the new directory to your xfs search path. Red Hat (and Red Hat-like) distributions come with a neat utility to do this called chkfontpath. Run chkfontpath like this:

chkfontpath --add /usr/share/tamiltt

This will add the new font directory to your font path.

(Other users, who have an xfs font server, without ttf support, can do this by editing their xfs configuration file.

If xfs is already installed on your system, you should see which port it is running on. You can do this with the following command:

ps ax grep xfs

Then check your XFree86 font path with this command:

xset -q

If your font path includes something like unix:/port number, where port number is the port on which the server is running, then you already have xfs set up properly. Otherwise, you should add it to your XFree86 font path with these commands:

xset fp+ <unix/:port number>

xset fp rehash

Note

The port number is a numerical value, something like 7100.

You can add the fontpath permanently by editing your .xinitrc. To add it system-wide, edit your XF86Config file (either under /etc/X11/XF86Config, /etc/X11/XF86Config-4, /etc/XF86Config, or /usr/X11R6/lib/X11/XF86Config), by adding the following line to the Files section:

FontPath "unix/:port number"

Here is an example of how it should look:

        ...
        Section Files
        ...
        
        FontPath "unix/:-1"
        ...
        EndSection
        ...
	

If xfs is already properly installed, then you can restart it like this as root:

service xfs restart

After restarting xfs, it is a good idea to restart your X session.

As most of the users in Tamil will be doing this, let me summarize the essential steps.

  1. Become root.

  2. Download and copy some ttf fonts into a directory (say /usr/share/fonts/tamiltt ).

  3. Go to that directory and do a ttmkfdir -m 50 -o fonts.scale (use the -m 100 option if your fonts do not budge).

  4. Do a mkfontdir . (Notice that you need to specify the directory either absolutely or with a dot).

  5. Do a chkfontpath --add /usr/share/fonts/tamiltt . (Remember this command is available only in Red Hat-like distributions. If you can run this successfully, skip the remaining steps and restart the X server).

  6. Do ps ax | grep xfs and get the xfs port known.

  7. Check your font path: xset -q

    If your font path includes something like unix:/port number, (something like unix: 7100), add this to your xfont path:

    xset fp+ unix: port number

    xset fp rehash

  8. It is a good idea to restart the X Server.

  9. If everything works fine, update your .xinitrc file, wherever it is.

  10. Have fun!

5.4. Other Font Servers

There is another project, X-TrueType Server, worth looking into, at http://www.io.com/~kazushi/xtt/.

Another interesting project with broader scope is FreeType; check http://www.freetype.org.

I personally feel xfs is a great utility; it can handle Type1 fonts (very useful if you use programs like GIMP). Besides, a stand alone xfs server is not attached to X server. This means that you can deliver these fonts for remote X displays. I use this feature extensively with VNC Server running in my host and VNC Viewer running locally in Windows. It's something of a luxury having a Tamil Linux desktop while working for my employer.