[svg-developers] Re: Strategy for text input

2011-02-04 Thread gb_n_svg


Jon

Thank you very much for the help. 

I am currently thinking I'll eventually build something like that carto.net 
textbox, with the addition of changing size of the block it is embedded 
within as characters are typed or rubbed out.
Initially, I'll likely use that carto.net textbox unchanged  to get a better 
feel for how the UI is working.

Because the block is the visual element that the user will be concentrating 
on, I would like to avoid adding any extra visual 'decoration' (other than a 
cursor change to an I-beam)

Cheers GB

--- In svg-developers@yahoogroups.com, Jon Frost jonfrost@... wrote:

 ForeignObject seems like the ideal tag to use for inserting Html content 
 within Svg, however I believe IE9 does not (will not?) support the 
 ForeignObject tag.  The logic there it seems is that div tags layered 
 on top of the Svg should work just as well.  There has been mixed 
 support for ForeignObject in other browsers as well such as:
 http://code.google.com/p/chromium/issues/detail?id=65616
 
 Here are a few decent resources for mixing Svg and Html:
 http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#scripting_HTML
 http://www.schepers.cc/svg/blendups/scriptbridge/scriptbridge-insertBug.html
 
 This has been a useful little script and works well for a lot of scenarios:
 http://www.carto.net/papers/svg/gui/textbox/index.svg
 
 Best.
 
 
 
 On 1/19/2011 2:47 PM, gb_n_svg wrote:
  Thomas
 
  Thank you for the advice.
  I wondered if something like that might be an answer, (my colleagues did 
  that with a complex X-Windows UI, but that was 16 years ago!) so now I 
  know!-)
  (Not the answer I had hoped for :-)
 
  I assume I need to define the XHTML name space, and then use that within my 
  SVG?
 
  Thanks again
  GB-)
 
  --- In svg-developers@yahoogroups.com, th_w@th_w@  wrote:
 
  I tried something similar some time ago, and it's a pain.  I'm not sure 
  whether you can at all detect all possible keystrokes correctly, not to 
  speak of accented characters and such.  I'd probably go with an 
  HTMLinput  field inside aforeignObject  right now, since the editable 
  text currently is only supported by Opera, I believe.  I would replace the 
  to-be-edited-text with aninput, and when editing is done, I would swap 
  back the text element with updated content.  I didn't try it, but I think 
  it should be possible.
 
 
 
  Thomas W.






-
To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)

* To change settings via email:
svg-developers-dig...@yahoogroups.com 
svg-developers-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
svg-developers-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



[svg-developers] Re: Strategy for text input

2011-02-03 Thread Jon Frost
ForeignObject seems like the ideal tag to use for inserting Html content 
within Svg, however I believe IE9 does not (will not?) support the 
ForeignObject tag.  The logic there it seems is that div tags layered 
on top of the Svg should work just as well.  There has been mixed 
support for ForeignObject in other browsers as well such as:
http://code.google.com/p/chromium/issues/detail?id=65616

Here are a few decent resources for mixing Svg and Html:
http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#scripting_HTML
http://www.schepers.cc/svg/blendups/scriptbridge/scriptbridge-insertBug.html

This has been a useful little script and works well for a lot of scenarios:
http://www.carto.net/papers/svg/gui/textbox/index.svg

Best.



On 1/19/2011 2:47 PM, gb_n_svg wrote:
 Thomas

 Thank you for the advice.
 I wondered if something like that might be an answer, (my colleagues did that 
 with a complex X-Windows UI, but that was 16 years ago!) so now I know!-)
 (Not the answer I had hoped for :-)

 I assume I need to define the XHTML name space, and then use that within my 
 SVG?

 Thanks again
 GB-)

 --- In svg-developers@yahoogroups.com, th_w@...th_w@...  wrote:

 I tried something similar some time ago, and it's a pain.  I'm not sure 
 whether you can at all detect all possible keystrokes correctly, not to 
 speak of accented characters and such.  I'd probably go with an HTMLinput  
 field inside aforeignObject  right now, since the editable text currently 
 is only supported by Opera, I believe.  I would replace the 
 to-be-edited-text with aninput, and when editing is done, I would swap 
 back the text element with updated content.  I didn't try it, but I think it 
 should be possible.



 Thomas W.




-
To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)

* To change settings via email:
svg-developers-dig...@yahoogroups.com 
svg-developers-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
svg-developers-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



[svg-developers] Re: Strategy for text input

2011-01-24 Thread gb_n_svg
Yes, I have had uneven results with a simple 'blur' filter across browsers.

I am instantiating most of my shapes using the 'use' element, so I am hoping 
that I can isolate all of the browser variability into a small, non-visible 
'defs' subsection of my SVG, so that I can either go with a 'lowest common 
denominator' (greatest common divisor) of all web browsers, or browser specific 
variants.

I have 150+ 'blocks' to create, each with a variety of visual characteristics.
I think I have about 14 unique 'tiles' and believe I can compose every one of 
the 150+ blocks from those 14 tiles. Most of them are a path elements of 
constant size, unchanged by text being entered, and so they are the 'interlock' 
pieces.

I now believe the few 'tiles' that need to change size as text is edited are 
rectangles.
So it looks feasible to do 'live' editing on the shape. (Of course, I need to 
write all of that code, so this isn't trivial)

I have several ways I can progress.

I could simply compose a group containing a set of 'use' for each block 
instance, making it from the appropriate 'tiles', and with suitable coordinates 
the block will look like a single graphic. The changeable parts could be 
resized by applying a scaling transformation on the use, or by making a new 
rectangle instance, and adjusting the coordinates in the 'use' for other 
'interlock' tiles.

Or, I could built a single path, assembling the data in tiles to make a single 
unique path. This would only be changed when the user edits the text on a 
block. All the user interface is text or filled paths, one path per block 
background..

Both will also have the overlaid text, but this can be 'dumb' when not being 
actively edited.

I am concerned that 'use'ing a bunch of tiles to make each block might have two 
annoying visual artefacts (vs creating a single path for each block background):
1. When the block is dragged, the update to the coordinates of each 'use'd tile 
might not be synchronised so small visible 'tears' might appear while it is 
dragged
2. When filters are applied to make the drop shadow, the edges between tiles, 
(which would be invisible because of their position and colour scheme) will get 
highlighted by the filters, so it won't look like a single 'path' shadow, but 
will look like a set of tiles with fuzzy boundaries.

Any views?
TIA
GB

--- In svg-developers@yahoogroups.com, cremnosedum richard@... wrote:

 Hi,
 
 --- In svg-developers@yahoogroups.com, Jacob Beard jbeard4@ wrote:
 
  Also, just a note about SVG filters: I think they have only recently 
  been added to Webkit, and so are not in currently release versions of 
  Chrome and Safari.
 
 The last versions I tested: Chrome 5.0.375.70 tries to implement filters but 
 there are a lot it can't handle and it simply doesn't display objects with 
 such filters but at least some of them can receive events.  Safari 
 4.0.3(531.9.1) doesn't implement filters but objects with them appear, 
 usually as a solid colour.
 
 Richard Pearman   http://www.pixelpalaces.com/
 The next stage in the evolution of web comics: 
 http://www.onlinecomics.net/pages/details/listing.php?comicID=4415
 Read my Helium articles: http://www.helium.com/users/212199
 South Alberta Cactus and succulent society: 
 http://www.facebook.com/group.php?gid=20360241008
 Make money from discussing things: http://www.myLot.com?ref=Graptopetalum







-
To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)

* To change settings via email:
svg-developers-dig...@yahoogroups.com 
svg-developers-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
svg-developers-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



[svg-developers] Re: Strategy for text input

2011-01-23 Thread cremnosedum
Hi,

--- In svg-developers@yahoogroups.com, Jacob Beard jbeard4@... wrote:

 Also, just a note about SVG filters: I think they have only recently 
 been added to Webkit, and so are not in currently release versions of 
 Chrome and Safari.

The last versions I tested: Chrome 5.0.375.70 tries to implement filters but 
there are a lot it can't handle and it simply doesn't display objects with such 
filters but at least some of them can receive events.  Safari 4.0.3(531.9.1) 
doesn't implement filters but objects with them appear, usually as a solid 
colour.

Richard Pearman   http://www.pixelpalaces.com/
The next stage in the evolution of web comics: 
http://www.onlinecomics.net/pages/details/listing.php?comicID=4415
Read my Helium articles: http://www.helium.com/users/212199
South Alberta Cactus and succulent society: 
http://www.facebook.com/group.php?gid=20360241008
Make money from discussing things: http://www.myLot.com?ref=Graptopetalum





-
To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)

* To change settings via email:
svg-developers-dig...@yahoogroups.com 
svg-developers-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
svg-developers-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



[svg-developers] Re: Strategy for text input

2011-01-19 Thread t...@ymail.com
I tried something similar some time ago, and it's a pain.  I'm not sure whether 
you can at all detect all possible keystrokes correctly, not to speak of 
accented characters and such.  I'd probably go with an HTML input field 
inside a foreignObject right now, since the editable text currently is only 
supported by Opera, I believe.  I would replace the to-be-edited-text with an 
input, and when editing is done, I would swap back the text element with 
updated content.  I didn't try it, but I think it should be possible.

Thomas W.


--- In svg-developers@yahoogroups.com, gb_n_svg gbulmeruk@... wrote:

 I'd like to know what is the 'right way' to do text input in pure SVG?
 (I am building a pure SVG user interface.)
 
 I have lots of different shapes (over 100), each made from a group containing 
 paths, rectangles and text elements (eventually filters too).
 
 The user can 'clone' any shape by dragging it and dropping.
 They need to be able to type some text into *one* of the text fields within 
 the group, just one word or a number. (Some text is the applications labels, 
 and can't be changed by the user)
 
 I would like to stretch the shape as they type reach character if the text 
 they are entering is approaching one of the other fields on the shape, or the 
 edge of the shape. I'd like to shrink the shape, if they rub out a character. 
 They should be able to click into the middle of the text, and drive left and 
 right with the cursor keys. I don't need to support tabbing from one field to 
 the next.
 
 The shape is quite complex, so expanding or shrinking while they type may 
 need the path 'd' attribute value to be changed dynamically. Is that an okay 
 idea, or do I need to try to design the shapes' geometry to avoid it?
 
 I'd also like to support drop-down lists around the text input (for 'standard 
 values' or their most recent entries)
 
 Would someone please point me at the stuff I should be reading or 
 googling-for to understand the available approaches to text input? Simple 
 searches like SVG text input doesn't seem to find anything helpful.
 
 Do I need to handle every key stroke myself, or are there some helper 
 mechanisms that I can hook into? For example, when I used to do X-Windows 
 stuff, editing could be handled by a widget, but it was possible to look at 
 every character too (both before and after the widget saw it, I think; 19 
 years ago, so I may be wrong).
 
 I'd like to get reasonably wide deployment (when Firefox 4, and IE9 arrive). 
 Should I be constraining myself to SVG 1.1, and ignore the SVG 1.2 (I see 
 that 1.2 seems to have editable text support)?
 
 Or, should I be using XHTML too, and abandon a pure SVG approach?
 
 All help welcomed :-)
 GB-)







-
To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)

* To change settings via email:
svg-developers-dig...@yahoogroups.com 
svg-developers-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
svg-developers-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



Re: [svg-developers] Re: Strategy for text input

2011-01-19 Thread Jacob Beard
I agree, it can be a pain to do with SVG 1.1, but it is possible.

carto.net has had some example of textbox widgets since a long time: 
http://www.carto.net/papers/svg/gui/textbox/

Lively kernel rolled their own multi-line text editor for editing code: 
http://www.lively-kernel.org/

And it just so happens that I've also been working on an SVG-based text 
editor for a course project this semester. I haven't released it yet, 
but probably will in the next week or two. I'm still deciding how to 
license it. Is your application something that would be compatible with 
the GPL?

I actually don't think your requirements would be too difficult to 
implement. Here are my thoughts:


On 11-01-19 02:37 PM, t...@ymail.com wrote:

  I would like to stretch the shape as they type reach character if 
 the text they are entering is approaching one of the other fields on 
 the shape, or the edge of the shape. I'd like to shrink the shape, if 
 they rub out a character. They should be able to click into the middle 
 of the text, and drive left and right with the cursor keys. I don't 
 need to support tabbing from one field to the next.


My experience has been that keyboard handling support is good in all of 
the major browsers (although I haven't tried IE), so I think you won't 
have any trouble attaching listeners and receiving events for each of 
the text elements. To resize your shapes, you would basically just get 
the bounding box of the text (using element.getBBox()) after every 
keyboard event, and then dynamically alter the path, as you suggested, 
or simply scale the shape.

You would, however, need to roll your own cursor, keep track of its 
position and update its representation in DOM on left and right 
keypresses. You would also need to map its position to the index of the 
text element's textContent property, and use that to indsert or delete 
characters.


 
  The shape is quite complex, so expanding or shrinking while they 
 type may need the path 'd' attribute value to be changed dynamically. 
 Is that an okay idea, or do I need to try to design the shapes' 
 geometry to avoid it?

I think this depends on what you're trying to represent, and how complex 
you want the math to be when updating the shape. An easy way out might 
simply be to scale the shape such that its bounding box encompasses the 
text's bounding box. This would be very easy to implement.

 
  I'd also like to support drop-down lists around the text input (for 
 'standard values' or their most recent entries)

Again, you would need to roll this widget from scratch, or use an 
embedded HTML menu inside a foreignObject.

 
  Would someone please point me at the stuff I should be reading or 
 googling-for to understand the available approaches to text input? 
 Simple searches like SVG text input doesn't seem to find anything 
 helpful.

Take a look at the spec:

http://www.w3.org/TR/SVG11/text.html

Especially the scripting interfaces:

http://www.w3.org/TR/SVG11/text.html#DOMInterfaces

 
  Do I need to handle every key stroke myself, or are there some 
 helper mechanisms that I can hook into? For example, when I used to do 
 X-Windows stuff, editing could be handled by a widget, but it was 
 possible to look at every character too (both before and after the 
 widget saw it, I think; 19 years ago, so I may be wrong).

You need to handle every stroke yourself. I'm not aware of a 
higher-level mechanism, and I'm also not aware of any developer-facing 
GUI libraries that people have written around this low-level mechanism.

 
  I'd like to get reasonably wide deployment (when Firefox 4, and IE9 
 arrive).
  Should I be constraining myself to SVG 1.1, and ignore the SVG 1.2 
 (I see that 1.2 seems to have editable text support)?


You will need to constrain yourself to SVG 1.1. Unfortunately, while SVG 
1.2 does include support for editable text, I think that of all the 
browsers, currently only recent versions of Opera supports it. I have to 
say though, it's very impressive. They have a demo where you can edit 
text on a spiral path. Very cool stuff.

 
  Or, should I be using XHTML too, and abandon a pure SVG approach?

Speaking from experience, if you don't need multiline text editing, I 
think you can put together a basic SVG text input widget in less than a day.

However, using HTML would probably be less work, overall. HTML gives you 
text input widgets, which is certainly at a higher level than what SVG 
gives you. The thing I'm not sure about is whether it will be possible 
for you to get a proper bounding box from the embedded HTML text input 
element. This is probably something you would want to prototype.

Good luck!

Jake


[Non-text portions of this message have been removed]





-
To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
Yahoo! Groups Links

* To visit your group 

[svg-developers] Re: Strategy for text input

2011-01-19 Thread gb_n_svg
Thomas

Thank you for the advice. 
I wondered if something like that might be an answer, (my colleagues did that 
with a complex X-Windows UI, but that was 16 years ago!) so now I know!-)
(Not the answer I had hoped for :-)

I assume I need to define the XHTML name space, and then use that within my SVG?

Thanks again
GB-)

--- In svg-developers@yahoogroups.com, th_w@... th_w@... wrote:

 I tried something similar some time ago, and it's a pain.  I'm not sure 
 whether you can at all detect all possible keystrokes correctly, not to speak 
 of accented characters and such.  I'd probably go with an HTML input field 
 inside a foreignObject right now, since the editable text currently is only 
 supported by Opera, I believe.  I would replace the to-be-edited-text with an 
 input, and when editing is done, I would swap back the text element with 
 updated content.  I didn't try it, but I think it should be possible.


 
 Thomas W.
 
 
 --- In svg-developers@yahoogroups.com, gb_n_svg gbulmeruk@ wrote:
 
  I'd like to know what is the 'right way' to do text input in pure SVG?
  (I am building a pure SVG user interface.)
  
  I have lots of different shapes (over 100), each made from a group 
  containing paths, rectangles and text elements (eventually filters too).
  
  The user can 'clone' any shape by dragging it and dropping.
  They need to be able to type some text into *one* of the text fields within 
  the group, just one word or a number. (Some text is the applications 
  labels, and can't be changed by the user)
  
  I would like to stretch the shape as they type reach character if the text 
  they are entering is approaching one of the other fields on the shape, or 
  the edge of the shape. I'd like to shrink the shape, if they rub out a 
  character. They should be able to click into the middle of the text, and 
  drive left and right with the cursor keys. I don't need to support tabbing 
  from one field to the next.
  
  The shape is quite complex, so expanding or shrinking while they type may 
  need the path 'd' attribute value to be changed dynamically. Is that an 
  okay idea, or do I need to try to design the shapes' geometry to avoid it?
  
  I'd also like to support drop-down lists around the text input (for 
  'standard values' or their most recent entries)
  
  Would someone please point me at the stuff I should be reading or 
  googling-for to understand the available approaches to text input? Simple 
  searches like SVG text input doesn't seem to find anything helpful.
  
  Do I need to handle every key stroke myself, or are there some helper 
  mechanisms that I can hook into? For example, when I used to do X-Windows 
  stuff, editing could be handled by a widget, but it was possible to look at 
  every character too (both before and after the widget saw it, I think; 19 
  years ago, so I may be wrong).
  
  I'd like to get reasonably wide deployment (when Firefox 4, and IE9 
  arrive). 
  Should I be constraining myself to SVG 1.1, and ignore the SVG 1.2 (I see 
  that 1.2 seems to have editable text support)?
  
  Or, should I be using XHTML too, and abandon a pure SVG approach?
  
  All help welcomed :-)
  GB-)
 







-
To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)

* To change settings via email:
svg-developers-dig...@yahoogroups.com 
svg-developers-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
svg-developers-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



[svg-developers] Re: Strategy for text input

2011-01-19 Thread gb_n_svg
Jake

--- In svg-developers@yahoogroups.com, Jacob Beard jbeard4@... wrote:

 I agree, it can be a pain to do with SVG 1.1, but it is possible.
 
 carto.net has had some example of textbox widgets since a long time: 
 http://www.carto.net/papers/svg/gui/textbox/

Argh! Thank you for reminding me. I had forgotten all about that stuff at 
carto.net
They were very busy folks.
It looks a bit long and ugly, but doing it in C would be too :-)

 
 Lively kernel rolled their own multi-line text editor for editing code: 
 http://www.lively-kernel.org/
I've seen this, but I don't feel my JavaScript is good enough to get to grips 
with it.
I am doing this SVG+JavaScript project to sharpen my understanding so that I 
*can* do that kind of stuff :-)

 
 And it just so happens that I've also been working on an SVG-based text 
 editor for a course project this semester. I haven't released it yet, 
 but probably will in the next week or two. I'm still deciding how to 
 license it. Is your application something that would be compatible with 
 the GPL?
At the moment, it is primarily a vehicle to focus my efforts to get to 
lively-kernel quality, or OMeta-quality JavaScript'.
It is secondarily a demo for some folks.
For this sort of stuff, I think in terms of CC-BY-SA-NC (do what you like, 
except try to make money from my efforts)

 
 I actually don't think your requirements would be too difficult to 
 implement. Here are my thoughts:
Okay!

 
 
 On 11-01-19 02:37 PM, th_w@... wrote:
 
   I would like to stretch the shape as they type reach character if 
  the text they are entering is approaching one of the other fields on 
  the shape, or the edge of the shape. I'd like to shrink the shape, if 
  they rub out a character. They should be able to click into the middle 
  of the text, and drive left and right with the cursor keys. I don't 
  need to support tabbing from one field to the next.
 
 
 My experience has been that keyboard handling support is good in all of 
 the major browsers (although I haven't tried IE), so I think you won't 
 have any trouble attaching listeners and receiving events for each of 
 the text elements.
Good. That would kill the whole idea otherwise.

 To resize your shapes, you would basically just get 
 the bounding box of the text (using element.getBBox()) after every 
 keyboard event, and then dynamically alter the path, as you suggested, 
 or simply scale the shape.
I can't scale the shapes. 
They are somewhat like interlocking jigsaw pieces, and scaling would break the 
interlock.

I need to either change the path 'd' attribute dynamically, or carve each whole 
shape into multiple fragments so that I can scale, or more easily adjust, the 
piece which grows.
I might try both. I am very curious how easy it will be to parse and decompose 
the path 'd' attribute, and how well it performs.

 
 You would, however, need to roll your own cursor,
I assume there is a glyph which looks like an I beam insertion point.
 keep track of its  position
Yes
 and update its representation in DOM on left and right 
 keypresses.
Yes
 You would also need to map its position to the index of the 
 text element's textContent property, and use that to indsert or delete 
 characters.
Yes

It was a Long time ago, but in principle, I think I can do that because I 
have done it before (in C++ and Java).
 
 
  
   The shape is quite complex, so expanding or shrinking while they 
  type may need the path 'd' attribute value to be changed dynamically. 
  Is that an okay idea, or do I need to try to design the shapes' 
  geometry to avoid it?
 
 I think this depends on what you're trying to represent, and how complex 
 you want the math to be when updating the shape. An easy way out might 
 simply be to scale the shape such that its bounding box encompasses the 
 text's bounding box. This would be very easy to implement.
Sadly that would make the shape too big 96% of the time (approximately :-).

I can carve it into 'strips' vertically, and adjust the trapezoid or rectangle 
that needs to grow with the text, them splice that back into the path. 
I can leave it as separate SVG elements for now, but I am worried that filters 
won't 'tile' seamlessly later, and the edges of abutting, adjacent elements 
would be visible, when I want to add filter effects later.

Maybe you or someone knows if that is a real concern?
If filters *ALWAYS*, or some subset of filters *ALWAYS* produce seamless 
results when applied to a group of SVG elements, then I can make each shape 
from, maybe a dozen 'tiles', and just adjust the few that contain 'live' text

 
  
   I'd also like to support drop-down lists around the text input (for 
  'standard values' or their most recent entries)
 
 Again, you would need to roll this widget from scratch, or use an 
 embedded HTML menu inside a foreignObject.
Okay.

 
  
   Would someone please point me at the stuff I should be reading or 
  googling-for to understand the available approaches to text input? 

Re: [svg-developers] Re: Strategy for text input

2011-01-19 Thread Jacob Beard


On 11-01-19 06:53 PM, gb_n_svg wrote:

 Jake

 --- In svg-developers@yahoogroups.com 
 mailto:svg-developers%40yahoogroups.com, Jacob Beard jbeard4@... 
 wrote:
 
  I agree, it can be a pain to do with SVG 1.1, but it is possible.
 
  carto.net has had some example of textbox widgets since a long time:
  http://www.carto.net/papers/svg/gui/textbox/

 Argh! Thank you for reminding me. I had forgotten all about that stuff 
 at carto.net
 They were very busy folks.
 It looks a bit long and ugly, but doing it in C would be too :-)

I think carto.net has a single author, actually: Andreas Neumann.

Also, just a note about SVG filters: I think they have only recently 
been added to Webkit, and so are not in currently release versions of 
Chrome and Safari. They are also not supported in IE9.

Jake


[Non-text portions of this message have been removed]





-
To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)

* To change settings via email:
svg-developers-dig...@yahoogroups.com 
svg-developers-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
svg-developers-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/