Skip to main content
Known Participant
July 20, 2016
Answered

change font & font size in all text fields

  • July 20, 2016
  • 1 reply
  • 12997 views

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; 

}

}

This topic has been closed for replies.
Correct answer George_Johnson

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";

1 reply

George_JohnsonCorrect answer
Inspiring
July 20, 2016

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";

Participant
January 9, 2019

Can't font size be changed with out code for those who don't know?

try67
Community Expert
Community Expert
January 9, 2019

Sure. You can select multiple fields at once, then right-click one of them, go to Properties and change it under the Appearance tab.