Printing Partners Posted July 5, 2016 Share Posted July 5, 2016 This is my first time working with CopyfitLine, so bear with me. I created a test file and was able to get the Rule to work as I wanted it to. I then went back to my production document and entered the rule just as I had in testing, adjusting the appropriate values and fields, and it won't work. I get no script or syntax errors. i am at a bit of a loss. My script: if (Field("Email") != "") { return CopyfitLine("", Field("email")+Field("emailDomain"), "", 10, 135, 5, true); }; I have deleted and recreated the box in Fusion Pro. I do not have CopyFit on this Template anywhere. It has to be something really simple that I am not seeing. Ideas? Steven Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted July 5, 2016 Share Posted July 5, 2016 Steven You need to put in your font name and there was an extra ; at the end try this if (Field("Email") != "") { return CopyfitLine("", Field("email")+Field("emailDomain"), "font name", 10, 135, 5, true); } I think I got this from Dan Korn return CopyfitLine("", Field("Name"), "Adobe Garamond Pro", 20, 137, 6, false); The parameters to CopyfitLine, in order, are: • staticPart - text to not be resized • dynamicPart - text to be resized (after staticPart) • font - font family name • size - base point size (in points) • width - width of the frame or column (in hundredths of points) • minimum - minimum point size (in points) • adjustWidthOnly - true/false (optional - see below) For the "adjustWidthOnly" parameter, if you leave it off (or specify false), the function will adjust the point size, that is, both the width and height, of the glyphs. If you specify true, the function will adjust only the set width of the glyphs, but not the height, which basically means they will look squished horizontally. Quote Link to comment Share on other sites More sharing options...
Printing Partners Posted July 5, 2016 Author Share Posted July 5, 2016 Thanks for catching the extra semicolon. Even with the font in (which I have seen Dan leave out, so I tried it) it still won't work. Since it is working in my test file, I wonder if there is a conflict with another rule. Could that be possible? Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted July 5, 2016 Share Posted July 5, 2016 Steven Maybe there is data that needs to reduce below the copyfit minimum limit of 5 pt. Maybe look for the longest data in both the email and emailDomain fields and or make the minimum smaller to see if that is the problem. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted July 8, 2016 Share Posted July 8, 2016 The problem is highlighted in Red below: if (Field("Email") != "") { return CopyfitLine("", Field("email")+Field("emailDomain"), "", 10, [color="Red"]135[/color], 5, true); }; As I was quoted here: • width - width of the frame or column (in hundredths of points) You need to specify the frame width in hundredths of points. There are 72 points in an inch, so one inch is represented as 7200 in hundredths of points. So if your frame is, say, three inches wide, you need to multiply that 3 inches by 7200, like so: if (Field("Email") != "") { return CopyfitLine("", Field("email")+Field("emailDomain"), "", 10, 3 * 7200, 5, true); }; 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.