Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Why would the TextField.font.size property not be working?

Avatar

Level 1

Hello discussion group,

I have this script in place:

var n = nFirst + nSecond + 17;

// last element represents no. of

// characters in ".@olmc.nsw.edu.au"

if (n >= 24) {

          if (n >= 27) {

                    topmostSubform.Page1.Email_address.font.size = "7pt"

          }

          else {

                    topmostSubform.Page1.Email_address.font.size = "8pt"

 

          }

}

else {

          topmostSubform.Page1.Email_address.font.size = "9pt"

};

Can anyone suggest why it might not be working? I'm able to change other properties of text fields like fill colour, border edge colour etc., but not font size. I've noticed some posting on this subject use the property TextField.textSize instead? I'm using LiveCycle Designer 9 / Acrobat X.

I'm trying to reduce the font size in a field for an email address so that it's not truncated except for an exceptionally long entry.

Perhaps I have the script attached to the wrong event. I've attached it to a calculate event.

Any assistance would be greatly appreciated.

Michael Sandel

2 Replies

Avatar

Level 3

Hi Michael_Sandel_4470,

If you want to automate the font size as per the content of the textfield ou can follow below steps.

Select the field --> open font palette and clicking on small arrow icon on the top left, select 'Edit Value'.

fontZero.jpg

Enter the font size 0(Zero).

The field will automatically adjust the font size as per the content.

Regards,

Ratnesh

Avatar

Level 1

Dear Ratnesh,

Thank you for the reply. Yes, I've ended up using that method. I'm still curious why the original approach is not working though.

I had seen the "set font size to 0 using the LCD dialogue box" method on other postings. I experienced the same behaviour that others have mentioned, where sometimes the automated font size is too big (or bigger than you'd like). I managed to control this behaviour, and apply an upper cap to the font size by adding some "space before" on the paragraph tab.

Paragraph spacing before.JPG

Thanks again.

Sincerely,

Michael Sandel