MeeshKB Posted December 14, 2012 Share Posted December 14, 2012 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. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 14, 2012 Share Posted December 14, 2012 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. Quote Link to comment Share on other sites More sharing options...
MeeshKB Posted December 14, 2012 Author Share Posted December 14, 2012 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. Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 17, 2012 Share Posted December 17, 2012 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>"; } Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 17, 2012 Share Posted December 17, 2012 I don't want to copy fit client's text. I do want the warning in the text box as big as possible without flowing out of the box. Thanks Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 17, 2012 Share Posted December 17, 2012 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. 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.