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

Mojca Miklavec mojca.miklavec.lists at gmail.com
Sat May 6 08:33:47 CEST 2006


On 5/4/06, Jonathan Kew wrote:
> 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.)

A pitty. I don't know enough about Linux, fontconfig and such, but
isn't it flexible enough, so that it would be possible to tell "him"
that it should look for fonts in the TeX tree as well (only for that
TeX run)? It's very convinient if the users don't need to install
fonts separately and if they could work out-of-the-box once TeX is
installed.

> 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.

This might be macro-packaga-related question, but anyway. The Latin
Modern fonts (Type1, EC encoding) are preloaded OK in ConTeXt. Now how
can I tell to XeTeX that they are EC-encoded. "Everything" works
except for the three special letters that we have in our language when
I compile some of my old files. (I didn't yet figure out how to
replace everything so that Latin Modern would be "preloaded" in their
OpenType version, but I have to learn everything in that direction
anyway.)

> > - 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.

Not, that's not the case. The glyph is not an alternative, but a
letter on its own, just that it doesn't have any standard position in
Unicode (but Adam was right: the glyph is present in the private
area).

> 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.)

I'll acces the glyph with it's "private area number" for now, but that
is surely highly non-portable. Having a \XeTeXnamedglyph command would
be great!

On 5/4/06, Adam Twardoch wrote:

> it was good to see you (and Jonathan!) in Bachotek!

The same to you, Adam! I just didn't expect so many great people being
there as well as the very friendly atmosphere.

> Will Robertson wrote:
>  > As I recall you were complaining how it just doesn't make sense to
>  > have system-installed fonts when your collection has grown to many
>  > thousands. Unfortunately, most of us aren't in that situation :)
>
> That's not the only case. Another case is when you try to use fonts that
> have nominally the same internal font names but are located in different
> locations.

I would fully agree with that. If some base folder could be set at the
top of the document and then only relative paths used later in the
document (even if that happens on the level of macro package), that
might be very useful.

Thanks a lot for all the answers,
    Mojca


More information about the XeTeX mailing list