Jump to content

CopyfitLine problem


Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);
};

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...