Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Spanish accents and upside down question marks affecting position of text box

  • Spanish accents and upside down question marks affecting position of text box

    Posted by Elizabeth Zill on March 8, 2022 at 10:28 pm

    Hi everyone! I’m building a lower third mogrt to be used with both Spanish and English text. When the English text is in the text box, it’s in the correct position, but when I add characters that take up more space like this: ¿Sabes cómo hacer que esto funcione?, the text box needs to move down several pixels on the y-axis. I believe I need an expression on the position of the text box that says something like “if there are characters like “¿ or ó” then move the box down 4 pixels.” I don’t have know the syntax to write this expression. Thanks in advance for your help, community.😀

    Filip Vandueren replied 4 years, 6 months ago 3 Members · 4 Replies
  • 4 Replies
  • Tomas Bumbulevičius

    March 8, 2022 at 11:00 pm

    Hey Elizabeth – is font going to be changed in the mograph? Because if yes – then it wouldn’t work this way due to different heights for font families.

    Instead its better to add characters with ascenders/descenders to the phrase, and eliminate them by text animator with opacity set to 0 for end characters (or apply ‘|’ to the end of all phrases in expression)

  • Elizabeth Zill

    March 9, 2022 at 12:32 am

    Thanks Tomas! I like this solution as it seems more customizable. And what would that look like as an expression? I have no idea as to the way to write this.

  • Tomas Bumbulevičius

    March 9, 2022 at 8:16 am

    Elizabeth – something along those lines:

    For your text layer’s Source Text:
    text.sourceText + “|”

    Then:
    1. Apply Opacity Text Animator to the text layer;
    2. Set opacity of animator to 0;
    3. Set units in Advanced settings to Index;
    4. For range selector, to start, apply this:
    text.sourceText.length-1
    5. For range selector, to end, apply this:
    text.sourceText.length

    What it will do is to add “|” and with opacity animator subtract it.

  • Filip Vandueren

    March 9, 2022 at 10:45 am

    Just a quick addition:

    If you have line break characters in your string, those are not counted by the textIndex, but they are counted by the string, so then the selection of the final pipe character goes wrong.

    If you need linebreaks in the string,

    That can be fixed with:Just a quick addition:

    If you have line break characters in your string, those are not counted by the textIndex, but they are counted by the string, so then the selection of the final pipe character goes wrong.

    If you need linebreaks in the string,

    That can be fixed with:

    text.sourceText.value.replace(/\r/g,””).length;

    (It replaces all linebreak characters with nothing before measuring the length of the string)

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