cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
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 - http://www.anyware-tech.com

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message