ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Timur Aroslanov
Extendscript: Is it possible to get individual character properties including its size and coordinates?
on Nov 2, 2018 at 11:12:42 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.


Return to posts index

Dan Ebberts
Re: Extendscript: Is it possible to get individual character properties including its size and coordinates?
on Nov 2, 2018 at 11:26:48 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



Return to posts index

Timur Aroslanov
Re: Extendscript: Is it possible to get individual character properties including its size and coordinates?
on Nov 2, 2018 at 11:40:27 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!


Return to posts index


Dan Ebberts
Re: Extendscript: Is it possible to get individual character properties including its size and coordinates?
on Nov 2, 2018 at 11:45:50 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



Return to posts index

Timur Aroslanov
Re: Extendscript: Is it possible to get individual character properties including its size and coordinates?
on Nov 2, 2018 at 11:48:30 pm

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]