rpaterick Posted January 30, 2013 Share Posted January 30, 2013 I have text flow issue with short name and long name inputs in the data file. How can I call out a text resource based on character length? Also, how could I call out a "page" based on character length also(just in-case)? The character length is 7 characters, for the breaking point. Thanks! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 30, 2013 Share Posted January 30, 2013 Something like this: if (Field("YourFieldName").length > 7) return Resource("ResourceForLongNames"); // else return Resource("ResourceForShortNames");Or, more succinctly: return Resource(Field("YourFieldName").length > 7 ? "ResourceForLongNames" : "ResourceForShortNames");If you want to call out a completely different page, you could do something like this in OnRecordStart: if (Field("YourFieldName").length > 7) FusionPro.Composition.SetBodyPageUsage("PageForLongNames", true); else FusionPro.Composition.SetBodyPageUsage("ResourceForShortNames", true);Also, I feel compelled to say that, unless you're using a fixed-width font, just knowing the number of characters doesn't really tell you whether something will fit somewhere or not. The only way to know for sure how much space some text will take up is to measure it with the FusionProTextMeasure object. Furthermore, you can probably accomplish what you need with some kind of copyfitting instead of calling out completely different resources or pages. Quote Link to comment Share on other sites More sharing options...
rpaterick Posted January 30, 2013 Author Share Posted January 30, 2013 Furthermore, you can probably accomplish what you need with some kind of copyfitting instead of calling out completely different resources or pages. The marketing designer has dictated how they want the smaller number of characters to break(paragraph) and longer characters to break. I did the "Len" formula in excel and then sorted to see where the breaking(text flow) issue for them is occurring, that they didn't like the text wrapping. Thanks Dan for your help this is very appreciated! 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.