Copy link to clipboard
Copied
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 :
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)
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";
Copy link to clipboard
Copied
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.?
Copy link to clipboard
Copied
I want to shrink the text.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
But in Illustrator I have not applied any baseline offset property, is it possible to set without applying any property?
Copy link to clipboard
Copied
Use an object style on the text frames and set the Object Style Text Frame Baseline Options to Cap Height, as Scott suggested. InDesign treats text differently than Illustrator.
Copy link to clipboard
Copied
Can I set the first baseline offset as Cap Height and along with that the Min as 0.1in value using script?
Copy link to clipboard
Copied
Why does the font take some space above the text in INDESIGN and not in ILLUSTRATOR?
Copy link to clipboard
Copied
Because the various baseline options in InDesign give you more control over typesetting than Illustrator, because InDesign is a typesetting program and Illustrator is not.
Copy link to clipboard
Copied
Can't we set it the same as Illustrator using script?
Copy link to clipboard
Copied
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";