Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions How to detect and affect only numbers contained in text

  • How to detect and affect only numbers contained in text

  • Jan Rous

    October 20, 2021 at 12:54 pm

    Hello guys. I made fully automated project in AE which loads tons of text from .tsv file. Unfortunately I must use font, approved by client, which has two sets of numbers (small and capital). I need to use those capital numbers even in non-capital text so Im trying to make an expression which sets “toUpperCase” only to numbers contained in text. Any ideas?

  • Andrei Popa

    October 20, 2021 at 1:49 pm

    I can test this if you can give me an example of a font that has upper case numbers (never heard of such a thing actually). Whithout testing, this could work, written in the text source.

    text.sourceText.replace(/^[0-9]+$/, function(v) { return v.toUpperCase(); });

  • Jan Rous

    October 20, 2021 at 3:53 pm

    Thank you so much for your reply. Font is Katarine Std (in attachment with short video of font behavior in AE) and it seems that those Capital or small numbers are actually different style sets, which, Im affraid, can´ t be affected by simple “sourceText.replace”.

  • Andrei Popa

    October 21, 2021 at 6:06 pm

    The numbers don’t seem to react to the .toUpperCase() function. If I use .toUpperCase() on “andrei popa” I get “ANDREI POPA” but if I use it on a number, nothing happes. The numbers only seem to react to the “All Caps” button from the character panel. I don’t know how to apply that button effect to only one part of the text.

  • Jan Rous

    October 22, 2021 at 8:12 am

    I made a little research meantime. This font behavior is caused because of stylistic sets (ligatures) which can be modified in Illustrator, but unfortunately not in AE. There are tabulatory and smallCaps sets for numbers, but those characters has no unicode codes, so it is not possible to replace them with javascript neither with AE expressions. Its still lot of features missing in AE. Thank you anyway for you time .. I changed the font with similar one .. problem solved 🙂

Viewing 1 - 5 of 5 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy