W3C home > Mailing lists > Public > www-svg@w3.org > July 2010

Re: letter-spacing with text-anchor middle

From: Erik Dahlstrom <ed@opera.com>
Date: Fri, 09 Jul 2010 13:37:20 +0200
To: "Tavmjong Bah" <tavmjong@free.fr>
Cc: "www-svg@w3.org" <www-svg@w3.org>
Message-ID: <op.vfkqkgubgeuyw5@localhost>
On Fri, 09 Jul 2010 13:00:27 +0200, Tavmjong Bah <tavmjong@free.fr> wrote:

>> Opera supports letter-spacing, however the unit (px in this case) must  
>> be
>> specified if it's in a stylesheet or style attribute. Chrome seems to  
>> not
>> require the unit to be specified though, which is a bit odd.
> I am having trouble seeing why Opera requires a unit in the case of a
> style attribute.

Not just Opera, it's the same in Gecko too. It's easily testable by  
inspecting the browser's error console to see if the declaration was  

> The spec explicitly discusses what to do if no unit is
> given for letter-spacing.

In CSS the only <length> value that is allowed to not have a unit is 0.

> Also, 7.10 (Units) gives an example in the
> case of font-size where a unit is not given.


> Inkscape always puts a unit on 'font-size'. There is a comment in the
> output code for 'font-size':
> 	// must specify px, see inkscape bug 1221626, mozilla bug 234789

It's the same for any property that uses CSS <length>, e.g  

> I can't find Inkscape bug 1221626 (Inkscape's changed the bug keeping
> system since that bug was submitted) and the Mozilla bug refers to a
> 2004 discussion where they grapple with how to resolve CSS and SVG spec
> differences. It wouldn't be hard for Inkscape to add the unit to avoid
> problems but that doesn't answer the question of why Opera requires it.

The contents of a style attribute is CSS, and CSS requires units, see:


For external stylesheets and the content of <svg:style> elements it's the  
same thing, CSS defines the syntax, not SVG.


Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Friday, 9 July 2010 11:37:56 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:21 UTC