Skip to main content
Participant
February 6, 2024
Answered

How can I smooth text slider expression

  • February 6, 2024
  • 2 replies
  • 676 views

Hey

I am new to after effects so if you can explain to me what to do. I need to smoother animation for this text expression.

How can I do it? This is a what I use:

 

var array=[ "ClashGroteskVariable-Extralight", "ClashGroteskVariable-Light", "ClashGroteskVariable-Regular", "ClashGroteskVariable-Medium", "ClashGroteskVariable-Semibold", "ClashGroteskVariable-Bold", ];

r = Math.round(thisComp.layer("Slider Control").effect("Font Weight")("Slider")); style.setFont(array[r]);

 

 

This topic has been closed for replies.
Correct answer Rick Gerard

Fonts won't blend. When a style changes, it's an on/off switch. Expressions don't make it any different. A change in any text property with an expression is instantaneous.

 

You'll need multiple layers and some kind of dissolve or distortion effect. The other option would be to convert text to shape layers and animate the paths, but that could also be a real mess.

2 replies

Adobe Employee
February 12, 2024

You've got the right idea, but you are mssing what is special about Variable fonts - which this is: your table entries are all the named instances but as this is a Variable font there are an infinite number of custom instances available if you use a custom design vector.

 

This font has one design axis, with a tag "wght" and min:200 max:700

 

So what you need to do is dynamically construct PostScript names between these two limits:

 

"ClashGroteskVariable_200wght" and "ClashGroteskVariable_700wght"

 

You can build those into your array (_250_wght, _300wght, etc) or you could dynamically build it by taking the prefix "ClashGroteskVariable" and append an underscore, the axes value you design and the axis tag.

 

The Scripting API can be useful for uncovering information about fonts in general.

 

Fonts.getFontsByPostScriptName()

Font.designAxesData()

 

Douglas Waterfall

After Effects Engineering

Rick GerardCommunity ExpertCorrect answer
Community Expert
February 6, 2024

Fonts won't blend. When a style changes, it's an on/off switch. Expressions don't make it any different. A change in any text property with an expression is instantaneous.

 

You'll need multiple layers and some kind of dissolve or distortion effect. The other option would be to convert text to shape layers and animate the paths, but that could also be a real mess.