Copy link to clipboard
Copied
Hello,
Im using this code and im trying to change weight font in my text layer.
var textProp = app.project.activeItem.layer(1).property("Source Text");
var textDocument = textProp.value;
textDocument.font = "Arial-Bold";
textProp.setValue(textDocument);
But this does not Changing the font to the "Arial-Bold" font,
What did I do wrong?
It's not Arial-Bold, but rather Arial-BoldMT
var textProp = app.project.activeItem.layer(1).property("Source Text");
var textDocument = textProp.value;
textDocument.font = "Arial-BoldMT";
textProp.setValue(textDocument);
Copy link to clipboard
Copied
It's not Arial-Bold, but rather Arial-BoldMT
var textProp = app.project.activeItem.layer(1).property("Source Text");
var textDocument = textProp.value;
textDocument.font = "Arial-BoldMT";
textProp.setValue(textDocument);
Copy link to clipboard
Copied
Thanks for your answer!
Yes it works good in this case,
But what should it do in the other situations?
like when i want the font to be "Arial-Narrow",
and "Arial-NarrowMT" not working.
So what is actually the method to work with weight font ?
Copy link to clipboard
Copied
Well, all you have to do is:
1. Set font you like manually.
2. Run this command to see what it prints.
3. Use this value in your script.
var textProp = app.project.activeItem.layer(1).property("Source Text");
var textDocument = textProp.value;
alert(textDocument.font)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now