Open KyoumaGames opened 2 months ago
You can add extended ranges via font_add() at game time and draw emojis - there's nothing stopping you from doing this right now.
However, yes, https://manual.gamemaker.io/monthly/en/#t=The_Asset_Editors%2FFonts.htm does not actually document this restriction or say about needing to use font_add() at runtime to load larger fonts, so I would agree that page needs this all added, regardless of whether we change the Font Editor for this request or not.
https://manual.gamemaker.io/monthly/en/#t=GameMaker_Language%2FGML_Reference%2FAsset_Management%2FFonts%2Ffont_add.htm does talk about this already and says it's how to add Asian languages and Arabic, but does not explicitly mention this is how you would achieve emojis. Again, we could mention emojis there and better align the wording on both pages so they point to each other more when talking about limitations.
Our current runtime is limited to 65535, we plan on rewriting the text routines in GMRT to allow unicode characters outside the 0...65535 range
So at the moment there is no actual way to add emoji support for my game? Bummer. Well, thanks for the quick responses, btw! And it's at least good to know this seems planned
I have looked at how font_add() works with large range values, and ranges above 65535 work for this. Having tested with Google's open source Noto Emoji font, I have found that Unicode symbols show both in GML and in the project when using large ranges. Emojis themselves are being returned as "?" in GML, and not shown in the game even when large ranges are used.
I have looked at how font_add() works with large range values, and ranges above 65535 work for this. Having tested with Google's open source Noto Emoji font, I have found that Unicode symbols show both in GML and in the project when using large ranges. Emojis themselves are being returned as "?" in GML, and not shown in the game even when large ranges are used.
![]()
Yeah, it's the ability to natively type emojis on the user's side, I was wanting. Not pretyped emojis in the code. User typed emojis don't work with font_add either as mentioned above. I went ahead and found myself a workaround though, took quite the effort. Basically used FontForge to edit the font and moved all emojis from outside the 65k range to empty cells that were inside the 65k range. Then I made two array, one with all the old Unicodes and one with all the new unicodes (about 1600 entries in both), and then made it so whenever the player was typing, if an old Unicode was registered, it'd replace it with the new Unicode I set that emoji to. And it works.
But what cameron is saying is that at runtime using font_add it will work - you just need a font that has emojis in it.
But what cameron is saying is that at runtime using font_add it will work - you just need a font that has emojis in it.
His test was using emojis added with code. Trying to type them, with a phone, in-game, they will not work. Not even with font_add. I already tried this and the devs have already confirmed this in this thread. Originally, they changed the title of my post to say that emojis could be used with font_add (in the way I am talking about), but then later edited it again to say they can't after another dev came in and said it's being bottlenecked by the runtime only supporting 65k:
"Our current runtime is limited to 65535, we plan on rewriting the text routines in GMRT to allow unicode characters outside the 0...65535 range"
"changed the title Font Editor: Range values are limited to 65535, so the only way to add ranges beyond this is font_add() at runtime to Font Editor: Range values are limited to 65535, so there is no way to add emojis in VM/YYC"
I am the dev in question and I was wrong which is why QA went to test it out (cameron is QA here at GM)
This should work with user typed in strings as well (as long as they are encoded as UTF-8)
I am the dev in question and I was wrong which is why QA went to test it out (cameron is QA here at GM)
This should work with user typed in strings as well (as long as they are encoded as UTF-8)
Ah, my bad. I swore, I did test it with font_add with a font that used emojis, but I'll give it another try. Thanks Cameron for double checking that
So I did just try the font_add method again, and as I thought, it didn't work. It's the same issue I had with it before. The emojis are invisible. I did:
global.varFont = font_add("NotoEmoji-SemiBold.ttf", 24, true, false, 32, 1200000);
And then
draw_set_font(global.varFont);
In one screenshot, I type the peace sign, which is one of the few emojis under the 65k limit, you can see its number at the top, it's 9996, and it works. But then when I type the throw-up emoji, which is 129326, it does not get rendered. Doesn't even give the error block. It's just invisible. And as you can see from my font_add() line, I am also using Google's open source noto emoji pack.
can you create an issue with your project so we can take a look and work out what is going wrong? Cameron attached his project above - can you test that one and see if it works.
The problem may not be font related but reading the string from the keyboard.
Went ahead and downloaded Cameron's and modified it a bit to test. Added:
if !keyboard_virtual_status() { keyboard_virtual_show(kbv_type_default, kbv_returnkey_send, kbv_autocapitalize_sentences, true); }
To the step event and then in the Draw GUI event, I added:
draw_set_font(emojifont) draw_text(500, 500, string(ord(keyboard_string))); draw_text(200, 200, keyboard_string)
Those are the only changes I made and then exported it to android to test. Same result for their project (have a video of it this time). If you still need me to send mine over though, I can.
https://github.com/YoYoGames/GameMaker-Bugs/assets/173166892/91d92359-8cbb-46e7-9280-c9478163bef8
I've now split this issue, as we're moving well away from what the description and title here say ;)
For all in-game stuff and using emoji keyboards, please see the issue linked immediately above.
Description
Noticed when trying to add a range to my font, the limit is 65535. Most emojis are in the 100,000+ range. I believe this is an old limit that should've gotten removed long ago but was forgott n about. Two reasons why.
"GameMaker also has full four byte wide Unicode character support, allowing you to decode and encode Unicode characters in the upper bounds of the standard (including - but not limited to - emoji)"
Expected Change
Limit removed for font range, or extended into the millions to actually support most emojis
Steps To Reproduce
How reliably can you recreate this issue using your steps above?
Always
Which version of GameMaker are you reporting this issue for?
2024.4.1 (Monthly)
Which operating system(s) are you seeing the problem on?
Windows 10
Are you running GameMaker from inside your Steam library?
No
Contact Us Package Attached?
Sample Project Added?