[reportlab-users] SVG font-size values lack units (invalid CSS)

Peter peter at maubp.freeserve.co.uk
Mon Feb 16 13:10:47 EST 2009


On Mon, Feb 16, 2009 at 5:59 PM, Robin Becker <robin at reportlab.com> wrote:

>

> Peter wrote:

> ........

>>

>> The images don't look identical to those from the PNG output from

>> renderPM (the fonts sizes differ a little), but this does look pretty

>> close and it now works on all the browsers I have tested.

>>

> well I just looked at the definitions currently being talked about for svg

> 1.1 and font-size appears here

>

> http://www.w3.org/TR/SVG11/propidx.html

>

> there the allowed value types for font-size are

>

> <absolute-size> | <relative-size> | <length> | <percentage> |

> inherit

>

>

> and following the link for length gives this definition ...


I think you are reading the spec for the font-size attribute where I
agree the units are optional, and from me testing all the browsers
cope. e.g. <text font-size="10">Hello World!</text>
(I'm not sure what the units used are - this is another reason for us
to be explicit if we can be.)

The current renderSVG (and my suggested small change) doesn't use the
font-size attribute but instead supplies an bit of CSS to the style
attribute where units *are* required. e.g <text style="font-size:
10pt;">Hello World!</text>

Peter


More information about the reportlab-users mailing list