Convert-to-Text sometimes doesn't produce correct SVG

Bug #247632 reported by sas
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

To reproduce (tested with SVN revision 19261, on Windows XP):

  (1) Open the attached file (flowtext.svg).

  (2) Select the flowed text and convert it to ordinary text (Text -> Convert to Text).

  (3) Save the file (as Inkscape SVG).

  (4) View the saved file in a reliable SVG viewer, such as Batik Squiggle, or Adobe SVG Viewer. You will see that the lines overprint one another. (If you examine the file, you will see that y-coordinates aren't specified for any line other than the first.)

The problem doesn't occur for all flowed text. It seems to occur only when there is no transform on the text. Looking at the source code (SPFlowtext::getAsText() in src/sp-flowtext.cpp), this is not surprising. But I don't understand what the code is trying to do, so I'm not sure how to fix it.

Revision history for this message
sas (sas-sas) wrote :
Revision history for this message
sas (sas-sas) wrote :

The attached patch fixes this bug. But what's all that code I hacked out?

Revision history for this message
Richard Hughes (cyreve) wrote :

That code is designed to avoid writing attributes which are unnecessary, because if we explicitly specify y-coordinates for the lines then later editing operations in Inkscape won't necessarily work because they'll think that the user specified that they really wanted that line to start there. You seem to have ended up in a case where the start of a line isn't the start of a line, which is odd. I'll have a look at it when I get my build working again.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Richard, so is this patch OK to commit?

Revision history for this message
Richard Hughes (cyreve) wrote :

Fixed in r20115. It turned out that the hacked-out code was important for the editability of the converted text. With the patch as proposed, inserting line breaks or changing the line spacing of the text went badly wrong. Anyway, the fix makes it work on Batik, Adobe and Opera. I presume the fact that it doesn't work on Gecko is their bug.

Sorry about the delay - my build was broken for longer than I expected and I simply forgot.

Changed in inkscape:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.