L = thisComp.layer("textLayer");
var newStyle = L.text.sourceText.style;
var myLeading = newStyle.autoLeading ? newStyle.fontSize * 1.2 : newStyle.leading;
H = L.sourceRectAtTime(time, false).height;
rowNo = Math.ceil(H / myLeading);
rowNo;
Counts the number of rows in a text layer, adjusting dynamically based on font size and leading (line spacing).
Contributed by:
Great for automating layouts where the number of text rows affects the design, such as captions, paragraphs, or dynamic subtitles.