
On 11-Apr-2014 12:31, Krzysztof Kosiński wrote:
2014-04-11 21:22 GMT+02:00 Krzysztof Kosiński <tweenk.pl@...400...>:
Text that contains only whitespace (doesn't generate any paths) should be automatically deleted when it is deselected. This would be an extension of what happens when the user clicks on the canvas on the text tool but doesn't type anything; no object is created in that case.
These are not the same thing though. A click, do nothing, is a text box with no characters, whereas one with only white space is a perfectly valid text object, albeit one that is not at that moment visible. I agree that an empty <text> or <tspan> should go away.
What you are suggesting for the proper selection mode is very much like those programs that trim white spaces out of text when exporting to various graphics formats. These convert:
"This is a sentence."
to 4 objects:
"This", "is", "a", "sentence".
That is all well and good if the only intent is ever to draw with those objects, but the problems with this philosophy show up when it must be imported into another program. Hence libTERE, which does its best to reassemble this sort of mess, which would never have been needed had the intervening spaces been emitted.
Consider this thought experiment, what actions are going to be needed to convert (these are aligned text objects, not a text box with wrapped lines):
Topic Subtopic A
to
1 Topic 1a Subtopic A
With spaces selectable one would type in the 1, then go straight down to the next line and click, which would put the insertion point on or very near where it needs to be. If spaces are not selectable one must click on "S" in Subtopic and then use the cursor keys to move several spaces to the left before the correct insertion point is reached.
Similarly, when a text editing event results in the object containing only whitespace, it should be removed from the object tree and re-inserted once a visible glyph becomes part of the text.
How is that to happen if the user cannot select it?
It wouldn't be particularly difficult to make the extent of the text pick box for text (+/- spaces) yet another user settable preference. Then we can argue over the default setting!
Regards,
David Mathog mathog@...1176... Manager, Sequence Analysis Facility, Biology Division, Caltech