Page 1 of 1

Set font of a FreeText annotation

Posted: Mon Jun 06, 2016 12:45 pm
by prosozial_schmitt
Hello,

I want to create a FreeText annotation by JavaScript. I Need to create this annotation with a monospaced font. My script is working - but the annotation is always drawn in font.Helv(?) and not in font.Cour.
How can I change this to the needed behaviour?

Greetings
Hans-Peter

Script:

var annot = this.addAnnot
({
type: "FreeText",
page: 0,
textFont: font.Cour,
textSize: 12,
rect: [235.4114,631.2243,308.9114,644.7243],
width: 0,
fillColor: color.transparent,
strokeColor: ["RGB", 0.00,0.00,0.00],
alignment: 0,
opacity: 1,
rotate: 0,
contents: "_iMi_"
});

Re: Set font of a FreeText annotation

Posted: Mon Jun 06, 2016 2:58 pm
by Tracker Supp-Stefan
Hello prosozial_schmitt,

Your code worked for me in the stand alone portable Viewer, though the font used for the annotation was CourierPS.
Please try changing the following line:

Code: Select all

textFont: "Courier New",
And see if using the non post script uniform font will work better for your needs?

Also please make sure that you have the latest version of the dlls to make sure this is not an issue with an older build.

Regards,
Stefan

Re: Set font of a FreeText annotation

Posted: Tue Jun 07, 2016 5:54 am
by prosozial_schmitt
Hi Stefan,

I've tried it with textFont: "Courier New" and it works. Using "Arbitrary font" font.Cour seems not to work - but this is now not a real problem for me.

Great :)


Thank you very much
Hans-Peter

Re: Set font of a FreeText annotation

Posted: Tue Jun 07, 2016 12:19 pm
by Tracker Supp-Stefan
Glad I could assist Hans-Peter!

Cheers,
Stefan