Activity › Forums › Adobe After Effects Expressions › Different text size after the decimal point via expressions
-
Different text size after the decimal point via expressions
Posted by Emilian Arabadzhiev on October 14, 2015 at 3:22 pmIs it possible the numbers after the decimal point to be smaller?
*note: My source text gets it’s value via expressions
Kevin Camp replied 10 years, 9 months ago 3 Members · 7 Replies -
7 Replies
-
Dan Ebberts
October 14, 2015 at 5:04 pmYou could scale them, but not change the font size. You could use two text layers and use a sourceRectAtTime() expression to maintain the horizontal alignment.
Dan
-
Kevin Camp
October 14, 2015 at 5:29 pmyou could do it with one text layer and a couple text animators…
select your text layer and choose animation>animate text>scale and then also choose tracking from the same menu.
set the scale text animator property to something smaller that 100, say 50%(you can adjust later)
twirl down the range selector properties and add this expression to the start value:
num = text.sourceText;
wholeNumLength = num.split(‘.’)[0].length + 1;
100 * wholeNumLength / num.lengththat should scale down the numbers following the decimal.
the decimal values are likely spread out further than you’d like, so go to the tracking settings for the animator and set the amount as needed to make them look correct.
Kevin Camp
Art Director
KCPQ, KZJO & KRCW -
Emilian Arabadzhiev
October 14, 2015 at 5:30 pmThank you very much, Mr. Ebberts for your input!
I was thinking to make it with 2 layers and mask out after the decimal on the first and vice versa on the other, but it will only work with monospaced fonts. In my case the font isn’t monospaced.
I’m not very familiar with sourceRectAtTime(), it is fairly new expression. I used it once for dynamic lower fields based on ECA tutorial. I will research now how I can accomplish that alignment with it.
EA
-
Emilian Arabadzhiev
October 14, 2015 at 5:47 pmThank you very much, Mr. Camp!
It works! I just removed “+ 1”, because I just realized that the big decimal point looks ugly 🙂
Also added the same expression to the Тracking Start, so I can control the tracking only after the integer.ЕА
-
Kevin Camp
October 14, 2015 at 7:00 pmyou can also add (or move) the tracking properties into the same animator that is controlling the scale to avoid having the two animators/expressions. but having both will work just fine.
Kevin Camp
Art Director
KCPQ, KZJO & KRCW -
Emilian Arabadzhiev
October 14, 2015 at 8:04 pmDidn’t find a way to move it, but adding it to that particular animator works. Great addition to make it cleaner. I have much expressions in this project, so cleaner is (always) better 🙂
Thanks again, Kevin!EA
-
Kevin Camp
October 14, 2015 at 8:16 pmi am mistaken… i though you could move a property from animator to another, but you cannot.
but if you ever wanted to have multiple text animation properties controlled by a single animator, when you add the property, have the animator selected, and it will be a part of that animator.
Kevin Camp
Art Director
KCPQ, KZJO & KRCW
Reply to this Discussion! Login or Sign Up