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

noCountryFlags: false does still hide country flag emojis on windows, even though my custom font supports them #808

Open
Simon-Laux opened this issue Mar 1, 2023 · 2 comments · May be fixed by #809

Comments

@Simon-Laux
Copy link

Simon-Laux commented Mar 1, 2023

noCountryFlags: false does still hide flag emojis on ms windows with the native emoji set.
I replace the native emoji font inside of my css, with google noto color emoji which does support country flags:

@font-face {
  font-family: 'EmojiMart';
  src: local('Apple Color Emoji'), url("noto/emoji/NotoColorEmoji.ttf") format("truetype");
}

But emoji mart checks only for the native font and does not notice that the 'EmojiMart' font was set:

ctx.font = textSize + 'px Arial, Sans-Serif'

Possible Solutions

A. noCountryFlags property should respect false

noCountryFlags should autodetect when it is set to undefined and respect my preference when I set it to a boolean true or false:

noCountryFlags = undefined // auto detect support
noCountryFlags = false // show country flags
noCountryFlags = true  // hide country flags

PR that implements this solution: #809

B. isEmojiSupported() check should include 'EmojiMart' font

probably easy to do (just add it to native-support.ts#L64), but there is the question whether this introduces a race condition where the css stylesheet is loaded after emoji mart did the check.

@Simon-Laux Simon-Laux changed the title noCountryFlags: false does still hide country flag emojis on windows noCountryFlags: false does still hide country flag emojis on windows, even though my custom font supports it Mar 1, 2023
@Simon-Laux Simon-Laux changed the title noCountryFlags: false does still hide country flag emojis on windows, even though my custom font supports it noCountryFlags: false does still hide country flag emojis on windows, even though my custom font supports them Mar 1, 2023
Simon-Laux added a commit to Simon-Laux/emoji-mart that referenced this issue Mar 1, 2023
also fix a typo in the documentation

fixes missive#808 (this implements solution A)
@Simon-Laux Simon-Laux linked a pull request Mar 1, 2023 that will close this issue
@Tokirkhokhar
Copy link

you can refer this repo if you are getting issue with country flags on windows.
https://github.com/talkjs/country-flag-emoji-polyfill

@Simon-Laux
Copy link
Author

you can refer this repo if you are getting issue with country flags on windows.
https://github.com/talkjs/country-flag-emoji-polyfill

not sure how this would help, this injects a custom font (same as I do in my project), but emoji mart tests for flag support with 2 specific system fonts on a canvas, the injected font will not be part of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants