Reply To: Variable Font Parameters

#14323696
ll1324
Member

Bother! After some fiddling around, found it out. Here’s an example of a quick script to change the weight of each character in a selection so that it goes from the lightest weight to the heaviest (the result is the text gets darker and darker the further along you go). Note: you have to already have applied the Acumin Variable Concept font to the selected text, and you also have to select the text itself (it will only do the selected text):

//

if (app.documents.length == 0)
{
alert (“No open documents!”);
exit ();
}
selectedText =app.selection[0].characters;
t=selectedText[0];
myDesignAxesName=t.appliedFont.designAxesName;
myDesignAxesRange=t.appliedFont.designAxesRange;
myDesignAxesValues=t.appliedFont.designAxesValues;
range=myDesignAxesRange[0];
w0=range[0];
w1=range[1];
stepping=(w1-w0)/selectedText.length;
for (s=0; s<selectedText.length; s++)
{
myDesignAxesValues[0]=(w0+stepping*s);
selectedText[s].designAxes=myDesignAxesValues;
}
alert(“Done”);

// End.

This article was last modified on November 15, 2019

Comments (0)

Loading comments...