[an error occurred while processing this directive]

# Setting up Unicode Fonts for LaTeX

This document describes what you have to do to get Chinese, Hindi and other Unicode fonts to work on SuSE 10.0 and on other systems. In the next section I describe how to set up the fonts and how to use them. Below you will find a comment on how to get Type1 fonts (scalable fonts, not pixmaps) to work.

## The fonts

You may use the Titus fonts for Hindi. Apparently, the Titus font also supports Arabic, Hebrew and Russian and what not, but not Chinese. Chinese fonts come with SuSE (package ttf-arphic). Alternatively you may use the CODE2000 font, which supports an enourmous amount of languages.

Thanks to Mike Fabian for help with the fonts.

## Installing the Fonts

### Hindi Fonts on SuSE 10.2

2. unzip the file and rename TITUSCBZ.TTF to tituscbz.ttf, i.e. no capitals.
3. do the following:
mv tituscbz.ttf /usr/share/fonts/truetype/

Add the following lines to /etc/ttf2pk/ttfonts.map.
tituscbz-uni@Unicode@           tituscbz.ttf
tituscbz-s-uni@Unicode@         tituscbz.ttf    Slant=0.167
tituscbz-r-uni@Unicode@         tituscbz.ttf    Rotate=Yes
tituscbz-rs-uni@Unicode@        tituscbz.ttf    Rotate=Yes      Slant=0.167

4. install the cjk-latex package that comes with SuSE
5. Install ttf2pt1
6. call
/usr/sbin/cjk-latex-config --type1

That's it. You may check how to set up the LaTeX document.

### Hindi Fonts on SuSE 10.0

Another source that helped me setting the fonts up correctly is: http://lists.suse.de/archive/m17n/2003-Nov/0023.html

2. unzip the file and rename TITUSCBZ.TTF to tituscbz.ttf, i.e. no capitals.
3. do the following:
mv tituscbz.ttf /usr/X11R6/lib/X11/fonts/truetype/
mkdir -p texmf/fonts/tfm
mkdir -p texmf/fonts/truetype
cd texmf/fonts/truetype/
ln -s /usr/X11R6/lib/X11/fonts/truetype/tituscbz.ttf

cd ../..
ttf2tfm fonts/truetype/tituscbz.ttf fonts/tfm/tituscbz@Unicode@

The last command generates lots of output. Many .tfm files have been generated here:
ls fonts/tfm

ituscbz02.tfm  tituscbz05.tfm  tituscbz09.tfm  tituscbz12.tfm

4. download c70tituscbz.fd (if you are installing CODE2000, take c70code2k.fd) and move it to somewhere appropriate in your TeX-tree
mv c70tituscbz.fd texmf/fonts/

5. install the cjk-latex package that comes with SuSE
6. Install ttf2pt1
7. call
/usr/sbin/cjk-latex-config --type1

This takes a while (for titus it takes three minutes and for CODE2000 it takes more than ten hours on a Pentium Mobile 1,8 Ghz!) and generates lots of output:
tituscbz@Unicode@: calling ttf2tfm ...
tituscbz@Unicode@, plane=00: calling ttf2pt1 ...
tituscbz@Unicode@, plane=01: calling ttf2pt1 ...
tituscbz@Unicode@, plane=02: calling ttf2pt1 ...
tituscbz@Unicode@, plane=03: calling ttf2pt1 ...

...

creating /usr/share/texmf/fonts/map/dvips/cjk-latex/cjk-latex.map ...
texhash: Updating /etc/texmf/ls-R...
texhash: Updating /usr/share/texmf/../../../var/lib/texmf/db/ls-R...
texhash: Updating /var/cache/fonts/ls-R...
texhash: Updating /var/lib/texmf/ls-R...
texhash: Done.

This process creates a lot of .pfb files in /usr/share/texmf/fonts/type1/cjk-latex/Unicode/tituscbz/ and makes apropriate entries in /usr/share/texmf/fonts/map/dvips/cjk-latex/cjk-latex.map.

The script also deletes pk files that may have been present somewhere in /var/cache/fonts/pk/. If you have pk files in your local directories, remove them. Otherwise these files will be taken instead of our nice Type1 fonts.

8. If the output of the cjk-latex-config script ends with the following lines:
updmap: This is updmap, version 1107552857
updmap: using transcript file /var/lib/texmf/web2c/updmap.log'
updmap: initial config file is /etc/texmf/web2c/updmap.cfg'
updmap: configuration (updmap.cfg) unchanged. Map files will not be recreated.
texhash: Updating /etc/texmf/ls-R...
texhash: Updating /usr/share/texmf/../../../var/lib/texmf/db/ls-R...
texhash: Updating /var/cache/fonts/ls-R...
texhash: Updating /var/lib/texmf/ls-R...
texhash: Done.

this means that the map files are not created. This is due to the fact, that the line
Map cjk-latex.map

was already in the file `/etc/texmf/web2c/updmap.cfg'. cjk-latex.map now also contains information about our Type1 fonts, but updmap does not know about this. So you have to call updmap explicitely.
That's it. You may check how to set up the LaTeX document.

### Hindi Fonts on Other Systems

The instructions are taken from here and were adapted to the SuSE versions of the programs. The original instructions are by Olivier Delloye.
3. make sure "tituscbz.ttf" and "Unicode.sfd" are in the same directory
4. from the terminal, go to that directory and run
ttf2tfm tituscbz.ttf  tituscbz@Unicode@

in order to create ".tfm" and ".enc" files
5. move all the ".tfm" files to somewhere appropriate in your TeX-tree (e.g. /usr/share/texmf/fonts/tfm/tituscbz)
6. move all the ".enc" files to somewhere appropriate in your TeX-tree (e.g. /usr/share/texmf/pdftex/enc/)
9. move the "cyberbit.ttf" to somewhere appropriate in your TeX-tree (e.g. /usr/share/texmf/fonts/truetype/)
10. Call the following command:
sudo updmap --enable Map tituscbz.map

This will enable the Titus font for the use with pdflatex. The rest above isn't necessary.
11. run
sudo texhash

in the terminal If you put all of the files in your private folder, then this isn't necessary, either.

## Using the Fonts with LaTeX

To use the new environment in LaTeX, you just need to include the three following lines in the preamble :
\usepackage[encapsulated]{CJK}
\usepackage{ucs}
\usepackage[utf8]{inputenc}
It may also be a good idea to create a new command :
\newcommand{\cjktext}[1]{\begin{CJK}{UTF8}{tituscbz}#1\end{CJK}}
Now, when you want to type Hindi, you just use the command: \cjktext{enter your Hindi text here} If you want to have glossed examples you can enable Hindi at the beginning of the document and keep it enabled till the end.
\begin{document}

% to get the Hindi fonts
\begin{CJK*}{UTF8}{tituscbz}

This is Hindi text: लिनक्स-इन्डिया में आपका स्वागत है।

\end{CJK*}
\end{document}

You may check hindi-font-test.tex to see an example. Your outcome should look like hindi-font-test.pdf.

And that's it!