# How to use 256-glyphs font in XeTeX

I know a good font for (La)TeX. This is 256-glyphs non-Unicode LH-fonts. I use XeTeX with Unicode encoding. There are many chars with codes above 256. XeTeX currently doesn't know which glyphs are present in such fonts. How to map these Unicode codes to glyph slot codes between 128 and 255? I want something like that.

Macro \glyphcode does not exist. But I would like

\font\lh = larm1000
\glyphcode \lh \п = 239
\lh п


To print "п" by "larm1000"-font XeTeX must use 239 glyph from larm1000 rather than Unicode code. I know bad workaround

\catcode\п = 13 \def п{\char239 }


But I want letters to have 11 catcode.

• You can use such fonts the same way you used them with 8-bit TeX engines. – Khaled Hosny Jan 16 '13 at 16:01
• Yes, of course. But I want to use utf8. I need some chars like ≤ ≥ ∑ ∆ √ ∫ ˚ … – Alexey Malistov Jan 16 '13 at 16:17
• You can probably use xetex-inputenc for that. – Khaled Hosny Jan 16 '13 at 20:53
• Unfortunately, it seems that character mapping like mapping=tex-text cannot be applied to fonts in TFM format, which instead I hoped for. But the LA fonts are incorporated in the CMUnicode fonts that are available in TeX Live – egreg Jan 16 '13 at 20:59
• egreg! That's it! CMUnicode. – Alexey Malistov Jan 16 '13 at 21:34

You can't apply mapping=tex-text or any other mapping to legacy TFM fonts in XeTeX (while those fonts can still be used in the traditional way also with XeTeX).

There are OpenType clones of the Computer Modern fonts that include also Cyrillic glyphs, issued by the CM-Unicode project, present also on CTAN and included in TeX Live.

So

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{CMU Serif}


should be what you need. The font file name is cmunrm.otf if you need to call it in this way.

• For me it shown an error with name "CMU Serif". When I changed the name to "cmunrm.otf, it worked. – user4035 Jan 7 at 12:10
• @user4035 are you on Mac OS? XeTeX by default does not see the fonts provided by TeXLive, except if you use filenames. – user4686 Jan 7 at 14:04
• @jfbu It's easy to copy the font files to /Library/Fonts. – egreg Jan 7 at 14:10
• That is indeed the simplest way. Personally I use symlinks to texmf-dist/fonts/opentype and texmf-dist/fonts/truetype from ~/Library/Fonts but I have to open the FontBook from time to time to let it update its database when TeXLive updates things (or so I think). – user4686 Jan 7 at 14:15
• @jfbu No, on Linux Slackware 14.2, TexLive 2016. – user4035 Jan 7 at 15:55