old-www/HOWTO/Tamil-Linux-HOWTO/x98.html

820 lines
15 KiB
HTML

<HTML
><HEAD
><TITLE
>X Window</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Tamil Linux HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Console Tamil"
HREF="x90.html"><LINK
REL="NEXT"
TITLE="Keyboard Drivers"
HREF="x275.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Tamil Linux HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x90.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x275.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN98"
></A
>5. X Window</H1
><P
>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.</P
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN101"
></A
>5.1. Installing fonts</H2
><P
>Linux, by default, uses <SPAN
CLASS="QUOTE"
>"pcf"</SPAN
> fonts and one can also
use <SPAN
CLASS="QUOTE"
>"bsd"</SPAN
> 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 <SPAN
CLASS="acronym"
>WYSIWYG</SPAN
> in print. For
high-quality printing you need <SPAN
CLASS="QUOTE"
>"Type-I"</SPAN
> fonts (Adobe), with
Ghostscript you need PS fonts and for <SPAN
CLASS="QUOTE"
>"afm"</SPAN
> 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.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN109"
></A
>5.2. Bitmapped fonts</H2
><P
>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 <TT
CLASS="varname"
>bdf</TT
> or
<TT
CLASS="varname"
>pcf</TT
> font for console or X
display. Fonts like those created by <SPAN
CLASS="application"
>dvips</SPAN
>
or <SPAN
CLASS="application"
>dvi</SPAN
> 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.</P
><P
>You can get bitmapped Tamil fonts for various
applications from:
<A
HREF="http://www.tamil.net/tscii/tsciitools/tsciifonts.tar.Z"
TARGET="_top"
>&#13; </A
></P
><P
>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:</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; mkfontdir
xset fp+ &#60;directory&#62;
</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>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</P
><P
><B
CLASS="command"
>xset fp rehash</B
></P
><P
> Since you will want these commands to run automatically, you should put them in your <TT
CLASS="filename"
>.xinitrc </TT
> file ( or possibly your <TT
CLASS="filename"
>.Xclients</TT
> or <TT
CLASS="filename"
>.xsession</TT
> file -- this depends on how you start X. Another way to have the commands set automatically is edit <TT
CLASS="filename"
>XF86Config</TT
>. For example, to add <B
CLASS="command"
> /usr/share/fonts/myfonts </B
> to the font path when X is started, edit <TT
CLASS="filename"
>XF86Config</TT
> like this:</P
><P
> <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; ...
Section "Files"
...
FontPath /usr/share/fonts/myfonts
...
EndSection
...
</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>The advantage of editing <TT
CLASS="filename"
> XF86Config </TT
> is that the resulting changes are system wide.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN135"
></A
>5.3. TrueType fonts</H2
><P
>You may get TrueType fonts for TSCII, TAB and
TSCII1.7 encoding from the download section of
<A
HREF="http://tamil.homelinux.org/"
TARGET="_top"
>http://tamil.homelinux.org/</A
>.
Alternate sources for these fonts are</P
><P
>TSCII - <A
HREF="http://www.tamil.net/tscii/"
TARGET="_top"
>http://www.tamil.net/tscii/</A
>
</P
><P
>TAB - <A
HREF="http://www.tamilnet99.org/"
TARGET="_top"
>http://www.tamilnet99.org/</A
> and
<A
HREF="http://www.thinnai.com"
TARGET="_top"
>http://www.thinnai.com</A
></P
><P
>TSCII-1.7 (experimental) -
<A
HREF="http://groups.yahoo.com/group/tscii/files/"
TARGET="_top"
>http://groups.yahoo.com/group/tscii/files/</A
>
</P
><P
>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
<SPAN
CLASS="application"
>xfs</SPAN
> pre-packaged. It is also easy to find
<SPAN
CLASS="application"
>xfs</SPAN
> for Debian, but as far as I know,
Debian does not come with <SPAN
CLASS="application"
>xfs</SPAN
>
packaged.</P
><P
>Debian users are now redirected to this mini-howto on
TrueType fonts in Debian -
<A
HREF="http://www.linuxdoc.org/HOWTO/mini/TT-Debian-3.html"
TARGET="_top"
>http://www.linuxdoc.org/HOWTO/mini/TT-Debian-3.html</A
>
</P
><P
>There is also another utility, <SPAN
CLASS="application"
>xfstt</SPAN
>,
which is easier to install and use, but <SPAN
CLASS="application"
>xfs</SPAN
>
is becoming popular as it can handle Adobe Type1 in addition to
TrueType fonts.
</P
><P
>If you do not have either of these, consider getting
either <SPAN
CLASS="application"
>xfs</SPAN
> (not to be confused with
Silicon Graphics (SGI) sponsored XFS journaling file system) from
<A
HREF="http://www.xfree86.org"
TARGET="_top"
>http://www.xfree86.org</A
>.</P
><P
>or <SPAN
CLASS="application"
>xfstt</SPAN
> from
<A
HREF="http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/"
TARGET="_top"
>http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/</A
>.
You may also get <SPAN
CLASS="application"
>xfstt</SPAN
> binaries from
<A
HREF="http://independence.seul.org/"
TARGET="_top"
>http://independence.seul.org/</A
>,
or reading an article about <SPAN
CLASS="application"
>xfstt</SPAN
> in the
Linux Gazette at
<A
HREF="http://www.linuxgazette.com/issue28/ayers1.html"
TARGET="_top"
>&#13; </A
></P
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="AEN165"
></A
>5.3.1. Installing TrueType Fonts</H3
><P
>You need to run these commands as root. If you are currently
logged in as a normal user, you can use <B
CLASS="command"
>su</B
> to
do this now.</P
><P
>You should now have <SPAN
CLASS="application"
>xfs</SPAN
> availability,
otherwise use the steps in the previous section to obtain it.</P
><P
>In some distributions like Mandrake, installing
TrueType fonts is a cakewalk. Just go to <EM
>DrakConf</EM
>
and use the font install utility - follow a few easy steps there and
you'll have them all.</P
><P
>Put your TrueType fonts in whatever directory you want. For
example, <TT
CLASS="filename"
>/usr/share/tamiltt</TT
>.
</P
><P
>From within the directory containing your
new fonts, type:</P
><P
><B
CLASS="command"
>ttmkfdir -m 50 -o fonts.scale</B
></P
><P
>This makes a file that will contain the necessary
information about the fonts for the xfs server. The option
<TT
CLASS="option"
>-m 50</TT
> specifies the magnification for the fonts;
I have seen some Tamil fonts working well only with
<TT
CLASS="option"
>-m 100</TT
>.</P
><P
>Then type:</P
><P
><B
CLASS="command"
>mkfontdir</B
></P
><P
>Now you can add the new directory to your
<SPAN
CLASS="application"
>xfs</SPAN
> search
path. Red Hat (and Red Hat-like) distributions come with a
neat utility to do this called <B
CLASS="command"
>chkfontpath</B
>.
Run chkfontpath like this:</P
><P
><B
CLASS="command"
>chkfontpath --add /usr/share/tamiltt</B
></P
><P
>This will add the new font directory to your font
path.</P
><P
>(Other users, who have an <SPAN
CLASS="application"
>xfs</SPAN
> font
server, without <TT
CLASS="varname"
>ttf</TT
> support, can do this by
editing their <SPAN
CLASS="application"
>xfs</SPAN
> configuration
file.</P
><P
>If <SPAN
CLASS="application"
>xfs</SPAN
> is already installed on
your system, you should see which port it is running on. You can
do this with the following command:</P
><P
><B
CLASS="command"
>ps ax grep xfs</B
></P
><P
>Then check your XFree86 font path with this
command:</P
><P
><B
CLASS="command"
>xset -q</B
></P
><P
>If your font path includes something like <SPAN
CLASS="QUOTE"
>"unix:/port
number,"</SPAN
> where port number is the port on which the server
is running, then you already have <SPAN
CLASS="application"
>xfs</SPAN
>
set up properly. Otherwise, you should add it to your XFree86
font path with these commands:</P
><P
><B
CLASS="command"
>xset fp+ &#60;unix/:port number&#62;</B
></P
><P
><B
CLASS="command"
>xset fp rehash</B
></P
><DIV
CLASS="note"
><P
></P
><TABLE
CLASS="note"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The port number is a numerical value, something like
7100.</P
></TD
></TR
></TABLE
></DIV
><P
>You can add the fontpath permanently by editing your
<TT
CLASS="filename"
>.xinitrc</TT
>. To add it system-wide,
edit your XF86Config file (either under
<TT
CLASS="filename"
>/etc/X11/XF86Config</TT
>,
<TT
CLASS="filename"
>/etc/X11/XF86Config-4</TT
>,
<TT
CLASS="filename"
>/etc/XF86Config</TT
>, or
<TT
CLASS="filename"
>/usr/X11R6/lib/X11/XF86Config</TT
>), by
adding the following line to the <TT
CLASS="varname"
>Files</TT
> section:
</P
><P
><B
CLASS="command"
>FontPath "unix/:port number"
</B
></P
><P
>Here is an example of how it should look:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; ...
Section Files
...
FontPath "unix/:-1"
...
EndSection
...
</PRE
></FONT
></TD
></TR
></TABLE
><P
>If <SPAN
CLASS="application"
>xfs</SPAN
> is already properly installed,
then you can restart it like this as root:</P
><P
><B
CLASS="command"
>service xfs restart</B
></P
><P
>After restarting <SPAN
CLASS="application"
>xfs</SPAN
>, it is a good
idea to restart your X session.</P
><P
>As most of the users in Tamil will be doing this, let
me summarize the essential steps.</P
><P
></P
><OL
TYPE="1"
><LI
><P
>Become root.</P
></LI
><LI
><P
>Download and copy some <TT
CLASS="varname"
>ttf</TT
> fonts into a
directory (say <TT
CLASS="filename"
>/usr/share/fonts/tamiltt
</TT
>).</P
></LI
><LI
><P
>Go to that directory and do a
<B
CLASS="command"
>ttmkfdir -m 50 -o fonts.scale</B
> (use the
<TT
CLASS="option"
>-m 100</TT
> option if your fonts do not budge).</P
></LI
><LI
><P
>Do a <B
CLASS="command"
>mkfontdir .</B
>
(Notice that you need to specify the
directory either absolutely or with a dot).</P
></LI
><LI
><P
>Do a <B
CLASS="command"
>chkfontpath --add /usr/share/fonts/tamiltt
</B
>.
(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).</P
></LI
><LI
><P
>Do <B
CLASS="command"
>ps ax | grep xfs</B
> and get
the <SPAN
CLASS="application"
>xfs</SPAN
> port known.</P
></LI
><LI
><P
>Check your font path: <B
CLASS="command"
>xset -q</B
></P
><P
>If your font path includes something like <SPAN
CLASS="QUOTE"
>"unix:/port
number"</SPAN
>, (something like <SPAN
CLASS="QUOTE"
>"unix: 7100"</SPAN
>), add this
to your xfont path:</P
><P
><B
CLASS="command"
>xset fp+ unix: port number</B
></P
><P
><B
CLASS="command"
>xset fp rehash</B
></P
></LI
><LI
><P
>It is a good idea to restart the X Server.</P
></LI
><LI
><P
>If everything works fine, update your
<TT
CLASS="filename"
>.xinitrc</TT
> file, wherever it is.</P
></LI
><LI
><P
>Have fun!</P
></LI
></OL
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN266"
></A
>5.4. Other Font Servers</H2
><P
>There is another project, X-TrueType Server, worth
looking into, at <A
HREF="http://www.io.com/~kazushi/xtt/"
TARGET="_top"
>http://www.io.com/~kazushi/xtt/</A
>.</P
><P
>Another interesting project with broader scope is
FreeType; check <A
HREF="http://www.freetype.org"
TARGET="_top"
>http://www.freetype.org</A
>.</P
><P
>I personally feel <SPAN
CLASS="application"
>xfs</SPAN
> is a great
utility; it can handle Type1 fonts (very useful if you use programs
like GIMP). Besides, a stand alone <SPAN
CLASS="application"
>xfs</SPAN
>
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.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x90.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x275.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Console Tamil</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Keyboard Drivers</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>