Skip to main content
Known Participant
November 19, 2023
Answered

Changing font by javascript

  • November 19, 2023
  • 1 reply
  • 1650 views

Please!! .... I need help.  I 'm so stuck . I've tried but I can't get a font to change within my fields by javascript. It always change to Calibri not Calibri Bold. I have used the  code "console.println(this.getField("Field1").textFont);" to konw the internal name of the Calibri Bold font. But it shows only Calibri for the "Field1" that has been set to "Calibri Bold" manualy.

for (var i=0; i<this.numFields; i++) {

    var f = this.getField(this.getNthFieldName(i));

    if (f.type == "text") {
        f.textFont = "Calibri Bold";
        f.textSize = 12;
    }
}

 

This topic has been closed for replies.
Correct answer Nesa Nurani

Use this: "Calibri,Bold"

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
November 19, 2023

Use this: "Calibri,Bold"

elendil84Author
Known Participant
November 19, 2023

You are really amazing...............