Forum Replies Created

  • Evan Dulaney

    March 11, 2019 at 6:07 pm in reply to: Align Paragraph Text to middle of box?

    Well, sourceRectAtTime gets the rectangular pixel dimensions of a layer. you’re putting that info in a variable, and then setting the anchor point to half of that value.

    It’s not the best solution, however, because it can be inconsistent from a typography standpoint. If you’re using lower case letters, and the bottom line doesn’t have any hanger characters (y, g, q, p, j, etc), then the vertical height ends up being different than if there are hanger characters. It’s not an issue if you’re using all caps though ☺

    It’s the best thing I’ve found so far though. Hopefully in the future there will be an option to keep the anchor point always centered vertically.

  • Evan Dulaney

    August 3, 2018 at 11:09 pm in reply to: Align Paragraph Text to middle of box?

    I just figured out another solution to this now very old problem. However, my solution only works if the font size remains consistent.

    I set the anchor point of my text layer to 0,0. This puts the anchor point at the bottom of the first line, always.

    Then, adjust the baseline shift in the character panel so that the anchor point aligns with the top of the first line instead of the bottom.

    then, apply an expression to the anchor point property that uses sourceRectAtTime(time,false); to get the size of the layer and adjust the anchor point.

    I only needed mine to be centered vertically, so mine was like this:

    rect = sourceRectAtTime(time,false);
    [transform.anchorPoint[0],rect.height/2];

    but you could also do

    rect = sourceRectAtTime(time,false);
    [rect.width/2,rect.height/2];

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy