• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Change Font of a Specific Character through Text Animator

Community Beginner ,
Jul 23, 2023 Jul 23, 2023

Copy link to clipboard

Copied

I want to change the font of a character in the text layer which comes at last of text. Is there any way to do this with a text animator?

TOPICS
Expressions , How to

Views

235

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 23, 2023 Jul 23, 2023

Copy link to clipboard

Copied

There isn't - not with with text animators and more or less also not with the setStyle() expressions. Sad as it is, but the only way to do this reliably is to use separate layers.

 

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 23, 2023 Jul 23, 2023

Copy link to clipboard

Copied

LATEST

Text animators cannot change fonts. Expressions can only change the font of the entire text layer. Expressions can count the number of characters, and Text Animators can be set to use the number of characters in a layer.

 

A simple expression based on the number of characters tied to the start and end of one layer and the end of another will show all but the last letter on the first layer and only the last letter on the second. The only downside to this approach is that you will have to set both layers to be Right Justified. If you need to make the pair of text layers look like they are Left Justified, then you will have to add another expression that modifies the layers' position based on the text layer's width.

 

Throw in some parenting, and you should have the solution. Depending on the font, you may need to adjust the horizontal position of the second layer (the last character) to fix kerning issues that may come up when you change fonts. The comp would look like this:

RickGerard_0-1690124094032.png

Here are the expressions:

 

 

//Top Text Layer/Animator 1/Range Selector/Start
ref = text.sourceText;
num = ref.length;
lChr = num -1;

//Top Text Layer/Animagot 1/Range Selector/End
ref = text.sourceText;
num = ref.length;

//Top Text Layer/Transform/Position
w = sourceRectAtTime().width;
[value[0] + w , value[1]]

//Second Text Layer/Text/Source Text
thisComp.layer("Main Text").text.sourceText

//Second Text Layer/Animator 1/Range Selector/End
ref = thisComp.layer(index - 1).text.sourceText;
num = ref.length;
lChr = Math.max(num)-1;

 

 

The Text/Animator 1/Opacity for both layers must be set to zero, and the Animator 1/Units must be set to Index.

 

That should get you started. I've included a project file you can fiddle with.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines