old-www/HOWTO/Indic-Fonts-HOWTO/iosetup.html

388 lines
7.2 KiB
HTML

<HTML
><HEAD
><TITLE
>Devanagri Input and Output setup</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.63
"><LINK
REL="HOME"
TITLE="The Indic Fonts HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Installing the IndiX system"
HREF="install.html"><LINK
REL="NEXT"
TITLE="Locale Setup"
HREF="locale.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Indic Fonts HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="install.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="locale.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="iosetup"
>3. Devanagri Input and Output setup</A
></H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN73"
>3.1. Linux console</A
></H2
><P
>&#13; Devanagari characters do not display properly in a Linux console. However, NCST has developed ncst-term (a terminal emulator program in X Window System) which has support for converting keystrokes to UTF-8 before sending them to the application running in the ncst-term, and for displaying Unicode characters that the application outputs as UTF-8 byte sequence.
</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="xwindows"
>3.2. X Window System</A
></H2
><P
>&#13; You need to make some changes in your <TT
CLASS="filename"
>XF86Config-4</TT
> file (usually resides in <TT
CLASS="filename"
>/etc/X11/</TT
> directory). A sample config file <TT
CLASS="filename"
>XF86Config-4.indix</TT
> is installed along with IndiX system. This file can be found in <TT
CLASS="filename"
>/etc/X11/</TT
> directory.
</P
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="AEN83"
>3.2.1. Devanagri Font</A
></H3
><P
>&#13; OpenType is the most suitable font format to render any Indic script properly. The IndiX system ships with one OpenType font called "raghu" for Hindi. Anyone can use and distribute this font free-of-cost. You can find this font in <TT
CLASS="filename"
>/usr/X11R6/lib/X11/fonts/TrueType/</TT
> directory.
</P
><P
>&#13; Installing the Indic Fonts:
</P
><P
>&#13; In order to install the Indic fonts, you must log in as root. The X Font Server (xfs) is known to have some problems with the IndiX system, so remove it from the FontPath of the X Server. This can be achieved by modifying your <TT
CLASS="filename"
>XF86Config-4</TT
> file (usually in <TT
CLASS="filename"
>/etc/X11/</TT
>) and commenting the line in the Files section and adding <TT
CLASS="filename"
>/usr/X11R6/lib/X11/fonts/TrueType/</TT
> to the current FontPath.
</P
><P
>&#13; After that, the FontPath should look something similar to this:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> FontPath "unix/:7100"
FontPath "/usr/X11R6/lib/X11/fonts/misc"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/TrueType"
FontPath "/usr/X11R6/lib/X11/fonts/Type1"</PRE
></FONT
></TD
></TR
></TABLE
>
Next, in order to make use of the OpenType font you have, load the "freetype" module at startup. You can achieve this by adding the following line in the Module section of <TT
CLASS="filename"
>XF86Config-4</TT
> file.
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> Load "freetype"</PRE
></FONT
></TD
></TR
></TABLE
>
Make sure you specify the modules search path in the Files section, too.
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> ModulePath "/usr/X11R6/lib/modules/fonts"
ModulePath "/usr/X11R6/lib/modules/drivers"
ModulePath "/usr/X11R6/lib/modules"
ModulePath "/usr/X11R6/lib"
ModulePath "/usr/lib"</PRE
></FONT
></TD
></TR
></TABLE
>
Any new Indic fonts you want to install should be placed in the <TT
CLASS="filename"
>/usr/X11R6/lib/X11/fonts/TrueType/</TT
> directory. Now, change to this directory and run the following commands:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> $ mkfontdir
$ xset fp rehash</PRE
></FONT
></TD
></TR
></TABLE
>
In case you want to place your new Indic fonts in some other directory, you must use <B
CLASS="command"
>xset</B
> to add the new FontPath. Please see the <B
CLASS="command"
>xset</B
> man-page for further assistance. You can check the new installed fonts by running the <B
CLASS="command"
>xlsfonts</B
> command. In case you don't see any Indic fonts using this command, you may need to restart X.
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="AEN102"
>3.2.2. Devanagri Keyboard Layout</A
></H3
><P
>&#13; The IndiX system comes with a keyboard map file for xmodmap. You can use the utility <B
CLASS="command"
>xmodmap</B
> to map a Devanagri keyboard. For most distributions, when you start X, the X-Server will look for a <TT
CLASS="filename"
>Xmodmap</TT
> in <TT
CLASS="filename"
>/etc/X11/</TT
> directory. If that file does not exist, the server will look for a <TT
CLASS="filename"
>.Xmodmap</TT
> in your $HOME. Just putting the <TT
CLASS="filename"
>.Xmodmap</TT
> in your $HOME will be okay. When you start the X server, it will load this file. You can also load <TT
CLASS="filename"
>.Xmodmap</TT
> from the command line:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> $ xmodmap ~/.Xmodmap</PRE
></FONT
></TD
></TR
></TABLE
>
</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
>&#13; If you are using XFree86 version 4.0 or later, you need to add the line XkbDisable in InputDevice section of <TT
CLASS="filename"
>XF86Config-4 file</TT
>. You may config the keyboard section like the following sample.
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
Option "XkbDisable"
EndSection</PRE
></FONT
></TD
></TR
></TABLE
>
</P
></TD
></TR
></TABLE
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="install.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="locale.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Installing the IndiX system</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Locale Setup</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>