Copy link to clipboard
Copied
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?
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...
Copy link to clipboard
Copied
Expressions can only set a font for the entire layer. You'll have to use two text layers and line them up with sourceRecAtTime().
Copy link to clipboard
Copied
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 + thePaddingI hope this helps
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Douglas Waterfall
After Effects Engineering
Find more inspiration, events, and resources on the new Adobe Community
Explore Now