[XeTeX] height and depth of characters

Stephen Moye stephenmoye at mac.com
Sat Mar 26 14:32:58 CET 2005


 
On Saturday, March 26, 2005, at 08:19AM, Will Robertson <will at guerilla.net.au> wrote:

>On 26 Mar 2005, at 11:32 PM, Stephen Moye wrote:
>
>> 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:
>
>One thing I've never worked out about techniques like this is that 
>characters often *don't* fit exactly to their bounding boxes. (At least 
>Knuth's don't...maybe he was an exception. Haven't taken the time to 
>check.)
>
>Maybe it's not bounding boxes we care about, but rather the maximum 
>height/depth and left/right protrusion of each character. This sounds 
>like a potentially more difficult problem to solve.
>
>(Having said that, specific alphabetic x-heights are still of interest 
>to me for scaling alphabets to the same height...)

I agree about the issue of exact fit. When I said there were some bits and pieces left out, they were largely concerned with finagles to get the final result to look the way I want. Zapfino is a particularly difficult example of this sort of thing.

In the course of a shower (where I do my best thinking, by the way) I thought of a better interface for the sort of thing I'd like. Instead of:

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

have this:

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

 (seems more idiomatic) in which case something like \xexht0, presumably returning the x-height of the prevailing font, would be nice. I could certainly use something like that in some accent-like situations.



More information about the XeTeX mailing list