Highlighted

How to have different sized fonts in a single layer via expressions?

Community Beginner ,
Sep 28, 2020

Copy link to clipboard

Copied

I'm fairly new to using expressions, this seems like it should be simple but I couldn't work it out so would appreciate any help!

As per my screenshot, I would like to change the size of '%' but because I'm using expressions to set the number value (and it changes over time) it won't work through using Character panel. All I want to do is make the '%' half size, what expression can I use to get it to change the size of only part of the source text? Or how do I use the setFontSize expression to achieve what I want?

TOPICS
Expressions

Views

97

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to have different sized fonts in a single layer via expressions?

Community Beginner ,
Sep 28, 2020

Copy link to clipboard

Copied

I'm fairly new to using expressions, this seems like it should be simple but I couldn't work it out so would appreciate any help!

As per my screenshot, I would like to change the size of '%' but because I'm using expressions to set the number value (and it changes over time) it won't work through using Character panel. All I want to do is make the '%' half size, what expression can I use to get it to change the size of only part of the source text? Or how do I use the setFontSize expression to achieve what I want?

TOPICS
Expressions

Views

98

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 28, 2020 0
Most Valuable Participant ,
Sep 28, 2020

Copy link to clipboard

Copied

Pretty much utter nonsense for such a trivial setup. Simply pre-compose the counter and scale the layer in the parent comp with continuous rasterization enabled. Calculating the actual 50% size and limiting the string would be a ton more complicated.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 28, 2020 0
Community Beginner ,
Sep 29, 2020

Copy link to clipboard

Copied

Forgive me if I do not understand, as I mentioned I am new to this. But from what I can gather, that means the '%' is static? I included it in the expression so that it would move as the counter counts up. So the distance between the numbers and the % is the same regardless of how many digits are in the counter. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 29, 2020 0
Most Valuable Participant ,
Sep 29, 2020

Copy link to clipboard

Copied

You can still have the text generated dynamically, you just only scale it in the parent comp. You might want to start by actually educating yourself about the many ways pre-composing/ creating sub-compositions is critical to structuring your AE work and solving such basic tasks. No point trying to do everything in a single comp.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 29, 2020 0
Community Beginner ,
Sep 29, 2020

Copy link to clipboard

Copied

Thanks for the suggestion, but how can I scale the '%' but still have it move with the text as if it is part of the same layer? I don't understand how your suggestion will allow the % to move as the text changes - which is what it does now.

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 29, 2020 0
Community Beginner ,
Sep 29, 2020

Copy link to clipboard

Copied

Use the character animator to scale the last digit of the string to 50%
If you expand the the Text Layer you can add animation properties there.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 29, 2020 0