[solved] Simple text break problem

Post questions on how to use or achieve an effect in Inkscape.
Amphibia07
Posts: 5
Joined: Mon Jun 22, 2015 8:33 pm

[solved] Simple text break problem

Postby Amphibia07 » Tue Jun 23, 2015 6:48 pm

Another beginner issue.

I am trying to move some text to the second line.

As you can see in the top image, the cursor is before "Snacks", I press enter which moves "Snacks" the second line, as expected, but not to the beginning of the textbox as would be expected in Word and Illustrator .

Next, I press backspace to remedy this and bring the text to left, but now it just creates a mess. After this point, I am totally lost.

What's a correct move to bring the text to next line?

Text break Inscape.png
Text break Inscape.png (20.74 KiB) Viewed 1889 times

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Simple text break problem

Postby Xav » Tue Jun 23, 2015 7:08 pm

Was this text created in Inkscape in the first place?

What you're doing is correct, but in SVG files that weren't created in Inkscape there are often differences in the way that text is created that can lead to problems making subsequent edits in Inkscape.

As usual, if you can attach an example SVG file it might be easier to identify the cause of the problem.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

Amphibia07
Posts: 5
Joined: Mon Jun 22, 2015 8:33 pm

Re: Simple text break problem

Postby Amphibia07 » Tue Jun 23, 2015 7:23 pm

It was created in R and exported as PDF, then imported in Inkscape, so that could be a cause of the problem. Attached the svg here.
Attachments
Treemap Inscape.svg
(39.54 KiB) Downloaded 258 times

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Simple text break problem

Postby Xav » Tue Jun 23, 2015 9:01 pm

If you look at the text in the XML editor you'll find it contains a <tspan> element. That element has an "x" attribute which consists of a list of positions, resulting in the x-position of each character being fixed in place, stopping the characters from moving freely as you edit.

Culling the x attribute down to just the first value fixes the issue. Deleting it entirely also does the trick (it gets re-generated with just a single number in place). You can manually do this via the text editor for each tspan element, or it might be easier to open the SVG file in a text editor and do it there. It could also be done by writing a simple Inkscape extension, which might be worth pursuing if you've got lots of these to deal with.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Simple text break problem

Postby ~suv » Tue Jun 23, 2015 9:40 pm

Xav wrote:Culling the x attribute down to just the first value fixes the issue. Deleting it entirely also does the trick (it gets re-generated with just a single number in place). You can manually do this via the text editor for each tspan element, or it might be easier to open the SVG file in a text editor and do it there. It could also be done by writing a simple Inkscape extension, which might be worth pursuing if you've got lots of these to deal with.

Or you could use Inkscape's existing command (menu 'Text > Remove Manual Kerns') …

See also e.g. Re: help with editing text in pdf?

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Simple text break problem

Postby Xav » Tue Jun 23, 2015 10:05 pm

~suv wrote:Or you could use Inkscape's existing command (menu 'Text > Remove Manual Kerns') …


Erm.. what he said. For some reason that option had completely escaped my brain. :oops:

You have to select the text objects that it will apply to, so (in 0.91) select one of them then use Edit > Select Same > Object Type to hit them all at once.
Last edited by Xav on Wed Jun 24, 2015 5:01 pm, edited 1 time in total.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

Amphibia07
Posts: 5
Joined: Mon Jun 22, 2015 8:33 pm

Re: Simple text break problem

Postby Amphibia07 » Tue Jun 23, 2015 10:44 pm

Wonderful!

Edit > Select Same > Object Type
'Text > Remove Manual Kerns'

That did the trick! Now everything is editable as it should be.

Thank you both for the help!


Return to “Help with using Inkscape”