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

Different fonts in the same text layer

New Here ,
Nov 09, 2023 Nov 09, 2023

Hello! I am trying to find the solution to be able to apply different fonts when I have an Asian and a Western text in the same text layer. So far, I have only been able to change it by selecting those characters and changing it in the font selector. My idea is to automate the font change but for this, first I need to find a way to change in a single step using scripting or expressions. For example, in this text 2023年11月27日, that the numbers have one font and the Japanese text have another different font. Does anyone know any solution?

TOPICS
Expressions , Scripting
889
Translate
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

correct answers 1 Correct answer

Community Beginner , Nov 09, 2023 Nov 09, 2023

I would use two different text layers with different fonts each. the short answer would be:
write these lines on the X axis (separating the dimensions)

 

var xPos = thisComp.layer("2023").transform.xPosition;
var theWidth = thisComp.layer("2023").sourceRectAtTime().width;

xPos + theWidth

 

This will place the layers close together, if you want to leave a space between them you can add a slider to each one and give them a space individually

 

var xPos = thisComp.layer("2023").transform.xPosition;
var t
...
Translate
Community Expert ,
Nov 09, 2023 Nov 09, 2023

Expressions can only set a font for the entire layer. You'll have to use two text layers and line them up with sourceRecAtTime().

Translate
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 Beginner ,
Nov 09, 2023 Nov 09, 2023

I would use two different text layers with different fonts each. the short answer would be:
write these lines on the X axis (separating the dimensions)

 

var xPos = thisComp.layer("2023").transform.xPosition;
var theWidth = thisComp.layer("2023").sourceRectAtTime().width;

xPos + theWidth

 

This will place the layers close together, if you want to leave a space between them you can add a slider to each one and give them a space individually

 

var xPos = thisComp.layer("2023").transform.xPosition;
var theWidth = thisComp.layer("2023").sourceRectAtTime().width;
var thePadding = effect("padding")("Slider");

xPos + theWidth + thePadding


If you want to automate it a little more you can change thisComp.layer("2023") with the code thisComp.layer(thisLayer, 1) so that it detects the position and width of a layer below, when you duplicate them it will position itself automatically.

 

So this would be my final lines

 

var xPos = thisComp.layer(thisLayer, 1).transform.xPosition;
var theWidth = thisComp.layer(thisLayer, 1).sourceRectAtTime().width;
var thePadding = effect("padding")("Slider");

xPos + theWidth + thePadding

I hope this helps

Translate
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
New Here ,
Nov 10, 2023 Nov 10, 2023

Thank you for tour answer! It's actually a good solution in theory but I don't think that would work. On the one hand, since each layer has a different font, the characters have different sizes between them, so it would not be perfect as if it were a single word. On the other hand, I would be interested if it were all on the same text layer for animations, effects...etc. 

Translate
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 ,
Nov 10, 2023 Nov 10, 2023

I have created similar projects many times. Text animators can be tied together with expressions, and timing can be adjusted. so that everything looks like it is on a single line as it animates in and out. If you could describe your design idea in detail, we could help you figure things out. 

 

The expressions suggested are just a start. I almost never separate dimensions because you lose the ability to edit a motion path accurately, and the speed graphs can be next to impossible to control.  

 

 

Translate
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
Adobe Employee ,
Nov 25, 2023 Nov 25, 2023
LATEST

Hi @cristiansierra 

 

There is a Scripting (not Expressions) solution now available in beta which will allow per-character control of styles, so you will be able to apply different fonts to different characters, like you wish to do here.

 

https://community.adobe.com/t5/after-effects-beta-discussions/per-character-scripting-public-beta-an...

 

Douglas Waterfall

After Effects Engineering

Translate
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