Skip to main content
vigneshs53970460
Known Participant
November 3, 2016
Question

event.target.textFont

  • November 3, 2016
  • 5 replies
  • 1822 views

event.target.textFont = font.arial;

This is my code, how to fix the "Arial Black" font in the text field and I am using this in "Custom calculation script".

Can anyone help with this.

This topic has been closed for replies.

5 replies

vigneshs53970460
Known Participant
November 4, 2016

You are awesome!

It's working now. thank you so much for your kind help.

vigneshs53970460
Known Participant
November 4, 2016

Thanks you all.

I should not do it by manually, I need a JavaScript.

Using "event.target.textFont = font.Times;" script, I need to change the font into "Arial Black" instead of Times New Roman.

I changed the font to "Arial" but I cannot change the font to "Arial Black".

This is the following script, which I used to change the font to "Arial" (event.target.textFont = 'Arial').

try67
Community Expert
Community Expert
November 4, 2016

Use this code:

event.target.textFont = "Arial-Black";

JR Boulay
Community Expert
Community Expert
November 4, 2016

I just need to change the font type and I am unable to find the "custom format script".

You will find it in the "Format" tab.

Acrobate du PDF, InDesigner et Photoshopographe
vigneshs53970460
Known Participant
November 4, 2016

The text field is in "Read-only" format.

See the below pic. The font is in "Times New Roman" and I need to change that in "Arial Black".

event.target = 'Accepting the Order';

event.target = color.black;

event.target.textSize = 10;

event.target.textFont = font.Times;

event.target.alignment = "left";

I just need to change the font type and I am unable to find the "custom format script".

try67
Community Expert
Community Expert
November 4, 2016

Is this change conditional on the value of the field? If not, why not

simply do it once manually and that's it?

JoelGeraci_Datalogics
Participating Frequently
November 3, 2016

You'll probably want to put that script in the Custom Format script and custom fonts are addressed by their name, not the font object.

Example:

this.getField("myField").textFont = "Viva-Regular";