cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Getting the length of a String in px?
Date Wed, 18 Jul 2001 14:11:32 GMT

Kiril Sramko a écrit :
> Hi, I just started with SVG, cocoon and batik.
> I can't find a solution in the docs for the problem I've got to solve. I need
> to know the length of a string I'm getting from a XML-file in px for the
> width of the generated JPG. Im formating this string with different
> CSS-styles, so I have to account the style.
> Is there a way to generate just the graphic of the string with  a CSS-file in
> the buffer an the detect the width of the graphic?
> Thanks in advance
> Kiril Sramko

You can know the width of a <text> element after it has been rendered
with the getComputedTextLength() method. I used this on the client side
with Adobe's SVG viewer, but I don't know if Batik supports it.

You should try asking on the Batik list since it's more related to SVG
than to Cocoon...
Sylvain Wallez
Anyware Technologies -

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message