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 Phil Wright <ph...@gmail.com> on 2006/11/19 21:43:49 UTC
Editable Text Fields
In the SVG 1.2 specs (
http://www.w3.org/TR/2004/WD-SVG12-20041027/text.html) there is
mention of Editable Text Fields for "text" and "flowDiv"
elements.
Does Batik support this?
If so, after I set the "editable" attribute to "true" on a flowDiv element,
then what? Are there events I need to get?
If Batik doesn't support editable text elements can someone point me in a
direction for providing editable text elements in a presented SVG document?
Is there any example code out there for dynamically modifying a displated
text element?
Thanks!
Phil
--
Visit http://www.darkisle.com for photos of castles, cairns and other
historic sites in the British Isles.
Re: Editable Text Fields
Posted by Phil Wright <ph...@gmail.com>.
Hi Thomas,
Wasn't really expecting true WYSIWYG but it seems to be a lot farther off
than I expected.
A 20-25% difference in the length of a rendered font is not really a subtle
difference.
I'm using a font-family callout and maybe the actual font being used is
different between the JTextArea rendering and the JSVGCanvas. Guess I'll
play around with different fonts until I find some that render near the same
on both.
Thanks,
Phil
On 11/26/06, thomas.deweese@kodak.com <th...@kodak.com> wrote:
>
> Hi Phil,
>
> "Phil Wright" <ph...@gmail.com> wrote on 11/23/2006 09:57:07 AM:
>
> > I have this working but I'm not getting a very good match between what
> is seen
> > in the JTextArea and what is seen once I transfer it to the SVGCanvas?
>
> I think you need to give up on WYSIWYG editing with the JTextArea.
> The fonts on the canvas are always a bit (or more) heavier in weight and
> so the
> > corresponding strings are longer. This can make them wrap differently
> between
> > the JTextArea and SVGCanvas.
>
> Probably this is due to subtle differences in the font size.
>
> > On 11/20/06, Urs Reupke <ur...@gmx.net> wrote:
> > Hi Phil,
> > >> What would be a lot easier would be to take the text and
> > >> put it in a JTextArea component.
> > > I can add a JTextArea to an SVGCanvas?
> > I'm not sure that's possible. What you can do, however, is using the
> > JGlassPane as an overlay over your canvas add the JTextComponent there.
> >
> > Unfortunately, I don't use that method any longer, so I can't provide
> > you with code samples, but I'm sure someone else can help you out.
> >
> > -Urs
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
> >
> >
> >
> > --
> > Visit http://www.darkisle.com for photos of castles, cairns and other
> historic
> > sites in the British Isles.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>
--
Visit http://www.darkisle.com for photos of castles, cairns and other
historic sites in the British Isles.
Re: Editable Text Fields
Posted by th...@kodak.com.
Hi Phil,
"Phil Wright" <ph...@gmail.com> wrote on 11/23/2006 09:57:07 AM:
> I have this working but I'm not getting a very good match between what
is seen
> in the JTextArea and what is seen once I transfer it to the SVGCanvas?
I think you need to give up on WYSIWYG editing with the JTextArea.
> The fonts on the canvas are always a bit (or more) heavier in weight and
so the
> corresponding strings are longer. This can make them wrap differently
between
> the JTextArea and SVGCanvas.
Probably this is due to subtle differences in the font size.
> On 11/20/06, Urs Reupke <ur...@gmx.net> wrote:
> Hi Phil,
> >> What would be a lot easier would be to take the text and
> >> put it in a JTextArea component.
> > I can add a JTextArea to an SVGCanvas?
> I'm not sure that's possible. What you can do, however, is using the
> JGlassPane as an overlay over your canvas add the JTextComponent there.
>
> Unfortunately, I don't use that method any longer, so I can't provide
> you with code samples, but I'm sure someone else can help you out.
>
> -Urs
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>
>
> --
> Visit http://www.darkisle.com for photos of castles, cairns and other
historic
> sites in the British Isles.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Editable Text Fields
Posted by Phil Wright <ph...@gmail.com>.
I have this working but I'm not getting a very good match between what is
seen in the JTextArea and what is seen once I transfer it to the SVGCanvas?
The fonts on the canvas are always a bit (or more) heavier in weight and so
the corresponding strings are longer. This can make them wrap differently
between the JTextArea and SVGCanvas.
Any suggestions?
Phil
On 11/20/06, Urs Reupke <ur...@gmx.net> wrote:
>
> Hi Phil,
> >> What would be a lot easier would be to take the text and
> >> put it in a JTextArea component.
> > I can add a JTextArea to an SVGCanvas?
> I'm not sure that's possible. What you can do, however, is using the
> JGlassPane as an overlay over your canvas add the JTextComponent there.
>
> Unfortunately, I don't use that method any longer, so I can't provide
> you with code samples, but I'm sure someone else can help you out.
>
> -Urs
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>
--
Visit http://www.darkisle.com for photos of castles, cairns and other
historic sites in the British Isles.
Re: Editable Text Fields
Posted by Phil Wright <ph...@gmail.com>.
Hi Urs,
On 11/20/06, Urs Reupke <ur...@gmx.net> wrote:
>
> >> What would be a lot easier would be to take the text and
> >> put it in a JTextArea component.
> > I can add a JTextArea to an SVGCanvas?
> I'm not sure that's possible. What you can do, however, is using the
> JGlassPane as an overlay over your canvas add the JTextComponent there.
Ahh. I think I know how to do that.
Thanks,
Phil
--
Visit http://www.darkisle.com for photos of castles, cairns and other
historic sites in the British Isles.
Re: Editable Text Fields
Posted by Urs Reupke <ur...@gmx.net>.
Hi Phil,
>> What would be a lot easier would be to take the text and
>> put it in a JTextArea component.
> I can add a JTextArea to an SVGCanvas?
I'm not sure that's possible. What you can do, however, is using the
JGlassPane as an overlay over your canvas add the JTextComponent there.
Unfortunately, I don't use that method any longer, so I can't provide
you with code samples, but I'm sure someone else can help you out.
-Urs
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Editable Text Fields
Posted by Phil Wright <ph...@gmail.com>.
Hi Thomas,
> In the SVG 1.2 specs (
> http://www.w3.org/TR/2004/WD-SVG12-20041027/text.html )
> > there is mention of Editable Text Fields for "text" and "flowDiv"
> elements.
> >
> > Does Batik support this?
>
> No and the WG has moved in a different direction. They still suggest
> the use of the 'editable' attribute for text fields but all the flow
> stuff is out the window.
Bummer. Seemed like it would have been perfect.
What would be a lot easier would be to take the text and
> put it in a JTextArea component.
I can add a JTextArea to an SVGCanvas?
Phil
--
Visit http://www.darkisle.com for photos of castles, cairns and other
historic sites in the British Isles.
Re: Editable Text Fields
Posted by th...@kodak.com.
Hi Phil,
"Phil Wright" <ph...@gmail.com> wrote on 11/19/2006 03:43:49 PM:
> In the SVG 1.2 specs (
http://www.w3.org/TR/2004/WD-SVG12-20041027/text.html )
> there is mention of Editable Text Fields for "text" and "flowDiv"
elements.
>
> Does Batik support this?
No and the WG has moved in a different direction. They still suggest
the use of the 'editable' attribute for text fields but all the flow
stuff is out the window.
> If Batik doesn't support editable text elements can someone point me in
a
> direction for providing editable text elements in a presented SVG
document?
> Is there any example code out there for dynamically modifying a
displated
> textelement?
There might be, but I don't know of any off the top of my
head. Providing an editable text element in SVG would be
a fairly large amount of script work, especially if you
wanted to support cut and paste, selection etc. The TextContent
interfaces probably give you everything you need but it
would be a lot of work.
What would be a lot easier would be to take the text and
put it in a JTextArea component. When the user signals they
are done (perhaps by clicking outside the TextArea component)
the contents of the edited text element would be replaced.
In earlier drafts this would even be a conformant implementation
(the editing did not need to be 'live').
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org