Copy link to clipboard
Copied
Is there any functionality within Indesign to "autosize" the size of text within a fixed size text frame?
By this I mean if you have a text frame of a defined size, and text is keyed into it, then the initially applied paragraph style should control the font size of the text. But if the text required will not fit the actual text frame (and the text frame should not be expanded), then the font size automatically reduces/resizes to fit the text into that text frame.
If this is possible would be great to know. I've explored the forums and cannot find this information. There was some indication about using grep styles, but nothing definitive found, so any advice would be much appreciated.
Thanks.
Copy link to clipboard
Copied
Not that i'm aware of there are some scripts that do this on the Scripts part of this forum. I'd attach the one i use from the forum but i dont see an attach button.
Copy link to clipboard
Copied
I did see some mention somewhere about scripting. I was just wondering if there was some hidden gem in Indesign that could do this without the need for scripting. If I don't get any other feedback, might be the route I'll have to take.
Also I don't know if you are able to copy/paste a URL to your link in the comment. That should be possible. Thanks.
Copy link to clipboard
Copied
Ok. Let me know if you want it and. i'll paste my code in here or send you the .jsx file. (If no one else has any solutions.)
Copy link to clipboard
Copied
If you can paste the code here that would be great. At least I can start with that as a solution if no further feedback comes in.
Thanks very much. 😉
Copy link to clipboard
Copied
(function(/*Item[]*/a,/*str*/k,/*uint*/MIN,/*uint*/MAX, /*num*/PRECISION)
{
var t, s, v, w, m = [],
wrong = function(){ return +t.overflows };
while( t=a.pop() )
{
if( 'TextFrame'!=t.__class__ ) continue;
// Init
// ---
v = (s=t.parentStory)
; m[0] = MIN;
m[1] = MAX;
// Try extremum and quit if status doesn't change
// ---
s
= m[1-(w=wrong())]; if( w==wrong() ){ s
=v; continue; }
// Binary search
// ---
while( m[1]-m[0] > PRECISION ){ m[w=wrong()] = s
= (m[0]+m[1])/2; } w && (s
= m[0]); }
})(app.properties.selection||[], 'pointSize', 4, 16, .01);
at the bottom are your min/max Font size and the increments it will adjust. I have this set to 4pt for my minimum and 16 for my max. You may need to change this. I also have it set to adjust the text .01pt at a time you may need to adjust that as well. You'll have to have the Text BOX selected then run the script. You can have any number of text boxes selected as well.
Copy link to clipboard
Copied
Does this work for Illustrator was well, do you know?
Copy link to clipboard
Copied
You need to ask Illustrator questions in the Illustrator forum:
Copy link to clipboard
Copied
Hi,
I created a script from your post, named it something like fittextwide.js, then saw that it was installed, selected my text box, ran the script....
and nothing.
Any ideas? Maybe this no longer works.
ID CC 14.0.1 x64
Thanks
Copy link to clipboard
Copied
Hi Chris,
just tested the script code by cbishop01 from reply 5 with InDesign CC 2019 version 14.0.1.209 on Windows.
It's running as expected.
See also in the script code.
There is a maximum and minimum defined there for point size.
Maybe that is causing your issues?
Regards,
Uwe
Copy link to clipboard
Copied
https://forums.adobe.com/people/Chris+Purser wrote
… Any ideas? Maybe this no longer works.ID CC 14.0.1 x64
Thanks
Another thought:
Maybe you should enforce a screen redraw after running the script?
Could be that the script is doing its job and you can only see the result after e.g. changing the view by going to a different spread and coming back?
Regards,
Uwe
Copy link to clipboard
Copied
Hi Uwe,
I had adjusted the font sizes - even to extremes to make sure, and it still did nothing.
I just tried again trying that force screen redraw idea, and still nothing.
That wouldn't really help though, even if it worked, because if it's not doing it live like spark does, it would be really time consuming to make a change, leave the page and come back, make another small change, leave... wash, rinse, repeat...
I'm sure I did something else wrong that's not spelled out in this thread. Like the doc type or something that I'm in, or not in, or some other setting that's obvious to others...
Thanks...
Copy link to clipboard
Copied
Hi Chris,
can you share a sample document with just one text frame where you see the issue?
Upload it to Dropbox or a similar service and post the link.
Thanks,
Uwe
Copy link to clipboard
Copied
Hi - sorry. I worked around the problem and no longer have something I can share...
Plus I deleted the script and moved on. It's ok to do the same with my ticket
Cntrl shift drag-corner does enough.
It (this ONE behavior, lol) is just not as good as Spark, (with all its faults and limitations) which is the part that surprised me and got me looking...
Thanks!
Copy link to clipboard
Copied
Maybe this will help. This is what I was looking for. This is a very rudimentary example, from a Spark sample project, but it represents the behavior I was seeking.
https://www.screencast.com/t/ma0HSQyyQ
If there's a way to get that in In-Design, I've not found it...
Thanks
Copy link to clipboard
Copied
Did you check out my https://www.id-extras.com/products/fit-text-to-frame/
The end result is exactly the same, although it does not live-update. Instead, select a text frame and run the script and the text will be made to fit. But it doesn't just modify the point size, it resizes everything: leading, indent and everything else...
Copy link to clipboard
Copied
Hi Chris,
the script code in reply 5 here will set all characters of the story of an overset text frame to the same point size. Maybe something you do not want. To make that script work the selected text frame must be in overset. Maybe that's not the case with your selected text frame?
With your video I think you are showing something different, something that the script in reply 5 will not do.
Regards,
Uwe
Copy link to clipboard
Copied
Adobe spark does this so well, I'd hope they would add that feature to ID.
Copy link to clipboard
Copied
If you would like a new feature you ask for it here - no guarantees though - Adobe InDesign Feedback
Copy link to clipboard
Copied
Moderators may want to move this to the Scripting Portion of the forum as well .
Copy link to clipboard
Copied
Brilliant! Thanks for the hints too!
I'll go and test first chance I get, but it makes sense, and hope the "code" is not transferred, but if it is hopefully a search link is substituted to its location.
Less hopeful there is any "out of box" solution, but this is better than nothing at all. Thanks very much for your time and effort!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thanks Obi-wan for the additional information.