font-size in percentage ambiguous?

Dear all,

I'm rather new to SVG, so please correct me on any clear misconceptions.

I'm confused by the specification of font-size expressed in percentages, 
and various viewers indeed render my documents differently.

The specification of font-size links to two relevant documents 'Units' 
and 'CSS2-font-size':

http://www.w3.org/TR/SVG/text.html#FontSizeProperty

If a <length> is provided with one of the unit identifiers (e.g., 12pt 
or 10%), then the SVG user agent converts the <length>  into a 
corresponding value in the current user coordinate system by applying 
the rules described in Units.

Except for any additional information provided in this specification, 
the normative definition of the property is in [ CSS2-font-size].


The specification for percentage values in the 'Units' 
(http://www.w3.org/TR/SVG/coords.html#Units) section says:

....
For any other length value expressed as a percentage of the viewport, 
the percentage is calculated as the specified percentage of 
sqrt((actual-width)**2 + (actual-height)**2))/sqrt(2)
....


The specification of CSS2-font-size 
(http://www.w3.org/TR/REC-CSS2/fonts.html#propdef-font-size) says:

A percentage value specifies an absolute font size relative to the 
parent element's font size. Use of percentage values, or values in 
'em's, leads to more robust and cascadable style sheets.


If I am not mistaken, these definitions can (and often do) lead to a 
different outcome.

The latest working draft for SVG Tiny 
(http://www.w3.org/TR/2008/WD-SVGMobile12-20080915/single-page.html#text-TextElement)
seems to have noticed that:

[font-size]
This property refers to the size of the font from baseline to baseline 
when multiple lines of text are set solid in a multiline layout 
environment. The SVG user agent processes the <length> as a height value 
in the current user coordinate system. Percentage values are not supported.


Best regards,
   Ondrej.

-- 
Ondrej Bojar (mailto:obo@cuni.cz / bojar@ufal.mff.cuni.cz)
http://www.cuni.cz/~obo

Received on Friday, 26 September 2008 08:56:47 UTC