Inkscape could do better with text: split paragraph
-
- Posts: 5
- Joined: Thu Mar 15, 2012 9:56 pm
Inkscape could do better with text: split paragraph
Yes, I understand inkscape wasn't built to be a text processor, but it's a pitty given that, for my needs, it's the best of all for this, inspite of the the performance issues which by the way, a lot worse in scribus. Having tried scribus and several other applications, I assure you I know how to use a word-processor. I looked up several mind-mapping software, yet I still ended up using Inkscape. So while inkscape wasn't built for me, as I'm not trying to draw, it's still only a single feature away from being the best tool of all the above:
The split-text extension splits lines/words/letters, but doesn't split paragraphs. This feature would deserve a shortcut-key too. Right now I have to create another box and copy-paste text... which is a quite painfully slow. Is there anyone who knows a workaround ? Could someone knit-together some python code that splits a box with two paragraphs into two text objects ? Pretty please !
This being said, I made this account to request this feature, only to discover minutes later that I need to create a new one on launchpad. I'd appreciate if someone who thinks this is a good idea and already has an account could go through the hassle of requesting this enhancement in case no one helps me with coding here.
Re: Inkscape could do better with text: split paragraph
Welcome to InkscapeForum!
Yes, this is more of a users' forum, than a developers' forum. Launchpad is indeed the best place to request new features. And I don't mind creating a new feature request "bug report". But I'm not sure it's an appropriate request (explanation below).
First, I'm not sure what I'm thinking about this is correct. But I'll just put it out there, and others who know more about it can comment as well.
Oh, well before I offer my probably less than helpful comments, I might refer you to this page http://wiki.inkscape.org/wiki/index.php ... Repository which contains many more extension than what ship with the program. Maybe there will be one that will help? Also I'll mention the info in the manual, just fyi http://tavmjong.free.fr/INKSCAPE/MANUAL ... -SplitText.
Since I'm not familiar with that exension, I've done a bit of experimenting. First I created some random text using the Lorem Ipsum extension (3 paragraphs, 4 sentences each) and then ran the Split Text extension. I was a little surprised to learn what it actually does. But it's certainly not the first time I've been mislead by some of the terminology used in Inkscape. (E.g. Fractalize extension has nothing to do with fractals! And many more examples ) But I do get the idea....sort of.
The first thing I learned, is that each lorem ipsum "paragraph" is considered a line -- a line of 4 sentences, as far as the Split Text extension is concerned. So what I think is that Inkscape has no particular idea what a paragraph is, or maybe a sentence either. I'm not sure how the Split Text extension even recognizes a line. If I just type a bunch of text, and don't use lorem ipsum, a line appears to consist of everything between Enter/Returns.
So my guess is that Inkscape would need to have some definition of a paragraph, or any new extension would have to somehow be able to determine what is a paragraph. Maybe it could be as simple as a double Enter/Return, but that might not work in all cases. But how to make this work is WAY beyond my understanding. I'm just saying that recognizing paragraphs in order to "split" them might not be consistent with SVG or XML standards. Maybe it is, and if it's reasonable in those terms, I'd be glad to put up a request. However, if someone asks for any clarification, I wouldn't know what to say. You might end up having to register there anyway, to potentially provide certain details.
Or maybe someone else would have a better understanding, and wouldn't mind making the request?
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
-
- Posts: 5
- Joined: Thu Mar 15, 2012 9:56 pm
Re: Inkscape could do better with text: split paragraph
I looked for this functionality all over the place, and it's not in the repo, nor anywhere else on the internet.
The whole point is to quickly get individual text-objects that move freely or can be colored differently. Yes, splitting lines gives me too many objects sometimes, so splitting lines is not enough, and an empty line/double return is the right... Another problem with the current way the extension works is that it splits into a different text-object, one that isn't flowed. I failed to "reconfigure" them with Alt-W, as "Flow into Frame" doesn't do anything... (in case I have to create a frame too, it's overkill.)
An alternative way:
Leave the extension as is, except show me how to assign a keyboard shortcut to the split to lines functionality.
Then, give me a way to JOIN selected lines, into a single flowing-text-object by selecting them and hitting another key. Grouping them would almost do the trick, but I need the text to flow !
I mentioned something about a workaround in the OP. If I could turn a group of (grouped or selected) unflowed-text-object into a single flowed-one with a key, assigning shortcuts to these functions is all I need.
The whole point is to quickly get individual text-objects that move freely or can be colored differently. Yes, splitting lines gives me too many objects sometimes, so splitting lines is not enough, and an empty line/double return is the right... Another problem with the current way the extension works is that it splits into a different text-object, one that isn't flowed. I failed to "reconfigure" them with Alt-W, as "Flow into Frame" doesn't do anything... (in case I have to create a frame too, it's overkill.)
An alternative way:
Leave the extension as is, except show me how to assign a keyboard shortcut to the split to lines functionality.
Then, give me a way to JOIN selected lines, into a single flowing-text-object by selecting them and hitting another key. Grouping them would almost do the trick, but I need the text to flow !
I mentioned something about a workaround in the OP. If I could turn a group of (grouped or selected) unflowed-text-object into a single flowed-one with a key, assigning shortcuts to these functions is all I need.
-
- Posts: 5
- Joined: Thu Mar 15, 2012 9:56 pm
Re: Inkscape could do better with text: split paragraph
well just in case anyone is reading this.
http://fossies.org/windows/misc/inkscap ... ource.html
here's the source for the extension. anyone knowing more python than me, could modify this and get it running. Assigning a shortcut shouldn't be too hard.
http://fossies.org/windows/misc/inkscap ... ource.html
here's the source for the extension. anyone knowing more python than me, could modify this and get it running. Assigning a shortcut shouldn't be too hard.
Re: Inkscape could do better with text: split paragraph
textandworkflow wrote:well just in case anyone is reading this.
<link snipped>
here's the source for the extension.
Here are the links to the actual source code repository of Inkscape:
- Inkscape 0.48.x (stable branch): split.py | split.inx
- Inkscape trunk (development branch): split.py | split.inx
- Bug #171748 “Break Text, words, lines and letters.”
Keyboard shortcuts can be assigned to extensions based on their ID. You can easily add and test it with a user keymap file (~/.config/inkscape/keys/default.xml) based on the format described in the shared keymap file.textandworkflow wrote:Assigning a shortcut shouldn't be too hard.
Note I: IIRC there's a minor detail not mentioned in the comments - each installed extension has two verbs based on its ID:
Code: Select all
$ inkscape --verb-list | grep 'Split text'
com.nerdson.split: Split text...
com.nerdson.split.noprefs: Split text (No preferences)
$
Note II: keyboard shortcuts cannot access or trigger individual settings inside the extension options dialog: the shortcut can either open the dialog, or run the extension (without dialog) using default settings.
-
- Posts: 5
- Joined: Thu Mar 15, 2012 9:56 pm
Re: Inkscape could do better with text: split paragraph
Thank you all for your follow up. I contacted the author of the script meanwhile, so I hope he finds something here that makes his job easier. I've also asked a question on launchpad, because nobody answered I posted related bugs. It was like a maze at first but I guess this should be on rails now.
Positioning is not an issue, although it would be nice if the extension would leave the text where it is.
As far as I understand, in order to split paragraphs with just one key, it would be better to have a new extension that does nothing but this. Either this, or the functions split-to-lines, split-to-words, split-to-letters, but most importantly, split-to-paragraphs must be each mapped to a verb, and in turn a key.
AFAICT, difficulties encountered when adding support of flowed text (i.e. paragraphs) to a script-based extension was discussed on the mailing list (apparently not a trivial task if precise positioning of the split paragraphs is required - extensions do not have access to internal functions).
Positioning is not an issue, although it would be nice if the extension would leave the text where it is.
Note II: keyboard shortcuts cannot access or trigger individual settings inside the extension options dialog: the shortcut can either open the dialog, or run the extension (without dialog) using default settings.
As far as I understand, in order to split paragraphs with just one key, it would be better to have a new extension that does nothing but this. Either this, or the functions split-to-lines, split-to-words, split-to-letters, but most importantly, split-to-paragraphs must be each mapped to a verb, and in turn a key.