photopea / Typr.js

Typr.js - process fonts in Javascript
MIT License
914 stars 73 forks source link

emoji encoding exception #46

Open sunwanxin213 opened 1 year ago

sunwanxin213 commented 1 year ago
截屏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.

sunwanxin213 commented 1 year ago

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.

photopea commented 1 year ago

When I do this in JS

"🧜‍♂".length

It prints "4".

sunwanxin213 commented 1 year ago
截屏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

sunwanxin213 commented 1 year ago

and in js hyphen length = 0

sunwanxin213 commented 1 year ago

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