Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects AE – Text is offsets starting position differently per letter

  • AE – Text is offsets starting position differently per letter

    Posted by Jacob Callesen on December 19, 2021 at 12:02 am

    I’m trying to design a lower thirds motion graphics template for use in Premiere, however, I seem to have trouble with getting the text to line up properly.

    Depending on which letter I type first the text offsets to the right or to the left. I think this is due to how the font works, but is there any way I can make sure that the text stays fixed to a specific anchor point no matter the starting letter?

    The font is Montserrat.

     

    Tristan Summers replied 4 years, 6 months ago 4 Members · 4 Replies
  • 4 Replies
  • Graham Quince

    December 22, 2021 at 9:49 am

    Is the Text layer left-aligned?

    I think I would be tempted to “cheat” and have a layer underneath in the light green which is lined up, then the size and spacing of the letter wouldn’t matter

    You could spend ages with SourceRectAtTime trying to perfectly match it or you can fake it and move on.

  • Kevin Camp

    December 22, 2021 at 7:07 pm

    The issue is that some characters are actually left of the anchor point (like T, Y, V, O, etc.) compared to more square characters (like H, D, R, etc). To fix that, you can use the sourceRectAtTime() ‘left’ attribute which can give you that left-shift value relative to the anchor point.

    Here’s my typical process for these (assuming left justified text and scale is 100%, 100%):

    Create a text layer and type something in it.

    Then, without a layer selected, double click the rectangular mask/path button to make a comp-sized rectangular shape layer that has it’s anchor point in the center (that’s the quickest way I’ve found to do that), parent that shape layer to the text layer and move it below the text layer (set color for the shape layer as needed).

    Then for the contents>rectangle>rectangle path>size property, I use this expression:

    hPad = 10 ; 
    vPad = 10 ;
    rect = parent.sourceRectAtTime() ;
    [ rect.width + rect.left, rect.height] + 2 * [ hPad, vPad ]

    And for contents>rectangle>rectangle path>position property, I use this expression:

    rect = parent.sourceRectAtTime() ;
    [ rect.width + rect.left, -rect.height] / 2

    That should keep the left edge relative to the anchor point of the text layer.

    I should note that I also often hardcode the height in both of those expressions to prevent issues with descenders or other character height variations… Even when fonts are all caps, there can be issues with round characters (like O vs H ), Q’s often go below the baseline and some punctuation can create problems (like commas). That can take a bit of fiddling, since the position is about 1/3 of the height… I could probably go further with the expression and use the sourceText.style to derive the baseline and fontSize…

  • Kevin Camp

    December 22, 2021 at 7:42 pm

    Should have mentioned that after you parent the shape layer to the text layer, change the shape layer’s transform>position property to 0,0 to center it on the anchor point of the text layer, then proceed : )

  • Tristan Summers

    December 31, 2021 at 1:21 pm

    I do it by adding an invisible | to the beginning and end and kerning the first one outside the box.

    Use an opacity animator, index 1, offset 1, to hide the characters. | Usually covers ascender and descender height.

    I’ve also used ” to set the top right.

    This way means you can add text boxes easily to the top and bottom

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