Jump to content

Adding a special character to copyfiltine rule


MeeshKB

Recommended Posts

Or, copyfitline rule...stupid fat fingers.

 

Anyway, I am trying to apply a copyfitline rule to my email field on a business card. The bit that is tripping me up is that the static part includes a tab, and I can't figure out how to add the tab character to the code.

 

I know that the code should look like this...

 

return CopyfitLine("Email:", Field("Email"), "Helvetica 55 Roman", 7, 122.4, 5, false);

 

...but I am not sure how to add the tab character to the static part so that it tabs over before the variable info is inserted.

 

As ever, I'm sure this is a simple fix that someone with a little JS saavy could do in his or her sleep. Sadly, I am sorely lacking in the JS saavy department. Any help would be appreciated.

Link to comment
Share on other sites

A tab character is denoted as \t in JavaScript. So you would do this:

return CopyfitLine("Email:[color=Red]\t[/color]", Field("Email"), "Helvetica 55 Roman", 7, 122.4, 5, false);

However, the CopyfitLine function has no way of knowing what tab settings will be in effect in whatever text frame (or frames) the result of the rule is going to be used in. So I would probably just do this, leaving off the static label and the tab:

return CopyfitLine([color=Red]""[/color], Field("Email"), "Helvetica 55 Roman", 7, [color=Red]86.4[/color], 5, false);

Note that I've adjusted the width down by 36 points, or half an inch, which is the default tab stop setting.So you should be able to add the static "Email:" label and the tab directly in the Variable Text Editor, and then the variable for this modified rule. I think this will do what you want.

 

P.S. You can always edit your own posts and threads.

Link to comment
Share on other sites

Thanks so much for the response, Dan. It hadn't even occurred to me to leave the static part out and reduce the allowable space. That does the trick!

 

P.S. - I had tried editing the title of a post elsewhere on the board and it didn't update everywhere.

Link to comment
Share on other sites

Is there a way to copy fit a warning message in the text box, even if the client's text is not being copy fitted?

e.g. rule:

if (!Copyfit(new MagnifyAttributes("text", 100, 100, 6, 72)))

{

ReportWarning("Could not copyfit text in flow " +

FusionPro.Composition.CurrentFlow.name);

FusionPro.Composition.CurrentFlow.content =

"<para><color name=Red>Your Text Did NOT Fit!</para>";

}

Link to comment
Share on other sites

Is there a way to copy fit a warning message in the text box, even if the client's text is not being copy fitted?

e.g. rule:

if (!Copyfit(new MagnifyAttributes("text", 100, 100, 6, 72)))

{

ReportWarning("Could not copyfit text in flow " +

FusionPro.Composition.CurrentFlow.name);

FusionPro.Composition.CurrentFlow.content =

"<para><color name=Red>Your Text Did NOT Fit!</para>";

}

It seems that your question is more an offshoot of the information in this other thread:

http://forums.pti.com/showthread.php?t=3165

 

The thread we're in is about CopyfitLine, not about full-flow copyfitting with the OnCopyfit callback. So I would either post a follow-up in that other thread, or start a new one.

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