Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions [Square Brackets] to change font style and size? IS IT POSSIBLE???

  • [Square Brackets] to change font style and size? IS IT POSSIBLE???

    Posted by Jake Waksman on August 2, 2023 at 1:24 pm

    I am currently trying to find an expression that will allow me to change the font style and font size using square brackets. We have a platform that works as a bridge between a user and After Effects, so any text input is being completed through the API so the manual adjustment of specific characters or words is not available.

    I have the above expression for changing a colour but cannot seem to find one to change both the font style and font size. Please see the colour expression below. This makes sense because I can then choose RGB FILL as an additional property to instruct AE to change the properties of text within square brackets.

    SOURCE TEXT EXPRESSION:

    str = text.sourceText;res1 = str.split(“[“).join(“\u200b”);res2 = res1.split(“]”).join(“\u200b”);

    FILL RGB ANIMATOR EXPRESSION:

    Start Expression:

    txt = text.sourceText;zws = “\u200b”;
    function getPosition(string, subString, index) { return string.split(subString, index).join(subString).length;}
    val = getPosition(txt, ‘\u200b’, 1)

    Stop Expression:

    txt = text.sourceText;zws = “\u200b”;
    function getPosition(string, subString, index) { return string.split(subString, index).join(subString).length;}
    val = getPosition(txt, ‘\u200b’, 2)

    Dan Ebberts replied 3 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    August 2, 2023 at 1:59 pm

    Unfortunately, there’s no way to have multiple font styles in a single text layer once an expression has been applied to the source text.

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