Search code examples
latexfontstexxetex

TeX Font Mapping


I am using a package written on top of XeLaTeX. This package uses fontspec to specify fonts for different parts of your text: latin, non-latin, math mode, ...

The package comes with several sample files. I was able to xelatex most of them that depend on regular ttf or otf files. However, one of them tries to set the font of digits in math mode to some font, say "NonLatin Digits". But, the font doesn't seem to be a regular font. There are two files in the same directory called "nonlatindigits.map" and "nonlatindigits.tec". TECkit uses these mapping files to generate TeX fonts. However, for some reason it fails to create the files, and xelatex issues the following error message.

 kpathsea: Invalid fontname `NonLatin Digits', contains ' '

 ! Font \zf@basefont="NonLatin Digits" at 10.0pt not loadable: Metric (TFM) file or
 installed font not found.

The kpathsea program complains about the whitespace, but removing the whitespace does solve the problem with loading the TFM file.

Any clues what I am doing wrong?


Solution

  • What's the actual font file name? There have been discussions recently on the XeTeX mailing-list, about a bug that prevented from loading font files with spaces in their names on Windows (look for it in the archives). If changing the file name works for you, you may have just run into this bug.

    The kpathsea invocation you see is only a side effect: it indicates that the font hasn't been found by the system libraries that XeTeX uses on top of TeX's default font lookup system, and XeTeX falls back to looking up a TFM file, the most basic file format.

    TECkit has nothing to do with fonts, it converts characters on the fly; in your case, I guess you could use a mapping to convert, say, Arabic numbers to Indic numbers (so that you don't need to input the latter in your source file directly). But it does not generate fonts in any way whatsoever.