Jump to content

Modifying Text Size and Tracking in an OnCopyfit rule


Recommended Posts

I’m creating a business card template in FP, and I’m having trouble getting a person’s name to copyfit by modifying both the font size and the tracking, using the OnCopyfit rule on the relevant text frame.

 

Here’s the OnCopyfit rule that I modified:

 

OnCopyfit-screenshot.jpg

 

The rule returns with no errors when I validate it, but when I preview the results of the sample data in the template using a long name, it appears that it’s not following the parameters I set (i.e., shrink font size from 10 to no less than 8, and reduce the tracking to 50%), and it’s not recognizing the “Do not break on copyfit” setting.

 

Is it possible to modify text size and tracking within the same OnCopyfit rule, and if so, is there a way to modify the JavaScript syntax to shrink the font before reducing the tracking? In other words, I’d like the rule to tell FP, “If the text doesn’t copyfit, shrink it to no less than 8 pts; if it still does not fit, reduce the tracking to no less than 50%”?

 

I looked through old threads in this forum (where I found parts of the code above) and went through the FusionPro Copyfit guide, but I haven’t found a case where font size and tracking are modified in the same rule. I’m new to JavaScript, and I tried variations on the syntax but kept getting syntax errors when I validated before I got the code pictured above to validate with no errors.

 

I’m not opposed to using the CopyfitLine rule if it would do the job more efficiently, but from what I’ve read, it doesn’t look like there’s a place to adjust the tracking with that rule.

 

I’m attaching the collected files for the FP template I’m working on and a PDF example of how I envision the rule working. (I created the example in InDesign and reduced the font size to 9 pts, then changed the tracking to 50%).

 

If there’s a thread I overlooked that already addresses this, please point me in that direction. Thanks for your help!

csk-bcard-oncopyfit-rule.zip

cskern-bcard-example.pdf

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...