Hello,
I've updated my split text extension!
See more details in: http://nerdson.com/bin/split/
It doesn't split flowed texts. I couldn't put the splitted elements in the same position they were before (because of the way flowedText data is organized), so I decided to not support this type of element in the extension. I'd like to know if there's a way to get the X and Y of a flowed text. Apparently they are determined by the position of the flowing shape...
I'd like you to test it and if possible, put it on 0.47.
Files: http://nerdson.com/bin/split/split.py http://nerdson.com/bin/split/split.inx
Thanks!
I just ran this in Inkscape devel version. Whenever I apply it to text, I get the message : Please select only simple text elements. What procedure should I use to get it to work?
Oh, I'm sorry! It is working only in 0.46. I'm going to make it compatible. Thanks for the feedback!
On Mon, Apr 20, 2009 at 7:35 AM, Alvin Penner <penner@...1856...> wrote:
I just ran this in Inkscape devel version. Whenever I apply it to text, I get the message : Please select only simple text elements. What procedure should I use to get it to work?
-- View this message in context: http://www.nabble.com/Split-text-extension-tp23130501p23134201.html Sent from the Inkscape - Dev mailing list archive at Nabble.com.
um, I just ran this under Windows XP, Inkscape 0.46 stable version, on a different machine, and I still get the message : 'Please select only simple text elements.'
not sure how to proceed from here.
Are you using flowed text? The extension won't work on this kind of text...
On Mon, Apr 20, 2009 at 9:18 AM, Alvin Penner <penner@...1856...> wrote:
um, I just ran this under Windows XP, Inkscape 0.46 stable version, on a different machine, and I still get the message : 'Please select only simple text elements.'
not sure how to proceed from here.
-- View this message in context: http://www.nabble.com/Split-text-extension-tp23130501p23135611.html Sent from the Inkscape - Dev mailing list archive at Nabble.com.
Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
yes, it turns out I was using flowed text. I think it would be worthwhile to include support for flowed text, since this is the default in Inkscape, as far as I can tell.
On Mon, 20 Apr 2009 14:51:32 -0700 (PDT) Alvin Penner <penner@...1856...> wrote:
yes, it turns out I was using flowed text. I think it would be worthwhile to include support for flowed text, since this is the default in Inkscape, as far as I can tell.
My version supported both text flavors, I just pulled the @x and @y from the object defining the flow shape.
I don't think it's critical for the split text to be in exactly the same place, or even to have exactly the same style, as the original, although it's nice if it doesn't appear off screen.
Karlisson, let me know if you want me to pitch in on your current version at all.
Cheers -Terry
yes, it turns out I was using flowed text. I think it would be worthwhile to include support for flowed text, since this is the default in Inkscape, as far as I can tell.
Hi, I'm working on the extension to support flowed text and it is almost done! ;)
My version supported both text flavors, I just pulled the @x and @y from the object defining the flow shape.
Yes, I have discovered how to retrieve these values.
I don't think it's critical for the split text to be in exactly the same place, or even to have exactly the same style, as the original, although it's nice if it doesn't appear off screen.
Well, I think a user would expect the splitted text to be in the same place ;)
Karlisson, let me know if you want me to pitch in on your current version at all.
OK! Thanks!
OK, now it is working on rect-flowed texts (created by dragging the text tool), except for flowed text on other shapes and following-path texts, because I found it to much complex to handle. They are not so often used to need that extra work, so the extension shows an alert asking for single text elements. What do you think?
Tested on .46 and .47
Please, test! ;-)
On Mon, Apr 20, 2009 at 11:17 PM, Karlisson <theanimage@...400...> wrote:
yes, it turns out I was using flowed text. I think it would be worthwhile to include support for flowed text, since this is the default in Inkscape, as far as I can tell.
Hi, I'm working on the extension to support flowed text and it is almost done! ;)
My version supported both text flavors, I just pulled the @x and @y from the object defining the flow shape.
Yes, I have discovered how to retrieve these values.
I don't think it's critical for the split text to be in exactly the same place, or even to have exactly the same style, as the original, although it's nice if it doesn't appear off screen.
Well, I think a user would expect the splitted text to be in the same place ;)
Karlisson, let me know if you want me to pitch in on your current version at all.
OK! Thanks!
-- Karlisson M. Bezerra http://nerdson.com/
On Tue, Apr 21, 2009 at 11:19 PM, Karlisson <theanimage@...400...> wrote:
Please, test! ;-)
I was wondering how you'd do x/y calculation for letters/words, and after testing I see it is indeed very approximate and letters/words shift a lot. This is not your fault - it is perhaps impossible to do this properly in an extension, though it can be done in the core of Inkscape without any limitations (i.e. for any kind of flowed text). So, unless someone is going to code a core command for this shortly (you can ask me how to do this if interested), I'm for including this extension as a temprary measure. At least for line splitting it works well.
I was wondering how you'd do x/y calculation for letters/words, and after testing I see it is indeed very approximate and letters/words shift a lot. This is not your fault - it is perhaps impossible to do this properly in an extension,
Indeed. If svg:text had width/height, I could set the correct position with these properties. Without it, I had to calculate position by font-size, which is not very accurate because of the variant glyphs sizes. I could calculate by glyph too, but it wouldn't be a good solution.
though it can be done in the core of Inkscape without any limitations (i.e. for any kind of flowed text). So, unless someone is going to code a core command for this shortly (you can ask me how to do this if interested), I'm for including this extension as a temprary measure. At least for line splitting it works well.
Well, I've programmed in C for a while, but I think I can take a look :-)
Thanks!
On Wed, Apr 22, 2009 at 12:58 AM, Karlisson <theanimage@...400...> wrote:
though it can be done in the core of Inkscape without any limitations (i.e. for any kind of flowed text). So, unless someone is going to code a core command for this shortly (you can ask me how to do this if interested), I'm for including this extension as a temprary measure. At least for line splitting it works well.
Well, I've programmed in C for a while, but I think I can take a look :-)
1. create a new verb for the split command (better have three commands for lines/words/letters, without any ui), see verbs.{cpp|h}
2. for code of the verb, look into selcue.cpp, _newTextBaselines(): it takes a layout of a text object and gets the coordinates of its first char for displaying a square mark there:
Geom::Point a = layout->characterAnchorPoint(layout->begin()) * sp_item_i2d_affine(item);
All you need to do in your command is iterate over all chars instead, see src/libnrtype/Layout-TNG.h for the interface of the text layout object. That will give you x/y for each char, then you delete the original item and create new text items with these x/y.
Thanks in advance! I will try to work on it! :-)
On Wed, Apr 22, 2009 at 1:08 AM, bulia byak <buliabyak@...400...> wrote:
On Wed, Apr 22, 2009 at 12:58 AM, Karlisson <theanimage@...400...> wrote:
though it can be done in the core of Inkscape without any limitations (i.e. for any kind of flowed text). So, unless someone is going to code a core command for this shortly (you can ask me how to do this if interested), I'm for including this extension as a temprary measure. At least for line splitting it works well.
Well, I've programmed in C for a while, but I think I can take a look :-)
- create a new verb for the split command (better have three commands
for lines/words/letters, without any ui), see verbs.{cpp|h}
- for code of the verb, look into selcue.cpp, _newTextBaselines(): it
takes a layout of a text object and gets the coordinates of its first char for displaying a square mark there:
Geom::Point a = layout->characterAnchorPoint(layout->begin()) * sp_item_i2d_affine(item);
All you need to do in your command is iterate over all chars instead, see src/libnrtype/Layout-TNG.h for the interface of the text layout object. That will give you x/y for each char, then you delete the original item and create new text items with these x/y.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
participants (5)
-
Alexandre Prokoudine
-
Alvin Penner
-
bulia byak
-
Karlisson
-
Terry Brown