[XeTeX] accessing fonts from TeX tree and glyphs without Unicode slot

Jonathan Kew jonathan_kew at sil.org
Thu May 4 14:47:11 CEST 2006


On 4 May 2006, at 1:47 pm, Mojca Miklavec wrote:

> Hello,
>
> I have two questions about fonts in XeTeX:
>
> - Is it possible to use OpenType fonts that reside in TeX tree instead
> of having to install them to the system first? (There are dozens of
> Latin Modern fonts for example that I never use otherwise.)

Hello Mojca, and welcome to the list! :)

No, at present there's no way to do this. XeTeX can only "see"  
Unicode/OpenType fonts if they are available through Fontconfig. (You  
could modify your fontconfig configuration files to make it look at  
the TeX tree as well as standard X11 locations, but then the fonts  
will show up in other GUI applications as well, which you probably  
want to avoid.)

(This is the Linux version of the answer, of course; on OS X, font  
installation is a little different, but the end result is the same.)

Of course, XeTeX should be able to use the .pfb versions of LM fonts  
through the usual .tfms, etc., but then you don't get the benefits of  
working with Unicode and OpenType.

> - How can I access the glyphs which are not part of Unicode (I know
> the name of the glyphs, but that letters don't exist in Unicode)?
> (OpenType)

If the glyphs are variants that relate to a particular OpenType  
feature (such as small caps, superiors, swash forms, etc.), the best  
way is to load the font with the proper feature enabled; then the  
Unicode character will be converted to the right glyph.

To access an arbitrary glyph without relying on a Unicode character  
code or OpenType feature at all, you can use the \XeTeXglyph command,  
which expects a glyph number (not name, sorry). But remember that  
glyph IDs are extremely non-portable, and may change even between  
versions of the same font, so I consider this a "last resort". But it  
does allow you to print a glyph which is not accessible any other way.

(Perhaps \XeTeXnamedglyph would be a good extension for a future  
version, as glyph names would be more likely to work even if you  
change or update the fonts. I'll give that some thought.)

JK




More information about the XeTeX mailing list