W3C home > Mailing lists > Public > www-svg@w3.org > June 2005

Obtaining bounding box for glyphs

From: Nikolai Grigoriev <grigoriev@comtv.ru>
Date: Fri, 10 Jun 2005 01:03:56 +0400
Message-ID: <009601c56d36$e07ae860$d300a8c0@Madagascar>
To: <www-svg@w3.org>

Dear SVG editors,

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. It is easily obtainable 
from AFMs or TrueType/OpenType font files; but there is no place 
to store it in an SVG font. SVG 1.1 spec explicitly refuses to provide 
bbox values for either glyphs or entire fonts (section 20.2). (The refusal 
looks like an overstatement - at least for the font bounding box, there
is a 'bbox' attribute on 'font-face'. Helas, for individual glyph, no such
expedient exists).

Looks like I need to run an SVG rendering engine in order to compute 
bounding boxes -- definitely not an option for a modest Python script.
On the other hand, support for SVG fonts in a MathML-to-SVG 
converter looks too appealing to discard it easily. What shall I do?
Perhaps run an external application, and build an AFM out of the 
SVG font? Is anyone aware of a tool for this? 

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...

Nikolai Grigoriev 
Received on Thursday, 9 June 2005 21:05:05 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:06 UTC