[XeTeX] \XeTeXglyphbounds question
Will Robertson
wspr81 at gmail.com
Mon Feb 7 12:42:14 CET 2011
On 2011-02-04 23:57:38 +1030, Jonathan Kew
<jfkthame at googlemail.com> said:
> On 4 Feb 2011, at 05:41, Adam Twardoch (List) wrote:
>
>> I could use:
>> \XeTeXcharglyph`f
>>
>> but this only gives me the glyph ID of the *default* glyph for the "f"
>> character. Yet since the font uses contextual alternates, I may end up
>> having any alternate "f" there, depending on the contents of \sampletext
>>
>> So: how do I find out which glyph ID is the first (or 2nd, or last, for
>> that matter) in my box?
>
> Unfortunately, I don't think there's currently any way to do that.
This reminds me that it would also be very useful to be able to
differentiate glyphs when OT features are applied; e.g., if
\XeTeXcharglyph expanded to different values according to the currently
enabled font features (and contrarywise allow you to detect when a
feature doesn't affect a certain glyph).
Is this a fundamental limitation with the means by which XeTeX handles
\XeTeXcharglyph? In a way, it's surprising that
\font\1="[texgyrepagella-regular.otf]" at 12pt
\font\2="[texgyrepagella-regular.otf]:+smcp" at 12pt
\1 a: \the\XeTeXcharglyph`\a /
\2 a: \the\XeTeXcharglyph`\a
would result in the same glyph slot. Or have I fundamentally
misunderstood the concept of "glyph slots"? (I *thought* they were a
unique index to each glyph in a font, but now I'm considering they
could still be affected by substitution features. And in fact that
would make quite a bit of sense.)
Best,
Will
More information about the XeTeX
mailing list