godot
godot copied to clipboard
[FreeType] Add Apple EMJC emoji font support (for iOS built-in emoji font).
Fixes https://github.com/godotengine/godot/issues/77914
Adds support for EMJC bitmaps to the FreeType, not a high-priority, so I'll extensively test it after 3.1 release and probably make an upstream PR. I have not found any documentation for the bitmap format, so implementation is based on this decoder - https://github.com/PoomSmart/EmojiFonts/blob/main/emjc.py + some format info - https://qiita.com/496_/items/80cfc03ad2ed26c2ab52
Upstream issue - https://gitlab.freedesktop.org/freetype/freetype/-/issues/1051
would be really great to shoot for this in 4.4. emojis on ios are huge for mobile dev.
any update on this? That would be awesome to properly support iOS system emojis on Godot π
May I request at least a rebase of this PR? That way I can do a custom build and try it out. This would be a much appreciated enhancement.
Rebased and tested on iOS 18.4.1, seems to be working, but will require the same hack as in https://github.com/godotengine/godot/pull/106666 to have correct baseline.
Rebased and tested on iOS 18.4.1, seems to be working, but will require the same hack as in #106666 to have correct baseline.
Thank you! Will the #106666 hack work as is, or is there a different symbol for iOS than MACOS_ENABLED? Also, is the iOS emoji font name also ".Apple Color Emoji UI"?
Tested and works on iOS 18.4.1. The modification I suggested for #106666 seems to work for iOS and baseline position looks correct.
Working on iOS 18.5, except for an issue where TextServer.shaped_text_prev_character_pos() via TextEdit.get_previous_composite_character_column() seems to be returning an incorrect character length for certain composite characters (emoji). The obvious behavior is if you enter some emoji and then backspace, more than one emoji will all be deleted at once.
For example, these three emoji ππͺβ³ all return a length of 2 on iOS if TextEdit.get_previous_composite_character_column() is called with the caret set at the end of the character, but return a length of 1 on MacOS.
Only some emoji exhibit the wrong-length behavior, for example, ππΈπ all show a length of 1, however, the backspacing across multiple characters issue still happens.
Attached is a MRP you can run on iOS and MacOS/Win that will show the character length of emoji as they are added to the TextEdit field, and you can experiment with backspacing. You'll have to set up your own provisioning profile to export for iOS.
iOS:
MacOS:
MRP: ios-get-previous-composite-character-column-issue-mrp.zip