FORUMS: list search recent posts

sourceRectAtTime and line height on top/bottom

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
mel ruiz
sourceRectAtTime and line height on top/bottom
on Nov 1, 2017 at 1:41:20 am

I'm using shape layers (rectangles) to position text (paragraphs) a certain way despite how many lines they are...like a template. I'm trying to match what's happening to text in CMS. And things aren't matching up exactly. I think it has to do with line height on text in CMS adding a padding to the bottom (and top?) of the last line, whereas in AE, there doesn't seem to be any padding under the last line. I'm using sourceRectAtTime to get the shape to be the exact size of the text graph.

e.g., size is this:
x=thisComp.layer("NUMBER").sourceRectAtTime().width;
y=thisComp.layer("NUMBER").sourceRectAtTime().height;
[x,y]

I can't find anything related to difference between line height in AE and in other places (e.g., the CMS i'm using). And I'm not that experienced with expressions so I'm not sure if there's a better way to do it that would include this padding, if it exists in AE.

If anyone has any idea what I'm saying and can help enlighten me, I'd greatly appreciate it!

(using version 14.2.1.34)


Return to posts index

Walter Soyka
Re: sourceRectAtTime and line height on top/bottom
on Nov 1, 2017 at 6:30:25 pm

sourceRectAtTime().height is just a number; you can add to it if you want to pad. You may want to offset the position of the layer to compensate for the padding.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

mel ruiz
Re: sourceRectAtTime and line height on top/bottom
on Nov 3, 2017 at 9:08:43 pm

so just to be clear, sourceRectAtTime().height will return the exact height of letters present (e.g., it will be smaller if there is no "g" on the last line versus if there is a "g"). Right?

Then if I add padding, it'll have to be dependent on if there are descenders or not, which is what's creating so many problems for me, I think. :-\ Is there any good way to deal with this?

For example:

In CSS, the sentence "Image stabilization during video capture is not foolproof. Welcome to Donleland."
will have a bounding box that is the same as if it said " Image stabilization during video capture is not foolproof. Welcome to Dongleland."
But in AE, my box and thus my padding will change.

It seems like I just have to have different templates for whether there's a descender in last line or not, which seems silly. Am I missing something?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]