Copy link to clipboard
Copied
Hi
I have a code that shows a calculation of round corners of a rectangle in illustrator
I need the result of the calculation to be in a 24-inch font
I attach the code:
// select round-cornered rectangle
var points = app.selection[0].pathPoints;
var x1 = points[3].anchor[0], x2 = points[4].anchor[0];
var y1 = points[3].anchor[1], y2 = points[4].anchor[1];
var rect1 = app.activeDocument.pathItems.rectangle(y1 + 20, x2 - 60, 50, 20);
var text2 = app.activeDocument.textFrames.areaText(rect1);
text2.contents = +(Math.round((Math.abs(x2 - x1)*0.352777777)+ "e+3") + "e-3");
text2.contents = "r.=" + text2.contents;
Copy link to clipboard
Copied
It is very important that as the size changes, the text box will also grow.
Copy link to clipboard
Copied
Why do you not simple use the same font size from previous part of the script (specify.jsx)?
…
t.textRange.characterAttributes.size = labelFontInUnits;
…
(untestet) as
…
text2.textRange.characterAttributes.size = labelFontInUnits;
…
Copy link to clipboard
Copied
I sent you a message in private.
Copy link to clipboard
Copied
Sorry, but unfortunately not at the moment.