xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas E Deweese <thomas.dewe...@kodak.com>
Subject RE: text width and height
Date Mon, 21 Apr 2003 15:15:04 GMT
>>>>> "IZ" == Ilya Zelker <i.zelker@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


Mime
View raw message