W3C home > Mailing lists > Public > www-svg@w3.org > April 1999

Problems with SVG's CSS properties

From: Ian Hickson <py8ieh@bath.ac.uk>
Date: Thu, 22 Apr 1999 04:01:17 +0100 (BST)
To: SVG <www-svg@w3.org>
Message-ID: <Pine.GSO.4.04.9904220339310.19505-100000@amos.bath.ac.uk>

There are a few problems with SVG and its use of CSS properties.


This property is now defined in both SVG and CSS2. In CSS2 it is used
for changing the case of text, in SVG it is a text analogue of the
'transform' property. The SVG working group may wish to consider
renaming the SVG 'text-transform' property, since the CSS property may
be of use in SVG as well.

'font' shorthand property

Because SVG uses different conventions for <length>, in particular
because it allows unit-less numbers, the CSS2 'font' shorthand
property will be unparsable in SVG. For example, how should the
following be handled?

   #heavy { font: 900 large sans-serif; }

According to the CSS specification, the '900' keyword will be parsed
as the 'font-weight' value, the 'large' keyword will be parsed as the
'font-size' value, the 'sans-serif' keyword will be parsed as the
'font-family' value, and all other font properties will be set to
their initial values.

However, in SVG '900' is a valid font-size, and so the above rule is
ambiguous: as well as the interpretation above, another, equally valid
interpretation is that '900' is the 'font-size' (900 user units), and
'large sans-serif' is the 'font-family'.

Two possible solutions are to either not use the 'font' shorthand
property in SVG, or to give user units a unit specifier such as 'uu'.


There appears to be overlap between the SVG 'text-direction' property
and the CSS2 'direction' property. The SVG working group may wish to
use the name 'direction' instead of 'text-direction', and then extend
the allowed values in SVG.

text formatting

The current spec states that:

# The standard set of text and font properties from CSS2 apply,
# including 'text-align' and 'vertical-align'.

How is 'vertical-align' to be applied? In CSS, 'vertical-align' has a
pivotal role in the inline level formatting model. Will SVG use the
entire CSS inline level formatting model? This seems like serious
overkill since SVG uses a much more direct approach to layout (namely,
giving x and y coordinates).

Exactly which font text and font properties will SVG borrow from CSS2? 

For example, will any of the following be used?

Note that if 'text-decoration' is used, then it will have to be
defined much more precisely than in CSS if results are to be reliably
reproduced across implementations.

Ian Hickson 
U+2642 U+2651
U+262E U+2603 U+263A
Received on Wednesday, 21 April 1999 23:01:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:53:47 UTC