W3C home > Mailing lists > Public > public-svg-wg@w3.org > January to March 2009

RE: Bounding box when textArea width or height is set to 'auto'

From: Niklas Hagelroth <niklas.hagelroth@ikivo.com>
Date: Thu, 12 Feb 2009 09:23:45 +0100
Message-ID: <234EB4699C751A4A95DF4FD8D041BBFD012DE504@SESTHSRV10.zoomon.local>
To: "Doug Schepers" <schepers@w3.org>
Cc: "SVG Working Group WG" <public-svg-wg@w3.org>

Hi Doug,

Thank for your reply, see answers below.


> Doug Schepers wrote:
> Hi, Niklas-
> Niklas Hagelroth wrote (on 1/26/09 8:03 AM):
> >
> > Can you please confirm our interpretation around getBBox on a
> > element which has width or height set to "auto", since that is not
> > specifically mentioned anywhere in the specification.
> Right.  We do describe the general case for the bbox for <textArea>,
> not that specific case.
> [[
> For text content elements, for the purposes of the bounding box
> calculation, each glyph must be treated as a separate graphics
> The calculations must assume that all glyphs occupy the full glyph
> For example, for horizontal text, the calculations must assume that
> glyph extends vertically to the full ascent and descent values for the
> font. An exception to this is the 'textArea', which uses that
> geometry for the bounding box calculation.
> ]]
> We should errata wording along the lines of:
> [[
> An exception to this is the 'textArea', which uses that element's
> geometry for the bounding box calculation.  In the case of a
> element with a 'width' or 'height' attribute value of "auto", that
> dimension of the bounding box is determined as with other textual
> ]]
> Would this solve your issue?


> > Our interpretation is that the actual bounding box of the
> > text should be returned, NOT (x, y, infinite, infinite). Do you
> Yes, more or less.  There is an open question what role the
> 'line-increment' attribute plays in this in conjunction with the
> <tbreak> element.
> For example:
> <svg ...>
>   <textArea font-size="25" font-family="Georgia" x="0" y="0"
>             width="200" height="300" line-increment="1.5">
>     This is the first line<tbreak/>and this is the second line.
>   </textArea>
> </svg>
> It seems pretty clear that the bbox height should be around 75px (if I
> did my calculations right... you get the picture), but we wanted to
> sure that this is what implementations do.  Is this the case for both
> Ikivo and BitFlash?

Yes, if you meant to have height="auto" in your example? Otherwise it
would be 300 as specified.

> > Also, all other values than "TOP|LEFT" for text anchor & display
> > will disable rendering when width and height are set to "auto"?
> Yes, this seems reasonable, and worthy of another errata.
> Thanks for pointing out all these ambiguities.  We should issue errata
> on all these points.
> [1] http://www.w3.org/TR/SVGTiny12/coords.html#BoundingBox
> Regards-
> -Doug Schepers
> W3C Team Contact, SVG and WebApps WGs
Received on Thursday, 12 February 2009 08:24:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:20:10 UTC