invaricconsulting Posted November 30, 2012 Share Posted November 30, 2012 Checking if it there is a way (that I am not aware of) to suppress a text frame, if the content in the frame reaches the copyfit threshold. I have not been able to accomplish this, I presume because the frame suppression needs to be applied via OnRecordStart, which is called before OnCopyfit? Is there any way around this? Thanks. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted November 30, 2012 Share Posted November 30, 2012 Sure, just modify your OnCopyfit rule like so (add the lines in red): if (!Copyfit(new MagnifyAttributes("text", 25, 400, 6, 72))) [color=Red]{[/color] ReportWarning("Could not copyfit text in flow " + FusionPro.Composition.CurrentFlow.name); [color=Red] FusionPro.Composition.CurrentFlow.content = ""; }[/color] Quote Link to comment Share on other sites More sharing options...
invaricconsulting Posted December 3, 2012 Author Share Posted December 3, 2012 Actually, I am tying to suppress the frame itself, so it can have a white background. This is to display a warning message to a user who enters too much information on a business card. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 3, 2012 Share Posted December 3, 2012 Actually, I am tying to suppress the frame itself, so it can have a white background. This is to display a warning message to a user who enters too much information on a business card. Oh, in that case, just change the added line to output the warning, something like this: if (!Copyfit(new MagnifyAttributes("text", 25, 400, 6, 72))) { ReportWarning("Could not copyfit text in flow " + FusionPro.Composition.CurrentFlow.name); FusionPro.Composition.CurrentFlow.content = "<para><color name=Red>CONTENT DOES NOT FIT</para>"; } Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 4, 2012 Share Posted December 4, 2012 How would you do this if copyfit was NOT turned on? We have a template that allows clients to choose fonts & font sizes & copyfit is off. If their text doesn't fit it might be nice to send them a message rather than relying on them to notice. Thanks Mike G. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 4, 2012 Share Posted December 4, 2012 (edited) How would you do this if copyfit was NOT turned on? We have a template that allows clients to choose fonts & font sizes & copyfit is off. If their text doesn't fit it might be nice to send them a message rather than relying on them to notice. Thanks Mike G. Well, the OnCopyfit rule isn't invoked if Copyfit is not enabled, so you need to have it turned on. However, if you want to invoke the rule without actually copyfitting the text, then you can set the minimum and maximum magnification in the MagnifyAttributes object to both be 100 percent, by changing the first line to this: if (!Copyfit(new MagnifyAttributes("text", 100, 100, 4, 200)))If you need to actually do copyfitting in other frames, you can switch off of FusionPro.Composition.CurrentFlow.name. (Note that you don't actually need to call the Copyfit function in the OnCopyfit rule; you can do other things based on the flow/frame name. However, in FusionPro 8, it's easier to do flow-specific things in a regular rule by checking the "Re-evaluate this rule for every text flow" box.) Edited December 4, 2012 by Dan Korn Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 4, 2012 Share Posted December 4, 2012 Thanks for the help Quote Link to comment Share on other sites More sharing options...
invaricconsulting Posted December 5, 2012 Author Share Posted December 5, 2012 I think I was trying to get too fancy with it. I was thinking of having a warning message frame with a white background, but also showing the user the overflowing text underneath, as a cue for where they need to reduce the content. The solution you provided is simpler, and works just fine. Thanks Dan. Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 17, 2012 Share Posted December 17, 2012 Ok I see how to get the error in the message file & in the text box. Now If the client's text is not copy fitted: e.g. if (!Copyfit(new MagnifyAttributes("text", 100, 100, 6, 72))) Is there a way to enlarge the error message in the text box? I've tried the CopyfitLine but both the staticpart, dynpart, are comming out at the same size. Thanks Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 17, 2012 Share Posted December 17, 2012 Ok I see how to get the error in the message file & in the text box. Now If the client's text is not copy fitted: e.g. if (!Copyfit(new MagnifyAttributes("text", 100, 100, 6, 72))) Is there a way to enlarge the error message in the text box? I've tried the CopyfitLine but both the staticpart, dynpart, are comming out at the same size. Thanks I'm not sure why you're trying to mix single-line copyfitting (CopyfitLine) in with full-flow copyfitting (Copyfit/OnCopyfit). That's almost never what you want to do. I think what you do want to do in this case is to call the Copyfit function again after setting the error message into the frame, like so: // Don't actually copyfit; we only want to detect the text // not fitting and show a warning message in the frame. if (!Copyfit(new MagnifyAttributes("text", 100, 100, 4, 200))) { ReportWarning("Could not fit text in flow " + FusionPro.Composition.CurrentFlow.name); FusionPro.Composition.CurrentFlow.content = "<para><color name=Red>CONTENT DOES NOT FIT</para>"; // Now copyfit the warning text, expanding to fill. FusionPro.Composition.CurrentFlow.expandToFill = true; if (!Copyfit(new MagnifyAttributes("text", 25, 400, 6, 72))) { ReportWarning("Could not copyfit warning in flow " + FusionPro.Composition.CurrentFlow.name); } } Quote Link to comment Share on other sites More sharing options...
mgalligar Posted December 17, 2012 Share Posted December 17, 2012 Thanks Dan! You're right That's exactly what I was trying to do Thanks again! Quote Link to comment Share on other sites More sharing options...
mgalligar Posted February 25, 2013 Share Posted February 25, 2013 I was going over copy fit again. I thought it would be nice to give clients a warning & still let them see the text they've entered. So I'd use a watermark with info (got that to work). Then; to direct them to the specific box; I'd have it change color (I haven't got that to work). Here's the code: if (!Copyfit(new MagnifyAttributes("text", 100, 100, 4, 200))) { FindGraphicFrame("TextOverflowWarning").SetGraphic("TextOverflowWarning.pdf"); var warningColor = FindTextFrame(FusionPro.Composition.CurrentFlow.name); FindTextFrame("warningColor").fillColorName = "Red"; ReportWarning("Could not fit text in flow " + FusionPro.Composition.CurrentFlow.name); } This way clients can see how much "fixing" is necessary. I don't know if this is even possible. Please let me know. Thanks Mike G. 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.