Emojis with default fonts: what devices and fonts support which emojis?

Recently I've noticed that on-device fonts support emojis (Star,Rocket, ...). Is there a table somewhere, where I can look up which devices supports which emojis?

Also, so far the emojis only show up when received via a JSON and I've been unable to just use them as part of a string inside the app. I've tried "\u2b50" and "Star" but without success. What format is expected?

Thanks in advance!

  • Is there a table somewhere, where I can look up which devices supports which emojis?

    Unfortunately no

    What format is expected?

    Try encoding your source (MC and resource XML) files as utf-8. You should be able to use unicode literals, but unfortunately unicode escape sequences don't work. Also, system.println() may not print non-ASCII unicode characters properly (*).

    For me Star doesn't work in the sim (955) or on a real 955, at least when I try to use it as part of a datafield label. (Maybe I would have better luck with other use cases idk.)

    What does work for me is ° (U+00B0), as Garmin devices have supported this character forever. (Then again it's an extended ascii character so it predates unicode)

    If you prefer to work with numerical representations of non-ASCII unicode characters, you could always encode your character value(s) in a bytearray and use the convertEncodingString to convert them to plain text. That's a lot of code / runtime overhead though.

    You could also try working with individual chars (assign the value of a char to Number variable, convert the Number to a Char, then convert the Char to a string):

    e.g.

    var degree = 0xb0;// °
    var degreeChar = degree.toChar();
    // or simply: var degreeChar = (0xb0).toChar();
    System.println(degreeChar); // prints ° on the console, when the console is working properly
    
    // this works in the initialize() function of a simple datafield
    // the datafield label is "My Label °"
    label = "My Label " + degreeChar; 

    So if you know the 0x2b50 emoji works as input from JSON somewhere in your app, try something like the following code in place of it:

    var star = (0x2b50).toChar();
    var testString = "String with " + star + " emoji";

    (*) EDIT: I should point out that emojis seem to work properly (for System.println()) in the VS Code debug console for my Mac, but not for my PC. Not sure if there's some difference in version or configuration here.

  • I started to collect them here: https://forums.garmin.com/developer/connect-iq/f/discussion/366871/which-emojis-non-ascii-unicode-characters-that-can-can-t-be-used-and-where

    Please test the ones you need and then comment in that thread, I'll edit the 1st post to include them

  • Thank you! I've added a bunch of Emojis. None of which work in the simulator on Linux or MacOS but show up on the actual devices. Using them is as easy as just copy&pasting them into the code and format them as a string e.g., var my_star = "Star";