alisha Posted January 23, 2017 Share Posted January 23, 2017 Is it possible to alter the Copyfit rule to first reduce the font size to a particular point (8 pt), and then if the text still doesn't fit, adjust the tracking? I'm not very familiar with javascript, so any help is appreciated. Thanks! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 23, 2017 Share Posted January 23, 2017 I think you want something like this: var minPointSize = 8; if (!Copyfit(new MagnifyAttributes("text", 25, 400, minPointSize, 72))) { // If it doesn't fit at the minimum point size, // fix to that size, then try to copyfit by reducing tracking. FusionPro.Composition.CurrentFlow.content = '<span pointsize=' + minPointSize + '>' + FusionPro.Composition.CurrentFlow.content + '</span>'; if (!Copyfit(new MagnifyAttributes("tracking", 25, 400, 50, 100))) { ReportWarning("Could not copyfit text in flow " + FusionPro.Composition.CurrentFlow.name); } } A couple of caveats here: One, this will set all of your text in the flow (frame) to the same size. Normally, you can copyfit a flow where the text size varies, and everything will be shrunk by the same factor, but it probably won't all end up the same size. In this case, though, if the first copyfit doesn't work, we use the span tag to fix it all to that point size, then apply tracking. Two, the parameters of the MagnifyAttributes object for the "tracking" mode are tricky, because they're all percentages. A detailed explanation of how this works is too much for me to type up right now, but basically the second two numbers (50 and 100 in my example above) are the important ones, and the other numbers don't really matter, as long as they are less limiting. Effectively, the code above will reduce the tracking to as little as 50 percent of the nominal (100 percent) tracking. Quote Link to comment Share on other sites More sharing options...
alisha Posted February 27, 2017 Author Share Posted February 27, 2017 Perfect! Thanks so much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.