Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes emoji characters not displaying when letterSpacing style is used #5608

Merged
merged 4 commits into from Apr 25, 2019

Conversation

themoonrat
Copy link
Member

Description of change

#5571
Changed fix to use Array.from as linting didn't like the use of for each over a string

Pre-Merge Checklist
  • Documentation is changed or added
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

@bigtimebuddy
Copy link
Member

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from

Array.from is not supported in IE, need a polyfill in the polyfills package.

@themoonrat
Copy link
Member Author

Ahhhh sorry! I forget we're only in a semi es6 world.

@themoonrat
Copy link
Member Author

So, I've tweaked it so that it only uses Array.from if it exists.
There is no use polyfilling it, as it will still display incorrectly in IE; it requires the iterable powers of es6 that that just can't be polyfilled from my research.
It's also not perfect at splitting emoji; 👩‍❤️‍💋‍👩 will get split into 👩❤💋👩.
To get it all perfect would required a big 100kb library like https://github.com/orling/grapheme-splitter which we're not going to be adding into PixiJS.

But at least in most scenarios things are better with this PR. They're never worse, anyway!

Copy link
Member

@bigtimebuddy bigtimebuddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with this 👍

@bigtimebuddy bigtimebuddy added this to the v5.1.0 milestone Apr 22, 2019
Copy link
Member

@GoodBoyDigital GoodBoyDigital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix 👍

@bigtimebuddy bigtimebuddy merged commit 69e6cee into dev Apr 25, 2019
@englercj englercj deleted the emojji-letter-spacing branch May 20, 2019 00:08
@lock
Copy link

lock bot commented May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

1 similar comment
@lock
Copy link

lock bot commented May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants