Skip to main content
Inspiring
May 21, 2020
Question

.replace() to change letter into a different glyph

  • May 21, 2020
  • 1 reply
  • 3488 views

Hey Guys,

 

I have the source text of a layer referencing the comp name. I'd to edit the comp name and it update on the text layer. This is my code.

 

compName = comp("Liam Carlin").name.replace(/a/gi,"a");

 

However I am not trying to replace the letter a with the same letter a I wasnt to replace it with a different glyph version of that font family. Is it possible? I am unable to paste the correct glyph letter into the expression editor as it just see it as the letter 'a'.

 

Thanks

Liam 

This topic has been closed for replies.

1 reply

Mylenium
Legend
May 21, 2020

You need to force it with string.fromCharCode().

 

Mylenium

Inspiring
May 21, 2020

Where would I be going wrong from here?

 

compName = comp("Liam Carlin").name.replace(/a/gi, String.fromCharCode(u+0061));

 

Thanks

Liam

Mylenium
Legend
May 21, 2020

I'm not clear what you are asking. You need to explain better what you are having issues with.

 

Mylenium