- flowRegion makes flow-go.svg render "correctly"
Actually from my reading of the spec, the old rendering was correct: each flowregion filled from top to bottom, even if it contains multiple shapes.
- fixed the lost word problem. note that you need to
put spaces at the beginning of a flowSpan (or the end of the previous) otherwise the words at both ends will be glued together
Yes, that's reasonable
- a preliminary convert_to_text() verb is in sp-flowtext
Excellent, I put it on Shift+Alt+W as "Unflow text", with the Alt+W reserved for "Flow text" (convert text + shape into a flowed text).
There were a few problems:
- compilation errors on char conversions again - fixed
- the text style only worked if set on flowRoot, not flowDiv - fixed by adding SP_STYLE_FLAG_ALWAYS to sp_style_write_string (line 787), so that it writes the entire style of each chunk, including inherited style
- space after flowSpan was lost - partially fixed by adding xml:space="preserve" to the created text, but the start positions of spans are still sometimes off (convert the attached one and watch the words "as well as" and "kinsoku" - they jump off a bit)
Plus a few other small changes, so please take the files from CVS if you want to change something.
I also thought about the best way to create flowed texts. I think using clones is indeed the best method, as it will let us avoid adding flowtext parsing code to a million places. So when you select a shape and a text, here's what happens:
- the shape is cloned, clone placed exactly over the original
- the clone gets inkscape:use-move="parallel" and inkscape:use-delete="unlink" attribs to ensure these behaviors regardless of user prefs (sp-use support required, but it's simple to add)
- tspans with sodipodi:role="line" are merged together, separated by spaces
- an empty tspan with sodipodi:role="line" (i.e. empty line) is converted into <flowLine/>
- the flowRoot is constructed from the clone and the text thus prepared; original text is deleted
The original shape thus remains and is editable as usual, and the text shape will be updated via the clone. This means the paths in "foreign" (non-Inkscape) flowed texts that do not use clones will not be editable at all, but this is OK (at least for now). This approach has the advantage of relative simplicity, and two more commands can be easily added based on the same mechanism - "Flow around" (adds exclusion shape to an existing flowed text) and "Chain flow" (adds a new region to an existing flowed text), with all these shapes remaining editable (i.e. only their clones are added into the flowtext).