[XeTeX] Anomalies in using feature-enabled OT fonts

Khaled Hosny khaledhosny at eglug.org
Sat Nov 20 23:34:44 CET 2010

On Sun, Nov 21, 2010 at 12:35:35AM +0900, Takayuki YATO (ZR) wrote:
> Thank you for reeponse.
> > > 2. \fontcharwd / \fontcharht / \fontchardp
> > > \font\tgpNorm="TeX Gyre Pagella"       % default
> > > \font\tgpSmcp="TeX Gyre Pagella:+smcp" % small-caps
> > > % There two lines should not report the same measurement....
> > > \tgpNorm\measure{a}\measure{f}\measure{g}
> > > \tgpSmcp\measure{a}\measure{f}\measure{g}
> > > \bye
> > But `a will always resolve too 97, so in all cases you are asking for
> > the metrics of the glyph at 97 slot of the font; the meaning of `a is
> > font independent (will, I don't know the exact terms, some TeX guru
> > would explain better).
> I understand your explanation and admit it's logical. But from the
> grammar of XeTeX I have the impression that XeTeX treats a font with
> some feature enabled as different from the original font; that is,
> there are two distinct fonts \tgpNorm and \tgpSmcp, and the latter has
> small-caps glyphs for lowercase characters. In this view, the glyph at
> slot 97 is different between these "two" fonts. And it is quite natural
> that one expect \fontcharwd, \XeTeXcharglyph, etc. applied to \tgpSmcp
> return the information on the small-caps glyphs.

No, the glyph at slot 97 is still normal lower case a glyph (unless you
are using an old smallcaps font, but that is another story), when you
select a +smcp or any other feature, the engine will then use the
smallcap glyph from its slot (which is not 97 normally) whenever it
encounters a lower case a character. The `a notation is just another way
to pass numbers to TeX (the same is "XXXX notation) and it does not
change its value when you change fonts; `a is always resolved to 97.

> > IMO the only reliable way to check for a specific un-encoded glyph is
> > either by glyph id or glyph name, but both are very unportable.
> If I have ever to go in your view, then the variant of \XeTeXcharglyph
> which returns the id of the glyoh that results from feature application
> seems to me the more desirable. And it would be better if there were
> in addition \XeTeXglyphwd, \XeTeXglyphht and \XeTeXglyphdp. (Are the
> latter two equivalent to \XeTeXglyphbounds 2 and \XeTeXglyphbounds 4?)

I'm not saying it is right or wrong, I'm just trying to understand what
is going on.


 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer

More information about the XeTeX mailing list