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

Implement color emoji support for Android #17854

Merged
merged 2 commits into from
Aug 6, 2023
Merged

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Aug 6, 2023

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

@hrydgard hrydgard added Platform-specific (Android) User Interface PPSSPP's own user interface / UX labels Aug 6, 2023
@hrydgard hrydgard added this to the v1.16.0 milestone Aug 6, 2023
@hrydgard hrydgard merged commit 83dbc60 into master Aug 6, 2023
19 checks passed
@hrydgard hrydgard deleted the color-emoji-android branch August 6, 2023 13:36
// 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);
Copy link
Collaborator

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]

Copy link
Owner Author

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);
Copy link
Collaborator

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]

Copy link
Owner Author

@hrydgard hrydgard Aug 6, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform-specific (Android) User Interface PPSSPP's own user interface / UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants