Re: Obtaining bounding box for glyphs

Nikolai Grigoriev wrote:

> I am building a MathML-to-SVG renderer, and want to add support
> for SVG fonts. To do this, I need to access font metrics: in particular,
> I need bounding box data for individual glyphs. 

    Why do you need glyph bounding boxes?  Normally text layout is done
using the font ascent, descent and advance - these are all easily
accessible from the font-face element (ascent, descent) and
the individual glyph elements (horiz-adv-x).  I suppose in mathML
layout there may be some reason you want to know the true glyph
geometry bounds, but this seems very suspect to me.

> Putting the question more generally - what is the rationale behind 
> exclusion of bbox data? It really precludes using SVG fonts as sources
> of metric info in applications like mine. And I feel pretty strange 
> recoding an SVG font into a legacy AFM...

    I think the BBox is intended to be calculated using the
advance, ascent, descent.  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.

    I hope that helps...

Received on Friday, 10 June 2005 10:00:49 UTC