[XeTeX] height and depth of characters

Stephen Moye stephenmoye at mac.com
Sat Mar 26 14:02:05 CET 2005


On 26 Mar 2005, at 10:29 PM, Stephen Moye wrote:

> I would certainly like to see a primitive to give height and depth of a given character.

Out of interest, how were you thinking of using it?
I liked the idea of automatically scaling newly selected fonts to have matching x-heights with the surrounding text, and that's when I ran into the limitation.

%%%%%%%%%%%

I wanted to create a large rule that would be just large enough to fit the text; stripped of the other bits and pieces, something like this:

\font\head="Zapfino" at 24pt

\setbox0=\hbox{\head Heading text}
\leavevmode\hbox to 0pt{\vrule width\wd0 height\ht0 depth\dp0\hss}\box0

It would be nice to have something like

\dimen0=\xecharht{\head Heading text} or \dimen0=\xecharht\box0, and \dimen1=\xechardp{\head Heading text} or \dimen0=\xechardp\box0. The width, of course, is no problem.

Just a thought.

Cheers.

Stephen



More information about the XeTeX mailing list