Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Extendscript: Is it possible to get individual character properties including its size and coordinates?

  • Extendscript: Is it possible to get individual character properties including its size and coordinates?

    Posted by Timur Aroslanov on November 2, 2018 at 11:12 pm

    I have to animate a lot of text with multiple color images as part of the text (the same way we use emojis in chats, just as font). Since it’s impossible to do this natively, the basic idea was to use some text placeholders (like special characters) to be replaced by the script with images later. So, is it possible to find the position and rectangle size of these characters?

    If not, I will really appreciate any other ideas.

    Timur Aroslanov replied 7 years, 10 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    November 2, 2018 at 11:26 pm

    Your script can create a temporary text layer with the same font and size as your text, with just the special character as the text, and harvest the size of the character by itself. Then you can replace the text with all the text up to and including the special character and harvest the right edge. Subtract the width of the special character and you have the x positions where it starts and ends. The y extents are trickier, but can be done if they are important.

    Dan

  • Timur Aroslanov

    November 2, 2018 at 11:40 pm

    Thank you, Dan, this is genius! The only one issue with this approach – it’s hard to get the exact position of character because of variable tracking. So I think I’ll try to mock the type char by char to get exact size and position of each character.
    Thank you so much for the great idea!

  • Dan Ebberts

    November 2, 2018 at 11:45 pm

    My experience is that the kerning doesn’t enter into it because you get the right edge with the character in context and you know the width of the character by itself, so you should be on the nose with the left edge as well. You may be seeing something else though…

    Dan

  • Timur Aroslanov

    November 2, 2018 at 11:48 pm

    Oh, my fall! You right! Thank you very much!

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