Jason Posted April 22, 2014 Share Posted April 22, 2014 Instead of changing the size of a font when text doesn't fit a box I am looking to change the font. Is this possible using the CopyFit or some other function? Currently I'm working on a business card and instead of making the already small type smaller our client wants to change the font from Helvetica Neue to Helvetica Neue Condensed. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted April 23, 2014 Share Posted April 23, 2014 Are you trying to do full-flow copyfitting, where you click the "Adjust text to fit" box in the Overflow Options dialog? Or are you trying to do single-line copyfitting, with the CopyfitLine function? If you're doing full-flow copyfitting, you can do something like this in the OnCopyfit rule: if (!Copyfit(new MagnifyAttributes("text", 25, 400, 6, 72))) { FusionPro.Composition.CurrentFlow.content = '<span font="Helvetica Neue Condensed">' + FusionPro.Composition.CurrentFlow.content + '</span>'; ReportWarning("Could not copyfit text in flow " + FusionPro.Composition.CurrentFlow.name); }If you're doing single-line copyfitting, you can use an alternative function to CopyfitLine, like a variant on my better CopyfitLine function, something like this: function CopyfitLine_Condense(line, widthInPoints) { var tm = new FusionProTextMeasure; tm.CalculateTextExtent(line); if (tm.messages) ReportError("CopyfitMagnifyLine: " + tm.messages); if (tm.textWidth < widthInPoints*100 &&) return line; //else return '<span font="Helvetica Neue Condensed">' + line + '</span>'; } Where, as with the CopyfitLineWithMagnifyTag function, you'll need to specify the original font and point size with tags. 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.