photopea/Typr.js

emoji encoding exception

sunwanxin213 opened this issue · 5 comments

截屏2023-02-06 23 33 26

截屏2023-02-06 23 34 07

截屏2023-02-06 23 34 50

I changed the code format, but the content is consistent with the warehouse.
In the first picture, the left side is the Typr.js effect, and the right side is the correct effect.
At present, it seems that this is due to the lack of support for emoji special coding.

At the same time, I'm also trying to support gradients. At present, there are still some bugs. When the preparation is completed, I will submit the code for review.

When I do this in JS

"🧜‍♂".length

It prints "4".

截屏2023-02-06 23 50 57

I read the relevant literature. Is he supposed to be like this?

UInt32 (first emoji)+hyphen (UInt16)+UInt32 (second emoji)=combined emoji

https://unicode.org/reports/tr51/#Proposals

and in js hyphen length = 0

I'm not sure. Although I mentioned issue, I will try to fix it.