You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Ilya Zelker <i....@gtisoft.com> on 2003/04/21 17:03:33 UTC

text width and height

Hi All,

I was wondering if it is possible to determine width and height of the text 
in the user units inside java code using some of the batik function. What 
is the best way to do this ?

Thanks a lot,
Ilya


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


RE: text width and height

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "IZ" == Ilya Zelker <i....@gtisoft.com> writes:

IZ> I was wondering if it is possible to determine width and height of
IZ> the text in the user units inside java code using some of the
IZ> batik function. What is the best way to do this ?

    Yes, check out the SVGLocatable interface from the SVG
specification (DOM Interfaces chapter 3).  In Batik you must build the
associated rendering tree (telling it to be dynamic) in order to use
these DOM interfaces (without the rendering tree it doesn't know
anything about fonts, etc...).

    We don't currently have a good example of reading the SVG to build
DOM and then just building the rendering tree so the DOM becomes
'fully functional'.  However the code is present in the slideshow
example (although you will need to tell the Bridge context to be
dynamic).

    You could also 'cheat' and use the JSVGCanvas to 'load' your
document (note that it does things async so you need to register
listeners to know when your document is loaded and parsed etc.).

IZ> Thanks a lot, Ilya


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




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