sandigcustomprinters.com Posted June 5, 2012 Share Posted June 5, 2012 When the user inputs copy, copyfit reduces typesize to accomodate the space available in the frame, but the final typesize cannot be less than 12 point. When the user inputs more copy than space available, and the type has already reduced to a minimum 12 pt size, I need to display a warning. I cannot get the warning to display when the text exceeds the space available in the frame. if (!Copyfit(new MagnifyAttributes("text", 25, 400, 12, 72))) { if (FusionPro.Composition.CurrentFlow.name == "contentcopyfit") { FusionPro.Composition.CurrentFlow.content = '<para style="(no style)"><f name="Arial Bold"><z newsize="14.0"><color name="Pantone 202 C">' + "YOU HAVE ENTERED TOO MUCH INFORMATION." } } else if (Copyfit(new MagnifyAttributes("text", 25, 400, 12, 72))) { if (FusionPro.Composition.CurrentFlow.name == "contentcopyfit") { FusionPro.Composition.CurrentFlow.content = "" } } Link to comment Share on other sites More sharing options...
esmith Posted June 5, 2012 Share Posted June 5, 2012 I had a similar problem when I first tried to implement this scenario. The code I am now using successfully is if (!Copyfit(new MagnifyAttributes("text", 50, 400, 8, 72))) { ReportWarning("Could not copyfit text in flow " + FusionPro.Composition.CurrentFlow.name); FusionPro.Composition.CurrentFlow.content = '<span color="Red">' + "PLEASE ADJUST YOUR TEXT TO FIT IN THE SPACE PROVIDED!" + '</span>' + FusionPro.Composition.CurrentFlow.content; } Link to comment Share on other sites More sharing options...
Dan Korn Posted June 5, 2012 Share Posted June 5, 2012 Try this: if (!Copyfit(new MagnifyAttributes("text", 25, 400, 12, 72))) { if (FusionPro.Composition.CurrentFlow.name == "contentcopyfit") { FusionPro.Composition.CurrentFlow.content = '<para style="(no style)"><f name="Arial Bold"><z newsize="14.0"><color name="Pantone 202 C">' + "YOU HAVE ENTERED TOO MUCH INFORMATION." + '</para>'; } }The key is the ending </para> tag. Also, note that you don't need the "else" clause at all; either the copyfit succeeds, or you show the warning message. Link to comment Share on other sites More sharing options...
sandigcustomprinters.com Posted June 6, 2012 Author Share Posted June 6, 2012 Thanks. This does work. It does not want to enter the "Please adjust your text..." note without the + FusionPro.Composition.CurrentFlow.content; But it will work for what I need. Link to comment Share on other sites More sharing options...
esmith Posted June 6, 2012 Share Posted June 6, 2012 That was my experience as well. My theory is that without adding the existing content back, the warning text does not overflow the frame and therefore copyfit is ignored. It's some kind of weird FP wormhole or something. Link to comment Share on other sites More sharing options...
sandigcustomprinters.com Posted June 6, 2012 Author Share Posted June 6, 2012 Yes, a wormhole indeed! Link to comment Share on other sites More sharing options...
Dan Korn Posted June 6, 2012 Share Posted June 6, 2012 The rule I posted above works fine and shows the message in the frame for me, without adding any other content. You might need to make sure that the warning message itself fits in the frame, though. Or there might be something else different about your job that I'm missing; it's hard to know without looking at it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.