Shrink-to-fit text default font size | Adobe Higher Education
Skip to main content
AwesomeNick-UYn
Level 2
July 12, 2016
Beantwortet

Shrink-to-fit text default font size

  • July 12, 2016
  • 13 Antworten
  • 15732 Ansichten

Hi folks -

I'm looking for some help with the shrink-to-fit functionality. Is there a method to set the default starting font to something other than size 12 for the shrink-to-fit function?

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von SI_MSD7

Use a multi-line text field (allowing Multiple lines) and set the field value to "0". You wont be able to control the starting font size, but the text will shrink when it reaches the end of the field (similar to AcroForms when the font size is set to Auto).

Note: I believe this requires saving as a Dynamic form vs Static.

13 Antworten

AwesomeNick-UYn
Level 2
August 22, 2016

It would appear you have missed the point. Before this gets out of hand let me clarify: multi-lining does NOT give you control over the starting font. What it DOES do is shrink the starting text slightly. This may or may not work depending on what you're looking for. For my purposes, and at least one other person uses this workaround, it is sufficient.

To drive the point home, one of the forms I am working on has a field text that is roughly 4.8 inches wide. With the font set to auto-shrink for that field, and the font type set to Arial, I can fit 23 lower case w's. If I check the "allow multiple lines" option I am able to enter 28 w's in the same field with those exact same field settings before the text begins to shrink-to-fit.

mattiaswallin
Level 3
August 23, 2016

Yes, using multi line makes the starting font size of an auto fitted text field a bit smaller. And in a sense that is a method to set the default starting font to something other than the regular (even though it does not give you control).

So as you actually wrote initially as a reply to that answer, it's not a conclusive answer (nor solution) but at least it's sort of a pain relief. It is better than basic function, but not perfect.

Great if it works for you!

trents86359089
December 19, 2019

Hi,

 

I know this is years too late, but could help someone. I developed this javascript for Acrobat Pro. I found someone that had a version of it and build on it a bit more.

 

Place this in the event custom calculation. It is a bit iffy is you try to use it with rich text, but fine for multi and single line and scrolling text.

 

What happens is it will set the font to auto originally so any length can be typed in and it will shrink if needed. You can then set a character limit for size 12 to be applied when you exit the field. it in a way will set your default to 12, just based on character length. You will see it applied when you exit the field.

 

The easiest way to work out the length is by setting the field you want to size 12 and filling it. do a character count and apply that to the code.

 

var field = event.target.value.toString().length; if ( field == 0 // when field is empty set text size to auto || // OR field > 20) // when field has less than a character length (eg 20) { event.target.textSize = 0; // text size set to auto }else{ event.target.textSize = 12; // text size wanted. (eg 12) }

 

Hope this can help.