Author Topic: How Do I Fit Text to a Closed Path?  (Read 2165 times)

November 22, 2017, 03:19:38 PM
Read 2165 times

Bill.YEG

  • Sr. Newbie

  • Offline
  • **

  • 6
Relative newbie/noob here.  :???:

I'm stuck on how to fit text to a path. Please see attached .svg.

I was successful once, but I guess it was beginner's luck, as I have not been able to do it again.  :hh:

Roughly what I did before:
  • Duplicate the closed path.
  • Move the duplicate up, cleared its fill and gave it a stroke.
  • Outset it.
  • Remove all the path except the top stroke.
    • I suspect this is where I get lost.  :?:
  • Reverse the path so the text will fit above it.
  • Create the text object.
  • Centre the text object as I want it to center on the path.
  • Select both the path and the text.
  • Select "Put on Path".

Voila, just what I wanted.

I will be eternally grateful for any help!  :help:  Thank you very much!  :ty1:
  • 0.92
  • Windows 10

November 23, 2017, 03:14:11 AM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

I can't figure out what's going wrong, but the problem seems to be with the path.  If I draw a new path, the text fits on it just like expected.  Or if i simply duplicate your path, the text goes right on the duplicate.

I can't figure out what's wrong with the path, that's causing this.  It looks like you might have isolated the path and the text from another file.  So the answer might be in that file.  Without seeing that (and even if I could look at it) I might not be able to find the problem.  Someone else might be able spot the problem. 

For some reason, no matter where I move your path, when I put the text on the path, the text anchor is located precisely on the top-left corner of the page border.  I've sometimes seen patterns behave like that (aligned to the top-left corner), but I've never seen text do this before.

The fastest solution would be to just duplicate your path, and delete the original.  If you can share the other file, there's a chance we can find out what's causing this.  But at least you can move on by using a duplicate.

  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

November 29, 2017, 09:58:48 PM
Reply #2

Bill.YEG

  • Sr. Newbie

  • Offline
  • **

  • 6
Thank you for your detailed response, brynn! And for the welcome!

I think I just just copied and pasted the original path from another .svg file. (If you don't mind, please, could we let let this go for now.  :) )

I'm glad to know that you had success with duplicating my path and putting the text onto it.  I managed to do it once, but can't do it again. (I remember deleting all the path except for the top line, but for the life of me, I don't remember how and haven't been successful at doing it again! Maybe this isn't the best way to do it anyway!)

(The examples I found in the manual all show the text being put on an arc of a circle [can I call this an open path?], rather than a full circle [a closed path?])

Would you be so kind, please, as to step me thru the correct way to do this?

Very much appreciated!

PS: If you'd still like to see the original file, say the word--I'd be more than happy to post it.
  • 0.92
  • Windows 10

December 01, 2017, 02:42:39 AM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
(If you don't mind, please, could we let let this go for now.  :) )
Yes, we can probably forget about that.  Unless for some reason you can't use the other workarounds.  If not we would need to know what's causing the problem, so it can be fixed.

You're doing it correctly -- by the book, as they say.  (I just can't figure out why the path doesn't work, but a duplicate does.  But for now we won't worry about it.)

(The examples I found in the manual all show the text being put on an arc of a circle [can I call this an open path?], rather than a full circle [a closed path?])
Yes, that's absolutely correct terminology.

This is what works for me (using the file you attached earlier).

1 - Select the path
2 - Duplicate
3 - Delete the original (Alt + click + click to select the original when it's underneath the duplicate)
4 - Select both text and path (better to do by selecting one, hold Shift while selecting the other - this avoids accidentally selecting something else) (which could cause it not to work properly)
5 - Text menu > Put on Path

I'm not sure if you meant for the text to be inside the closed path.  But when you reversed the path, that's what makes the text go inside.  If you want it outside, just reverse the path again.

Bonus info:

You can change the location on the path, where the text starts, by a couple of different tricks.  (doesn't work with centered text)
1 - Decide which node you want the text to start at.  Select the node to the left.
2 - Break the path ("Break path at selected nodes" button on Node tool control bar)  (looks like  :brp: ).
3 - Select both resulting nodes (by dragging tiny selection box wih the  Node tool))
4 - Join nodes ("Join selected nodes" button on the control bar) (looks like :jsn: ).

Or if the distance is not too far, or if you want to text to start at a location which doesn't have a node, you could just add spaces before and/or after the text, to move it where you want.  Or, if the path is a circle, you can rotate the circle to get the text in the right place.  Or any combination of these would work as well.

  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 02, 2017, 02:29:03 PM
Reply #4

Bill.YEG

  • Sr. Newbie

  • Offline
  • **

  • 6
This is very helpful, brynn,  :ty1:

Your "bonus" info is very helpful too, as it lets me have the text start at the upper left node of the path.

With your able help I have progressed a lot, but I get lost on the following steps. (I think I see that the intent of this sequence is to create a new end-point node for the text to align to and with the path still closed so it can be edited as such later if needed. Am I close? :) )
3 - Select both resulting nodes (by dragging tiny selection box wih the  Node tool))
4 - Join nodes ("Join selected nodes" button on the control bar) (looks like :jsn: ).
I see the tiny selection box, one node is a diamond shaped outline and the other is a solid diamond inside the outline.
If I click on the two nodes, it seems to select only the outline--if I drag at this point, only the outline node and its path moves. How does one select them both? And where does one want to drag them? (They are exactly where I want them, so dragging them would move them, wouldn't it?)

(The good news for me: Even with the path still open, the text puts exactly where I want it, so now I can continue with making the image I intended even if it isn't quite right under the covers. B-) )

Thank you very much!! ..Bill..

PS: About the problem path in my example file from my original post. I'll open a new topic and attach the original file. It was made by a designer professional who we no longer have access to.
  • 0.92
  • Windows 10

December 02, 2017, 04:59:49 PM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
When you select a node and break the path, there are now 2 nodes where before there was one.  And they are precisely on top of the other.  So you can really only select the one on top, unless you move them apart.  In this case, you don't want to move them apart.

So with the Node tool, when you drag a selection box, you start on an empty part of the canvas, and end on an empty part of the canvas.  You're not actually dragging nodes.  You're outlining a specific part of the canvas.  Everything inside the rectangle that you see is being dragged out, becomes selected.

With the Node tool, you're selecting nodes.  But you can do the same thing with the Selection tool, and then you are selecting objects. 
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 22, 2017, 11:09:03 AM
Reply #6

Bill.YEG

  • Sr. Newbie

  • Offline
  • **

  • 6
Perfect! Thank you!

It's SO satisfying to click "Text to path" and watch the text fall perfectly into place!

Very much appreciated!

..Bill..
  • 0.92
  • Windows 10