Danovh Posted October 31, 2013 Share Posted October 31, 2013 Hello everybody, First, what I need is rule to limit the amount of characters in a variable + add three dots, this should be easy. I can adjust the limit as needed. Second, I need 4 variable text frames to use the same type size, so if one variable is reduced, I need all 4 of them reduced to the same size. The variables can range from 15 characters to 100+ characters. All this needs to be put into 1 rule. Hope the screen shot helps in understanding what I need. Thanks Quote Link to comment Share on other sites More sharing options...
step Posted October 31, 2013 Share Posted October 31, 2013 The first part you could accomplish with something like this: var limit = 10; return (Field("Your Field").length <= limit) ? Field("Your Field") : Left(Field("Your Field"),limit) + "..."; For the second part, I would think you'd just replace the 4 text frames with one. Is there any reason you aren't doing that? If you're doing it just to keep it in line with the images, you could just pull those in as inline graphics and apply font changes globally. Quote Link to comment Share on other sites More sharing options...
Danovh Posted October 31, 2013 Author Share Posted October 31, 2013 The vertical space between the lines of text must stay the same, if the font get's reduced, then this would change that. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted October 31, 2013 Share Posted October 31, 2013 The vertical space between the lines of text must stay the same, if the font get's reduced, then this would change that. That's not really true. If you have inline graphics which are larger than the text, then the leading (line spacing) will be controlled by the graphics, so making the text smaller should have no effect. But if you really want to make sure that the leading is fixed, then in the Text Editor, click the Paragraph button, and then click "Absolute Leading" and specify a size; then you don't need to use inline graphics at all. (You could alternatively create a table, where you can use the Row.minHeight property.) As for the character limit, you can certainly hard-code a specific number of characters. However, that's not really the best way to determine whether text fits in a specific area, or how to truncate it, because (depending on the font), different letters have different widths. (A row full of 10 capital "W"s will take up a lot more space than a row of lower-case "i"s.) So your best bet is to use Text Measurement, with the FusionProTextMeasure object. If you search for FusionProTextMeasure here on the forum, you'll find lots of examples, such as this recent one: http://forums.pti.com/showthread.php?t=3576 Finally, if you really do want to copyfit multiple frames using the same point size, searching this forum for "copyfit multiple frames" turns up several thread, such as this one: http://forums.pti.com/showthread.php?t=838 But, I will reiterate that, instead of doing that, I think you're better off just using a single frame with absolute leading between lines. Quote Link to comment Share on other sites More sharing options...
Danovh Posted October 31, 2013 Author Share Posted October 31, 2013 Thanks Dan, I like the idea of having different options, but I'll try 1 text box with fixed leading. As for the character limit, I'll find the limit I like, then reduce the limit. Again Thanks for everybody's help. 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.