views:

645

answers:

1

Hello everybody,

I'm working on a report that includes an embedded svg diagram. The diagram is drawn using relative coordinates, so when a browser window resizes the diagram resizes pretty well. The only exception there is text - it remains the same. Is it possible to draw text in svg that is resizable?

+1  A: 

I think you have to use a relative size for the font-size. See http://www.w3.org/TR/SVG11/coords.html#UnitIdentifiers. When you use an absolute size like pt or cm, it is automatically calculated what the size must be to display correctly on your monitor, to get that size. But when you use px, the current viewport is used. If you don't specify a unit, the user units are also used as in the example on the linked document:

<text style="font-size: 50">Text size is 50 user units</text>
Wimmel