Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Text Expression help

  • Text Expression help

    Posted by David Stevely on May 1, 2022 at 12:12 am

    So I’m creating an Essential Graphic in AE for Premiere Pro which is a lower thirds caption, so that other users can use it as a template and simply type in names, titles etc as needed.

     

    The problem I have is that I need the ‘title’ text and ‘name’ text to run together on the same line but at different font sizes – the ‘title’ has to be a small font (it could be Mr,Mrs, Dr, Constable… whatever the user wants) but the name font has to be a larger font and sit immediately after the title on the x position axis.

     

    So I’ve got two layers of text (title + name – different sizes) sitting next to each other to appear connected and joined together. I need the name text layer to dynamically link to the title text later, so that the user can type any title length and have the name text immediately follow after.

     

    Is there an expression I can apply to the ‘title’ layer that will shift the ‘name’ layer along the x position according to the length of title?

     

    Hope that makes sense.

     

    Any assistance would be greatly appreciated.

     

    Many thanks in advance.

    David Stevely replied 4 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    May 4, 2022 at 9:42 am

    Parent the Name to the title, and give the position of Name this expression:

    [25 + parent.sourceRectAtTime().width-thisLayer.sourceRectAtTime().left, 0];

    it will position it exactly 25 pixels to the right of the title. Adjust that margin to suit your fontsize.

    Or use something like this, if you want to automatically base the spacing on the fontsize of the title:

    [parent.text.sourceText.style.fontSize*.5 + parent.sourceRectAtTime().width-thisLayer.sourceRectAtTime().left, 0]
  • David Stevely

    May 5, 2022 at 7:18 pm

    This is great. Really appreciate it.

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