Re: should textLength="0" disable rendering?

On 09-07-13 03:58, Cameron McCormack wrote:
> Tab Atkins Jr. wrote:
>> If something is a number - that is, it accepts decimal quantities,
>> rather than just integers - you should make sure that all of your
>> ranges are closed, rather than open.
>>
>> For example, behavior can be defined for values "0 and up", but not
>> "above 0", because that's an open range - in includes every value
>> greater than zero, but not zero itself.
> 
> I think that argues for having textLength="0" mean nothing gets
> rendered, since it is as if the text is squished down to nothing.  At
> least for lengthAdjust="spacingAndGlyphs".  For lengthAdjust="spacing",
> we'll just apply whatever we decide to handle the "textLength is less
> than the width of the widest glyph in the text" behaviour.

That depends. As far as I can see the spec isn't completely clear on how
glyphs should be stretched. If any stroke gets stretched along with the
glyphs (or if only a fill is applied, as is not uncommon), then indeed
nothing would be rendered. On the other hand, if the glyphs are
stretched /before/ stroking, then textLength="0" would typically show a
a short vertical line (assuming lengthAdjust="spacingAndGlyphs", and
depending on the orientation of the text obviously).

To echo the comments made before, I would recommend /not/ special-casing
the value "0". Just do whatever you would normally do and make sure it
doesn't blow up in your face if you give it a zero length. If you really
need to special case it for some reason, just look at what happens when
you use textLength="0.00001" or something.

Received on Tuesday, 9 July 2013 07:03:49 UTC