• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Multiple font styles' baseline not aligning when text is on multiple lines

New Here ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

Ok, this might be a bit complicated, but will do my best to explain the problem I’m having.

 

I’ve looked a few tutorials online and I’ve tried to combine a few of them to make a very handy layout, but am having some problems.

 

First tutorial is this one, which allows you to control the text’s width with a slider control. Very handy!

The second tutorial is from Ukramedia (amongst many others), that allows you to control the area of the text from a shape layer. Both are fascinating and very handy!

 

Both work great and are no problems, until I want to throw in the possibility of changing the font weights for some of the words. I do this by duplicating the text, and changing the font weight to let’s say “Bold”. 

 

At this point, I now have 2 identical text layers (one regular font, one bold). I then add an “Animator” property to control the opacity, and rig it up so that I can hide one or more words, then do the same with the bold layer (but opposite) so it reveals what’s being hidden by the first layer. 
Layers.png

In order to control all these attributes, I've added an Adjustment layer to be my master control layer. I'm calling this EG_Control. (EG as I'm actually adding these controlled properties to the Essential Graphics panel). 

 

Putting these controls in Essential Graphics gives me the flexibility of having a different width for the text layer, as well as a different size for the text to live in different comps.

EG.png

This seems to work fine when the text is on one line.

Text working great!.png

But when I add the bolded text, it does not align with the baseline of the regular text. Doesn't matter if it's just 1, 2, or 3 lines of text.

 

Misaligned Text 1.pngMisaligned Text 2.pngMisaligned Text 3.png


I'm happy to post the expressions being used, but it is just as easy to provide my example file (see below) to look into a bit further. I feel like using “sourceRectAtTime()” is the answer to my problem, but I just don’t know enough about expressions to get these two layers to always align to the initial text layer. 

 

If anyone has an idea of how to resolve this, or if I’m missing a tiny line of code to always align the text to one layer, I would be extremely grateful!

Sample file

Thanks so much! 

TOPICS
Error or problem , Expressions , How to , Scripting

Views

212

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
community guidelines
LEGEND ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

You could just add a vertical offset control? not sure what more you would need here. The rest is just a limitation inherent in how text rasterization works. You can't make it work universally for every scenario because plain and simple there is no access to those properties buried in the Adobe Font Engine.

 

Mylenium

Votes

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
community guidelines
New Here ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

LATEST

Thanks for your input Mylenium. I've read some other threads on the community that have been fairly similar concerning 2 different font weights, and it felt like someone had resolved this. Though in the thread somebody posted an example file, but the link to that file has been long expired. Requested a new upload but haven't heard anything yet. I'll look into the offset option to see if that might help. 
Would I just make a new variable and link that to a separate slider in the same source text property?

Votes

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
community guidelines