W3C home > Mailing lists > Public > www-svg@w3.org > December 2011

Re: Text metrics with display:none

From: Brian Birtles <bbirtles@mozilla.com>
Date: Fri, 16 Dec 2011 16:42:00 +0900
Message-ID: <4EEAF648.50202@mozilla.com>
To: Cameron McCormack <cam@mcc.id.au>
CC: 'www-svg' <www-svg@w3.org>
(2011/12/08 12:56), Cameron McCormack wrote:
> Here is my go at a proposed behaviour:
> * The indices that these methods work on are the textContent-like indices.
> * When getSubStringLength includes characters that correspond to glyphs
> that are not rendered due to display:none (or say because they've fallen
> off the end of a <textPath>), then these characters don't contribute to
> the string length. In an extreme case, calling getSubStringLength on
> <text display="none">abc</text> returns 0.
> * getStartPositionOfChar and getEndPositionOfChar return NaN when given
> a character index that corresponds to a glyph not being displayed.
> * getExtentOfChar returns 0 when given a character index that
> corresponds to a glyph not being displayed.
> I choose 0 for getExtentOfChar to be consistent with getSubStringLength
> just ignoring the non-displayed characters.

Hi Cameron,

Sorry to take so long to get back to you. Yes this looks great. One area 
I'd just to clarify is getExtentOfChar which returns an SVGRect. By 
"returns 0" does that mean { x:0, y:0, width:0, height: 0 } ?

Or do the x and y values correspond to something else? e.g. the x and y 
values of the previous glyph plus the glyph's advance (as defined in 
10.7.1)? i.e. *roughly* where the glyph would go?

I gather from the telcon on 8 Dec that there was some talk about 
throwing an exception instead?[1]



[1] http://www.w3.org/2011/12/08-svg-minutes.html#item02
Received on Friday, 16 December 2011 07:42:32 UTC

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