1

I have a lot of text objects in point format and would like to convert these to text paths (see images). Is this possible?

point text text along path

  • 1
    If you want a way to automate this, you are probably going to have to write a script for it - assuming it is in fact possible to do so. – Billy Kerr Aug 29 '17 at 9:38
  • Yes, but I have no knowledge in writing Illustrator scripts – oskarlin Aug 30 '17 at 15:14
2

Not sure how proficient you are with scripting, but here is a snippet which takes one point text item and turns it into a text path item. You can ask here or on the Adobe Illustrator scripting forum, how to extend this snippet to do more complex operations - for example, right now it will throw errors for many things if the conditions are not just right.

#target illustrator
function test(){
  var doc = app.activeDocument;
  var t = doc.textFrames[0];
  var point = t.anchor;
  var width = t.width;
  var newPath = doc.pathItems.add();
  newPath.setEntirePath([[point[0], point[1]], [point[0] + width, point[1]]]);
  var newPathText = doc.textFrames.pathText(newPath);
  newPathText.contents = t.contents;
  t.remove();
};
test();

-------------------------- EDIT #1 -------------------------

#target illustrator
function test(){
  var doc = app.activeDocument;
  doc.selection = null;
  var t = doc.textFrames[0];
  var point = t.anchor;
  var width = t.width;
  t.selected = true;
  t.convertPointObjectToAreaObject();
  app.redraw();
  t = doc.selection[0];
  doc.selection = null;
  var tempTextPath = t.textPath;
  var angle = Math.atan2(tempTextPath.pathPoints[1].anchor[1] - tempTextPath.pathPoints[0].anchor[1], tempTextPath.pathPoints[1].anchor[0] - tempTextPath.pathPoints[0].anchor[0]) * 180 / Math.PI;

  var newPath = doc.pathItems.add();
  newPath.setEntirePath([[point[0], point[1]], [point[0] + width, point[1]]]);
  newPath.rotate(angle, undefined, undefined, undefined, undefined, Transformation.BOTTOMLEFT);
  var newPathText = doc.textFrames.pathText(newPath);
  newPathText.contents = t.contents;
  t.remove();
};
test();

-------------------------- EDIT #2 -------------------------

#target illustrator
function test(){
  function convertPointText(pointText){
    var doc = app.activeDocument;
    doc.selection = null;
    var t = pointText;
    var point = t.anchor;
    var width;
    var size = t.textRange.characterAttributes.size;
    t.selected = true;
    t.convertPointObjectToAreaObject();
    app.redraw();
    t = doc.selection[0];
    doc.selection = null;
    var tempTextPath = t.textPath;
    var angle = Math.atan2(tempTextPath.pathPoints[1].anchor[1] - tempTextPath.pathPoints[0].anchor[1], tempTextPath.pathPoints[1].anchor[0] - tempTextPath.pathPoints[0].anchor[0]) * 180 / Math.PI;
    t.rotate(-angle, undefined, undefined, undefined, undefined, Transformation.BOTTOMLEFT);
    width = tempTextPath.width;

    var newPath = doc.pathItems.add();
    newPath.setEntirePath([[point[0], point[1]], [Math.round(point[0] + width), point[1]]]);
    newPath.rotate(angle, undefined, undefined, undefined, undefined, Transformation.BOTTOMLEFT);
    var newPathText = doc.textFrames.pathText(newPath);
    newPathText.contents = t.contents;
    newPathText.textRange.characterAttributes.size = size;
    t.remove();
  };

  var doc = app.activeDocument;
  var sel = doc.selection;
  var workTextFramesArray = [];
  for (var i = 0; i < sel.length; i++) {
    workTextFramesArray[i] = sel[i];
  }
  for (var i = 0; i < workTextFramesArray.length; i++) {
    convertPointText(workTextFramesArray[i]);
  }
};
test();
  • I'm not so familiar with the scripting in Illustrator but this one works OK. The problem is that this script doesn't care if the point text object is rotated. Is that possible to solve? Would you recommend me asking somewhere else or continue discussing here? – oskarlin Aug 30 '17 at 14:06
  • Unfortunately I lack the time to get into the routine needed to perform the necessary rotation, at the moment, but I have an idea of how I could go about it, and would actually like to try it out. If you're willing to wait a bit, I think I may be up for the challenge. One important question: are you using Illustrator at least version CC2015? – Silly-V Aug 30 '17 at 15:42
  • 1
    Yes I use 2015.3 at the moment and I'm planning on upgrading to 2017 soon but I'm using plugins that doesn't entirely support 2017 yet. Anyway there's no rush. And I'd be so happy if you solved it! – oskarlin Aug 31 '17 at 15:48
  • Okay, please wait around a few days, I'll likely have your solution. – Silly-V Aug 31 '17 at 16:55
  • 1
    Oh that's not hard , stay tuned for the next edit ! – Silly-V Sep 4 '17 at 13:48
1

Copy, paste.

There's no automated solution to create text on a path. It requires the path(s) to be drawn, then the Type in a Path tool to click a path. (Then you can paste text).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.