Inkscape.org
Beginners' Questions Text in new envelope/path without splitting text?
  1. #1
    lam3001 lam3001 @lam3001

    I am using Inkscape 1.0.1.

    I have successfully created text along a curved line path (an arc) that works well. I can export it as an SVG and replace the text in the SVG, and it still renders correctly (with the new text) in Inkscape and browsers. Great.

    I noticed that using that method above, each letter of the text is rotated a little to match the curve. In the SVG it is a textPath.

    I'd like to put the text on a path (or in an envelope - I don't really care what the method is) such that the text is unrotated, but still along the path. (like seats hanging from a ferris wheel). Additionally, I would like to be able to save that file, and run a script that can replace the text and export it from Inkscape. (e.g., so I can create a lot of PNGs each with different text). I know how to run Inkscape from the command line and export a PNG.

    The problem is that when I a different approach (creating the text, using Object to Path, and then adjusting the top and bottom lines of the path), it seems to split each letter into it's own object. That means I can't replace all the text with different text (especially if there were a different number of letters). Is there a better way to do it?

  2. #2
    inklinea inklinea @inklinea⛰️

    Yes it probably can be done if you know the ID of the text object ( can be easily set in the template ) or want to apply replacement to all text objects.

    Which OS are you using Linux / Windows etc. Ref writing a script.

    With reference to having the letters hang underneath the line, it may be easier to make a 2nd shape which has been scaled or offset to replicate an imaginary new baseline for the hanging letters.

    Then put the text on that line instead. That way you can adjust the letter spacing if need be to accommodate a tighter radius for example. Not all the letter spacing may look correct whatever method you use, unless you manually space each letter to match the curves of the path. Assuming it is not a straight line. 

    y-axis shift (dx dy in the svg) can be used to do this if you must ( Vertical Kerning box on the Text Command Toolbar ), however *apart from text on straight lines*  the letter spacing doesn't look correct to me. 

    There may be a very clever way of doing it using Path>Reverse ( on the original path ) and then setting the text direction from right to left, but ( I'm using a UK system layout ) never works for me.

    Any script would only be guaranteed to work if the system had the exact fonts you used, if you did want to make a shareable SVG, I would recommend Object>Path on all text objects on a copy.

     

     

     

  3. #3
    lam3001 lam3001 @lam3001

    I have control over all the setup and environment so setting the ID and using is fine. This is and will be on Windows, but eventually could/might be moved to Linux - that's not a concern at the moment. I can make sure the same fonts are installed where they need to be.

    It's not so much hanging underneath, but having the letters along a curve without being rotated. The big concern when I tried this myself was that the text immediately was broken up into letters -- so if I had tried to replace the text later, it would have to be letter by letter and match the same number of letters. This would not work since it also needs to be centered on the path and not all letters are the same with etc.

    Here is an example of what I currently have (very simple), but the letters are rotating with the path. Basically I want this but with the letter standing straight up along the same path.

  4. #4
    inklinea inklinea @inklinea⛰️

    I think its called stair step type on a path in Illustrator.

    I don't have illustrator, but there is a screenshot of the effect you are looking for on the adobe forum https://community.adobe.com/t5/photoshop/arrange-letters-in-a-cricle-without-rotating-them/td-p/10093506?page=1

    I don't think Inkscape has an option to do this. 

    It seems someone has solved a similar problem in javascript on this page user 'wei' has posted a javascript answer to find x coordinate given any y coordinate on a path. ( you want the reverse ). Then the bottom centre of the text letter bounding box can be found, and with a bit of simple maths move the coordinates of the letter to match. Converting text to path ungrouping then looping through the object letter.

    In short, I think without python extension, it won't work.

     

Inkscape Inkscape.org Inkscape Forum Beginners' Questions Text in new envelope/path without splitting text?