-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Implement color emoji support for Android #17854
Conversation
// ranges grabbed from https://stackoverflow.com/a/62898106, ignoring the two bogus ranges. | ||
// there's probably more. Doesn't need to be perfect. | ||
inline bool CodepointIsProbablyEmoji(uint32_t c) { | ||
return (c >= 127744 && c <= 129782) || (c >= 126980 && c <= 127569); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I would just assume anything with characters outside the BMP (i.e. c > 0xFFFF) includes emoji. Unless someone is using Ancient Sumerian or Egyptian Hieroglyphics, that's probably the only reason most people will use non-BMP glyphs. I guess the other thing is advanced math symbols.
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess that's the safer way to go...
apiName += ", debug build"; | ||
apiName += ", debug build "; | ||
// Add some emoji for testing. | ||
apiName += CodepointToUTF8(0x1F41B) + CodepointToUTF8(0x1F41C) + CodepointToUTF8(0x1F914); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean for this to stay? I mean, it's fine, just noting in case.
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, since it's debug build only :) and having them here is convenient for checking.
Emoji are used in some RetroAchievement sets.
Actually, the platform renders color emoji just fine as it is, just that we squished away all the color when converting to our monochromatic font images. So now we switch to color if emoji is detected in text.
Windows is not included here. Easy for UWP, but more complicated for the normal build, we might be able to use the DirectWrite code we use on UWP, possibly, even in the non-UWP build. Standard windows GDI does not support color emoji.
No idea about Qt.
Part of #17631