Bibek Sahu wrote:

Hi Bibek,

I'm currently working on an SVG editor based on Batik, as part of some
educational software.  Currently, I'm trying to figure out some stuff about
editing text.

What I'm wondering is: how do I modify formatted text inside an SVG, from
Java code?

The reason I'm stuck is because when working with GraphicsNodes (TextNodes,
specifically), only one is accessible for an entire text element, even when
that text element contains sub-elements (textPath, tspan, tref, etc.).  I
can use TextNode.getTextRuns() to get the list broken down as a list of
StrokedTextPainter.TextRun objects, which is sufficient for displaying them,
but as near as I can tell there's no way to get the SVGElements which
they're tied to (which is necessary to manipulate them).

There is an attribute in the AttributedString associated with a TextNode called TEXT_COMPOUND_DELIMITER. This is a reference to the Element that generated that character in the AttributedString (see runLimit on attributed string).

   There is a decent chance that I may change this attribute to
be a SoftReference to the element.

Am I barking up the wrong tree?  Should I be watching for DOM events
instead?

I would tend to lean this way. If you want to manipulate the DOM using the DOM events is almost always the way to go. It automatically does the above handling for you.

Any help would be greatly appreciated.

Thanks!

- Bibek


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to