[XeTeX] \XeTeXglyphbounds question

Adam Twardoch (List) list.adam at twardoch.com
Fri Feb 4 06:41:50 CET 2011


(Plain XeTeX, not XeLaTeX).

Imagine I use a font which uses contextual alternates such as:


\font\samplefont = "Zapfino Extra LT Pro:+calt" at 72bp

\samplefont

\def \sampletext{finality}
\XeTeXuseglyphmetrics=1

\setbox1 \hbox{\sampletext \/}


So now, XeTeX has produced a box which has a series of glyph IDs. The
left edge of the box is at the origin point of the "f" glyph. I want to
add extra padding on the left through the use of

\XeTeXglyphbounds1


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?


Best,
Adam



More information about the XeTeX mailing list