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.