W3C home > Mailing lists > Public > www-svg@w3.org > February 2007

Re: A definition for "character cell" is not provide in the spec

From: Chris Lilley <chris@w3.org>
Date: Thu, 8 Feb 2007 02:56:33 +0100
Message-ID: <794403738.20070208025633@w3.org>
To: Jonathan Watt <jwatt@jwatt.org>
Cc: Doug Schepers <doug.schepers@vectoreal.com>, www-svg@w3.org

On Thursday, February 8, 2007, 2:37:02 AM, Jonathan wrote:

JW> Doug Schepers wrote:
>> I'm pretty sure we cover this in the SVG 1.1 spec (although we normally 
>> describe it in terms of bounding boxes rather than glyph cells).  It's 
>> kind of scattered throughout the spec, but it's perhaps most explicit 
>> here [1].

JW> I really can't see how "character cell"/"glyph cell" can be
JW> equated with "bounding box" based on any version of the spec.
JW> (BTW, can the spec choose one of the former two terms and stick
JW> with it please - assuming "character cell" and "glyph cell" are
JW> actually interchangeable of course!)


They aren't interchangable.

The (misnamed) character cell, also termed the em square, is the
design space of all the glyphs in a font. So its constant in size for
a given font; its then scasled uniformly to the size at which the text
is set.

A glyph cell is the bounding box of an individual glyph. Even for
Latin text these vary, depending on
whether the glyph has descenders (like j, g, y) ascenders (d,t)  or
neither (a, e, o). Once on adds an accent or tone mark, or indeed
multiple of them as with Vietnamese or (IIRC) Thai, its clear that
they vary a lot. And of course they cary in with too, compare i and w
in a proportional font.

The text bounding box is the box that bounds the individual glyph
cells of a particular text string.

JW>  Even Tiny 1.2 seems to
JW> consider "bounding box" to be a separate things [3] ("Elements that do not
JW> derive from SVGLocatable do not have a bounding box,..." which even excludes
JW> tspan from having a bounding box). Glyph cells may _contribute_ to bounding
JW> boxes, sure. But SVG 1.1 doesn't in any way equate them in my opinion, and
JW> NEITHER SHOULD it.

JW> By the way, I don't think "scattered throughout the spec" is an acceptable way
JW> to define a term. Terms used should be clearly defined in a single place that's
JW> dedicated to defining the said term (and can be linked directly).

Fair enough.

>> We take it a step further in SVG Tiny 1.2, where we unify and clarify 
>> the various discussions of bounding box [3],

JW> Defining the term "glyph cell" inside the definition for "bounding box" is the
JW> wrong place to do it. In my opinion this sentence:

JW>    For example, for horizontal text, the calculations must assume
JW>    that each glyph extends vertically to the full ascent and descent
JW>    values for the font.

Which is therefore talking of the em square, not the glyph cell.

JW> should be removed and a definition for "glyph cell" should be given _alongside_
JW> the definition for "bounding box" (not in it).

JW> Besides that, the above sentence is ambiguous. Does "full ascent and descent"
JW> refer to the full ascent and decent of the specific glyph in question from the
JW> font (in which case the glyph cells will vary in height along a string of text)
JW> or to the _maximum_ ascent and decent of all glyphs in a font (the 
JW> interpretation I'd prefer).

The latter.






-- 
 Chris Lilley                    mailto:chris@w3.org
 Interaction Domain Leader
 Co-Chair, W3C SVG Working Group
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG
Received on Thursday, 8 February 2007 01:56:52 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:36 GMT