Using Hebrew TrueType fonts with pdfTeX

Note: This guide is no longer maintained. A newer guide is available here .

Since the quality of the Hebrew metafonts that comes with the Hebrew LaTeX is quite poor, alternative fonts are needed. The best quality free Hebrew fonts are TrueType fonts (for example, the times new/arial/courier new fonts). Using TrueType fonts with TeX is somewhat complicated, but it is quite easy with pdfTeX, as pdfTeX has native support for TrueType fonts. This document explains how to use TrueType fonts with pdfTeX. Since Hebrew requires the use of the eTeX engine, you need to have the pdfelatex program. It is available in teTeX 1.0 (which comes with recent Linux distributions). The instruction below allows using nikud, although the result is quite poor as the nikud glyphs are not aligned correctly (but it is better than nothing).

Hebrew TrueType fonts can be downloaded from here.

In the following, TEXMF is the place of the (local) TeX tree (for example, /usr/local/lib/texmf/), and TMP is some temporary directory you need to create. Steps 1-5 can be done as a regular user, while the other steps need to be done as root.

  1. Create the directory TMP, and chdir into it. Copy (or link) your TrueType fonts to TMP. Download the zip file ttf.zip and extract it into TMP.
  2. Run the python script `ttf.py':

    python ttf.py *.ttf

    If you are unable to run this script, you can manually perform the following steps for each font (you also need to create an empty file called `hebrew.map'). Steps (d) and (e) are optional. These steps are needed for nikud. Step (e) is also needed for ligatures. The instruction are written for the times.ttf font (for other font, you might need to replace winheb2.enc by another encoding file).

    1. Create a tfm file by

      ttf2tfm times.ttf -N -T winheb2.enc -v tmp.vpl htimes.tfm

    2. Get the font name by running

      tf2afm times.ttf | grep FontName

      For the times font, the result is `TimesNewRomanPSMT'

    3. Add the following line to the file `hebrew.map':

      htimes TimesNewRomanPSMT <winheb2.enc <times.ttf

    4. Edit the file `tmp.vpl'. Change the width of each nikud character to 0.

      For example, change

      (CHARACTER O 300(comment sheva)  
         (CHARWD R 333)  
         (CHARDP R 215) )

      to

      (CHARACTER O 300(comment sheva)  
         (CHARWD R 0)  
         (CHARDP R 215) )

    5. Run

    vptovf tmp.vpl tmp.vfm htimes.tfm

  3. Find the file `pdftex.cfg' (using locate), copy it to TMP and add the line

    map +hebrew.map

    to the copy in TMP.

  4. If you don't have the times/arial/courier fonts (or you don't want to use them as default fonts), you need to edit the file `ttfheb.sty'
  5. You can test if everything is OK by running

    pdftex test.tex  
    pdfelatex test2.tex

    (If you don't have the times font you need to edit the `test.tex' file.)

  6. Run `su' to get root access.
  7. Move the file `pdftex.cfg' from TMP to onto the original file.
  8. Move the file ttfheb.sty to the directory of the Hebrew latex files (it should be `TEXMF/tex/generic/babel/hebrew/'. If it is not, you can find this directory with `locate rlbabel.def'.)
  9. Run

    sh install TEXMF

    If you are unable to use this script, perform the following steps manually:

    1. Create a directory called `TEXMF/fonts/truetype/hebrew/',
      and move the .ttf files to this directory.
    2. Create a directory called `TEXMF/fonts/tfm/truetype/hebrew/',
      and move the .tfm files into this directory.
    3. Move the .enc files and `hebrew.map' to `TEXMF/pdftex/'
    4. Run

      mktexlsr TEXMF

  10. The final test: repeat step 5 (as a regular user).

To make a LaTeX document use the TrueType fonts, add the line `\usepackage{ttfheb}' to the preamble (see `test2.tex').