Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions How do I set the font style for text that was concatenated with expressions?

  • How do I set the font style for text that was concatenated with expressions?

  • Oscar Obians

    May 8, 2020 at 12:20 am

    So I created two text layers named txt1 and txt2 respectively. But I want to display the contents of both layers in txt1, and get it to inherit the font style of txt2, while txt2 remains hidden.

    txt1 reads “Hello there” in comic sans
    txt2 reads “It’s a new day” in Arial-Bold

    What Expressions can I input in txt1 to ensure it not only includes the contents of txt2 (to read: Hello there It’s a new day) but also do so in Arial

  • Andrei Popa

    May 8, 2020 at 1:20 am

    The expressions can’t set different fonts for the same layer yet. I personally hope that adobe will soon make this work.

    Andrei
    My Envato portfolio.

  • Oscar Obians

    May 8, 2020 at 7:04 am
  • Robert Müller

    May 8, 2020 at 8:47 am

    What Andrei meant is, that you cant set two different styles for the same text layer yet. The style you set in an expression would affect all the text, even the original from txt1.

  • Oscar Obians

    May 8, 2020 at 5:14 pm

    I think that’s what I’m trying to accomplish. I’m not trying to give two different styles but to make the final concatenated result appear in the specific font style.

  • Oscar Obians

    May 8, 2020 at 10:08 pm

    Ah! I finally got it to work. I created 3 text layers: txt1, txt2, txt3.
    For illustration purposes,
    txt1 says: Hello there, its
    txt2 says: morning
    txt3 holds the expression to concatenate txt1 & txt2.

    I but I also wanted txt3 to inherit the font style of txt1.

    txt1=thisComp.layer("txt1").text.sourceText;
    txt2=thisComp.layer("txt2").text.sourceText;
    txt3=txt1+" "+txt2;
    fontStyle=thisComp.layer("txt1").text.sourceText.style.font;
    style.setFont(thisComp.layer("txt1").text.sourceText.style.font).setText(txt3);

Viewing 1 - 6 of 6 posts

Log in to reply.

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