Activity › Forums › Adobe After Effects Expressions › An expression for Text kerning, tracking, sizing and leading
-
An expression for Text kerning, tracking, sizing and leading
Posted by Alex Dinnin on August 27, 2014 at 9:34 amI have a master text layer..
COMING
NEXT
WEEKThis is a basic white text.
I then have thirteen other layers with various effects on it to create my graphic.. Some have strokes, others are different colours etc..
What I want to do be able to do is change the size of “NEXT” on the master text layer, or alter the kerning etc… and all the other 13 layers follow.
Surely there has to be a way.. I have poured over forums etc.. but it appears that nothing can do this simple task
I have hundreds of these to do, some need to be on Three lines.. others on just one..
I need to find a quick and easy way to automate this.. if any one has any ideas I would greatly appreciate it..
kind regards
Alex
Kevin Camp replied 11 years, 8 months ago 4 Members · 5 Replies -
5 Replies
-
Filip Vandueren
August 27, 2014 at 11:17 pmThe others are all also text-layers ?
They have exactly the same text and need to follow the editing you’ve done to the first one ?
Are their other effects actually text-effects, or other filters ?The only thing I can think of is a rather crude low-level script that copy/pastes the text of the first 1 to the other 13, so their text (including formatting) are all identical, but that will also remove any character- or paragraph formatting the others have that make them different.
SO the question is: how did you style the other layers ?
If another text-layer should be yellow, it shouldn’t have been set to yellow in the character palette, but with a fill color text animator, or a “color overlay” layer style, or a tint effect etc.
All of these will stay yellow if you copy paste the new formatting of the original white one over them… -
Chris Olsen
August 28, 2014 at 1:17 pmHi Alex,
I recently had a similar issue, specific to kerning. How I ended up solving it was creating an animation preset with the kerning I wanted (and whatever other basic character styles you want to start with), and then altering the remaining layers in a script I wrote, which generates a bunch of text layers and applies that preset to them. Then I used the myTextLayer.property(“Source Text”).value.whateverPropertiesYouWantToChange to alter those specific text layers. If you’ve never written a script before, this sounds like a good entry into that world.
The only reason I mentioned kerning specifically is because it’s an example of a text property that you simply cannot access via scripting, so the preset is a workaround.
Hope this helps!
-
Kevin Camp
August 28, 2014 at 3:55 pmi agree with both filip and chris, text animators should do what you need, and you can use expressions to drive those, along with the source text if needed.
using a ‘master’ text precomp that get’s used multiple times within the main comp may also work.
i do a lot of versioning out of graphics at the 3 stations i work for, so i think i know what you’re facing. it would help to have a better understanding of how you expect these to work, and what all needs to change within the comp.
Kevin Camp
Art Director
KCPQ, KZJO & KRCW -
Alex Dinnin
August 28, 2014 at 6:21 pmBasically I need to set up a template composition
I was hoping I could change one line of text, basically adjusting the kerning, leading etc.. maybe reduce the size of a word
and rest of the lines would follow suit.
I have loads of 5 second animations to do.. and wanted to set up a template so I could use the script CompsFromSpreadsheet to do all the leg work..
then I just go into each comp.. solo the master layer.. fiddle about with it so it looks good and then all the other layers match the style..
all of the layers are white.. some have fill effects on them to change colour.. there are a few with text strokes rather text fill..
It just seems odd that we can tweak and animate so much in after effects.. but not something this simple…
I’ve created a workaround using precomps which works.. it’s just not what I was looking for..
thanks for all your replies
Alex
-
Kevin Camp
August 28, 2014 at 8:23 pmi think animators should work for this, however for kerning, you will be limited to whole line ‘tracking’, so if you needed individual character kerning this may not work for you. however if you set the text layers’ kerning setting (in the character palette) to ‘optical’ rather than the default ‘metrics’ this can help a lot with creating more natural letter spacing.
to set it up with text animators, first twirl down the ‘master’ text layer and add a tracking animator from the ‘animate’ menu arrow. then add a scale animator the same way (you can add more properties if needed).
twirl closed then reopen the text properties of the master text. so you can see ‘more options’ and ‘animator 1’. in more options, you’ll probably want to set the grouping to ‘line’. then twirl down the animator>advanced and set the ‘based on’ to lines.
then drag the tracking and scale values to make sure the work the way you want.
next, select the more options and animator 1 and copy/paste them onto another text layer. twirl down the animator property to get to the trackinga nd scale properties, add expressions to each and then grab the expression pickwhip for each and drag it to the related property of the ‘master’ text layer. you should end up with an expression that looks something like this:
thisComp.layer("Master Text").text.animator("Animator 1").property.scalenow you can select the ‘more options’ and animator 1 property of that text layer and copy/paste them onto other text layers.
if you edit the tracking or scale animator of the master layer, the others should follow.
if you wanted to link the source text, you could use the same expression pickwhip method to link the source text of a slave layer to the source text of the master. the expression would look similar to this:
thisComp.layer("Master Text").text.sourceTextthen you can select the slave layer’s source text property, choose edit>copy expression only, slect the other slave layers and paste.
now when you edit the master source text, all will update.
Kevin Camp
Art Director
KCPQ, KZJO & KRCW
Reply to this Discussion! Login or Sign Up