seymoujd Posted June 19, 2015 Share Posted June 19, 2015 So I know how to measure the length of a string. I was wondering if there is a way to determine how many rows of text there are in a text frame or how much vertical space in a text frame is being filled? Im trying to make templates that have responsive layouts that will change based on the amount of content entered. Quote Link to comment Share on other sites More sharing options...
step Posted June 19, 2015 Share Posted June 19, 2015 It won't tell you how many rows of text you have in a text frame, but the TextMeasure function will allow you to find the height (in 100th's of a point) of specified text – which is what I think you really need to determine how much space is being filled. Here's a function that would probably work for your needs: function getTextHeight(frameName){ var text = FindTextFrame(frameName).content; text = text.replace(/<variable name="([^"]*)">/g,function(a,b){return RuleOrField(b);}); var tm = new FusionProTextMeasure; tm.useTags = true; tm.maxWidth = GetSettableTextWidth(FindTextFrame(frameName)); tm.CalculateTextExtent(text); return tm.textHeight; // 7200 = 1 inch } 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.