Re: Obtaining bounding box for glyphs

Thomas DeWeese wrote:
> I suppose in mathML layout there may be some reason you want to know the true glyph
> geometry bounds

If nothing else, you absolutely need glyph geometry bounds to get 
reasonable-looking superscripts and subscripts (this requires knowing 
the ascent and descent of individual glyphs).

Note that there are other reasons one might want to know bounding boxes 
even in a non-MathML context; doing drop-caps well requires that 
information, for example.

>    I think the BBox is intended to be calculated using the
> advance, ascent, descent.

That doesn't work.  For example, if you have a standard English font the 
bounding box this procedure would give for an "x" would extend as far 
below the baseline as the one for a "g" (Since the ascent/descent are 
per-font-face, not per-glyph).

> If you want to do a really good job
> you should also look at the hkern elements which will adjust the
> horiz-adv-x based on text context.

That doesn't help with the vertical issues, though.

-Boris

Received on Friday, 10 June 2005 11:51:23 UTC