Hi Guys,
Just to report that r11895 has a rather ugly bug in the flow text. After creating an initial text, I wasn't able to edit it anymore. Unfortunately launchpad is in the 3 second zone of timeouts for me in Chongqing, China and I've never been able to use it, otherwise I'd add the bug list there. Please bear with my good intention.
And David,
If you've ever imported a PDF file with lots of text in layouts, you may have noticed that every single character gets a position. Now that's fine until you try to change the text in any way as the text string will change, but not the positions string. In other words, you end up with garbage. The workaround for that is to use the split text extension. Which cleans up all the manual kernings nicely.
Maybe that can lead you to solve your problem as well, as it seems related.
Cheers
Jelle
Message: 8 Date: Mon, 26 Nov 2012 13:08:16 -0800 From: mathog <mathog@...1176...> Subject: Re: [Inkscape-devel] tspan Text Starts To: inkscape-devel@lists.sourceforge.net Message-ID: <a3d4787463b3de4b4f2a326b82cdf6ab@...2855...> Content-Type: text/plain; charset=UTF-8; format=flowed
On 23-Nov-2012 19:48, Martin Owens wrote:
hey guys,
I'm developing an extension to manage translations (which I do via launchpad and xml2po) but I'm having trouble with tspans.
The problem seems to be that inkscape saves multiple values for the x attribute for some (not all) tspan sections. Specifying the letter placements is death to translations as the number and size of letters is guaranteed to be different.
Is there any api way to strip out these bumbling attributes or better have them not appear in the first place?
Hmm. Well, this may not be what you are after, but...
I have been working on code to reassemble formatted, editable text from component pieces. The idea is that something like this in Inkscape:
(E:bold)(=mc:no special formatting)(2:superscript)
when present in an EMF or PS file, for instance, is represented by 3 separately formatted text strings: {E,=mc,2}
These are currently read back into Inkscape as just those pieces. It looks exactly like the original, but the pieces are not assembled, so the whole is not editable. My code tries to reassemble the pieces from its position, font information, etc. and makes <test><tspan> records to match. This work is not done but the current version does pretty well at figuring out where paragraphs start and end, figures out the justifications and so forth, and generating editable Inkscape SVG. It works with rotated text, but at present cannot figure out when the first sentence of a paragraph belongs with the remainder if the first is indented by starting it an offset (as opposed to by using leading spaces.)
For your purposes, would it be sufficient if after reassembly the formatting information was discarded and just the logical information retained? That would give you sentences and paragraphs (super and subscripts would be problematical.)
Regards,
David Mathog mathog@...1176... Manager, Sequence Analysis Facility, Biology Division, Caltech