Text on path direction problems

Post questions on how to use or achieve an effect in Inkscape.
fresta
Posts: 6
Joined: Fri Feb 20, 2009 8:06 pm

Text on path direction problems

Postby fresta » Thu Apr 23, 2009 12:52 am

Hello,

I have a problem getting the text put on a path in the right direction. It works well when I do it in a new document, but when I try to add it to a current inkscape project I'm working on the text always appears in the wrong direction. It's probably best described with some images so I'll attach them below.

In the larger document I create an ellipse and some text, and rotate the ellipse by 90 degrees and center the text so it should appear at the top of the ellipse after putting it on the path.

textonpath1.png
textonpath1.png (2.97 KiB) Viewed 9318 times


After putting text on the path it appears on top but on the inside, upside down and right-to-left.

textonpath2.png
textonpath2.png (3.67 KiB) Viewed 9316 times


I've tried reversing the path, rotating and reflecting horizontally and vertically, which of course changes things but the text is always in the wrong direction since reversing or reflecting changes both the direction of the text and the position inside <-> outside the ellipse.

Strangely, copying the two objects to a new document and putting text on path there works as it should.

textonpath3.png
textonpath3.png (2.44 KiB) Viewed 9319 times


Copying and pasting back into the original document doesn't work at all since the text gets detached from the path.

I'm at a loss what to try next, any ideas?

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: Text on path direction problems

Postby prkos » Thu Apr 23, 2009 1:31 am

I think it all depends on the path direction. Under Path menu you have Reverse option. Just use it on the ellipse that gives you inside text, then put text on it and it should now appear outside. I also think that ellipse that is a true ellipse (draw with the ellipse tool) doesn't have direction or it's always the same direction, only when you convert it to a path can you change its direction.

Why not copy the text together with the path into your document? Just select both and copy-paste as if it was one object, or group them if it's easier.
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

fresta
Posts: 6
Joined: Fri Feb 20, 2009 8:06 pm

Re: Text on path direction problems

Postby fresta » Thu Apr 23, 2009 3:28 am

Thanks for the quick reply. I've already tried copying the correct version of the text on path both directly and as a group and pasting it into the original document. The text is then detached from the path (or it appears so):

textonpath4.png
textonpath4.png (2.85 KiB) Viewed 9313 times


I also tried reversing the path which works but it doesn't give the desired result (first convert the ellipse to path, then reverse direction and put text on path):

textonpath5.png
textonpath5.png (3.63 KiB) Viewed 9322 times


In fact, after converting to path the nodes on the ellipse are placed in the order 6, 9, 12, 3, 6 o'clock, as can be checked with the number nodes tool. So reversing the direction of the path is equivalent to flipping the ellipse horizontally.

It's as if the text direction is reversed in this particular document only. I could try copying everything over to a new document but there's a lot of artwork in many layers so that's a last resort.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Text on path direction problems

Postby brynn » Thu Apr 23, 2009 12:23 pm

What version of Inkscape are you using?
Your problem sounds suspiciously like a bug I've reported several instances of. However it's been fixed in the dev version.

fresta
Posts: 6
Joined: Fri Feb 20, 2009 8:06 pm

Re: Text on path direction problems

Postby fresta » Thu Apr 23, 2009 11:20 pm

Version 0.46 (Apr 7 2008), the default package in Ubuntu 8.04, so it is a bit dated.

I removed all layers except the one containing the text on path example and attached the file as textonpath.svg. It would be nice if someone could confirm that it works correctly in a more recent version. In my version, attaching the text to the ellipse gives the result displayed in the figure textonpath2.png above.
Attachments
textonpath.svg
(3.46 KiB) Downloaded 234 times

User avatar
EarlyBlake
Posts: 302
Joined: Tue Jun 03, 2008 5:42 pm

Re: Text on path direction problems

Postby EarlyBlake » Fri Apr 24, 2009 2:47 am

I notice in the XML Editor all the text added to in your document had the line

Code: Select all

transform scale (1,-1)

which is in effect mirroring the text. Inksacpe has the text mirrored, because for some reason every thing in your document (or at least on that layer) is mirrored. The texts looks OK before you do the put text on path because it's mirrored twice. For some reason when the "put text on path" doesn't not add the mirroring effect for text on path so it appears backwards.

I tried adding the "transform scale (1,-1)" line to the text once it was on the path. It flipped the text on the path so it read the right way, but it also moved the off the page, and out of view. It had to be moved back by hand. The transformation matrices for Inkscape is not intuitive to me. I took my best guess at number to do the transformation on operation in one step, and I was way off.

I look further up the XML tree for you document for the first line causing a "reflection" and found the line

Code: Select all

transform matrix(1.25,0,0,-1.25,0,1051.25)

In the node "g11". Was g11 a layer name in the original document or a group?
A negative number in the first or the forth slot in the matrix mirrors and object up down or right left. I changed the negative -1.25 to 1.25 and everything in your document flipped back to normal but of-course it also moved.

When I added a new layer to the document and move it in the XML tree with the up arrows above the g11 node, there was no mirroring going on there. I could at the text to a path with out a problem. So if the text on path can go on it's own layer above what ever else you have that would be an easy fix.

If you want to live dangerously you can just delete the transformation line from the g11 node than see what needs fixing. If you want to live more dangerously you can just delete that node. If too many paths disappear you could promote items out of it, then see what you lose. Back up first!!!!!! if you decide that. I think you will lose some z order if you do that.

If none of the above work for you, and if you are only putting a couple of lines of text on a path you could kludge it. Once you do the text to path, move the text slightly. The XML editor will add a line like this:

Code: Select all

transform translate(34.165448,23.915814)

select that line then erase the translate(#####,#####) and replace it with scale(1,-1). Then move the text back on to the line. When you move the test you'll see the ]transform line change to the matrix(.....).

Or put the text on a path in another file transform it to path then cut and past it in.
Attachments
problemh.png
Line with the problem high lighted.
problemh.png (131.48 KiB) Viewed 9269 times
Last edited by EarlyBlake on Sat Apr 25, 2009 4:58 am, edited 4 times in total.

fresta
Posts: 6
Joined: Fri Feb 20, 2009 8:06 pm

Re: Text on path direction problems

Postby fresta » Fri Apr 24, 2009 6:10 pm

Yes, that's it! Many thanks for the help!

The document was converted from a pdf which in turn was exported from an old version of Freehand. I guess that the transform is needed because the coordinate systems differ.

All your suggestions should work. However, I found that the easiest way was to remove the transform completely from the xml code and instead applying it manually with the transform tool. Then Inkscape apparently does a lot of simplification on each object, getting rid of the double reflections. There was only a slight problem in that everything was offset vertically a fixed distance (maybe something to do with the origin of the transformation) and some very minute differences in scaling which probably comes from rounding errors. But I needed to adjust alignments anyway so that wasn't a problem.

Again, thanks a lot!


Return to “Help with using Inkscape”