Copy link to clipboard
Copied
hi, i want to change font & font size in all text fields. I have tried bellow code but it change the font size but didn't change the font. can u pls help me. thanks..
font - Courier New
font size - 10
// Loop throught the fields in the document
for (var i = 0; i < numFields; i++) {
// Get a reference to the current field
var f = getField(getNthFieldName(i));
// Change the properties of certain types of fields
switch(f.type) {
case "text":
f.textFont = font. Courier New;
f.textSize = 10;
}
}
Do you have a good reason for wanting to use Courier New instead of the built-in Courier font? In any case, you need change that one line to:
// Use the built-in Courier font
f.textFont = font.Cour;
- or -
// Use Courier New
f.textFont = "CourierNew";
Copy link to clipboard
Copied
Do you have a good reason for wanting to use Courier New instead of the built-in Courier font? In any case, you need change that one line to:
// Use the built-in Courier font
f.textFont = font.Cour;
- or -
// Use Courier New
f.textFont = "CourierNew";
Copy link to clipboard
Copied
Can't font size be changed with out code for those who don't know?
Copy link to clipboard
Copied
Sure. You can select multiple fields at once, then right-click one of them, go to Properties and change it under the Appearance tab.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now