Skip to main content
Known Participant
July 10, 2022
Answered

How to avoid overflow of TextFrame contents for different Font

  • July 10, 2022
  • 2 replies
  • 1491 views

I'm facing the issue of text-overflow for TextFrame content in Indesign based on the font style 

For Ex:

If  I use the font ITC Avant Garde Gothic for the TextFrame content :

  • Jack
  • Tom 
  • Henry 
  • David
  • Steve

with the dedicated height and width for the text frame and if I use another font like Montserrat for the same TextFrame content, the content gets overflowed.

How can I overcome the issue using the script? (I don't want to change the Height and Width of the TextFrame for different Font Style)

This topic has been closed for replies.
Correct answer brian_p_dts

Can't we set it the same as Illustrator using script?


You don't need a script. Use Object Styles. But do it via script is: 

myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.CAP_HEIGHT;
myTextFrame.textFramePreferences.minimumFirstBaselineOffset = ".1 in";


2 replies

Scott Falkner
Community Expert
Community Expert
July 11, 2022

Change the First baseline offset for the text frame. If you use a fixed height then the first baseline will always be in the same place regardless of font.

SA8888Author
Known Participant
July 11, 2022

Hi, this is my doubt about using the font Montserrat, 

 

 

Here on the left side I have the screenshot of the INDESIGN Document and on the Right side, I have the screenshot of the Illustrator Document, here I have used the same font Montserrat Regular for both INDESIGN and ILLUSTRATOR in INDESIGN the text has started with some space above the content and in ILLUSTRATOR there is no space compared to INDESIGN. Is it possible to create the text without any space above in INDESIGN using script?

 

SA8888Author
Known Participant
July 11, 2022

If you want the top of the capital letters to align with the top of the text frame then make the first baseline offset the Cap height.


Why does the font take some space above the text in INDESIGN and not in ILLUSTRATOR?

brian_p_dts
Community Expert
Community Expert
July 10, 2022

You can determine if a specific frame is overset with: 

if (myFrame.overflows) {

//do stuff 

}

 

Question is: what do you want to do? Shrink the text, resize the frame, etc.?

SA8888Author
Known Participant
July 11, 2022

I want to shrink the text.