Gadgetbridge: Feature Request: Emoji "transliteration"

Created on 17 Aug 2017  路  23Comments  路  Source: Freeyourgadget/Gadgetbridge

Before opening an issue please confirm the following:

  • [x] I have read the wiki, and I didn't find a solution to my problem / an answer to my question.
  • [x] I have searched the issues, and I didn't find a solution to my problem / an answer to my question.
  • [x] If you upload an image or other content, please make sure you have read and understood the github policies and terms of services

Your issue are:

Emojis are shown as "?" on my mi band. I would suggest to use text only smileys for the most popular emojis ( ":)",":(",...) and a placeholder symbol for all others (or just leave the ?). If GB would entirely remove them and someone gets a message with just a emoji, this message seems to be empty on the mi band.

Your wearable device is:

Mi Band 2
HW: 0.1.3.2
FW: 1.0.1.50

Your android version is:

Android 7.1.2

Your Gadgetbridge version is:

0.19.4

feature request

Most helpful comment

i have a working version replacing the emoji with their textual representation, for this i used this java library:
https://github.com/vdurmont/emoji-java

let me know if you are interested..

All 23 comments

I renamed the issue for several reasons

  • I didn't like that it is formulated like a bug. It is not a bug. It is a feature request.
  • Emoji work on the pebble, they are included in the font

That being said, your idea makes sense somehow.

Still it might be a better solution to flash a custom font on the mi2 IF that is possible (more research is needed)

I dont like the idea of custom fonts. Maybe Xiaomi implements it one day.

Pebbles are also missing some emojis. "Transliterating" them to text would also work for me, for example changing 馃憤 to :thumbs-up:. Receiving a bunch of squares forces the user to check their phone, which I don't concider to be suitable behavior for smartwatches.

Since I bought an AmazFit and can't read half my messages, I would start to work on this, if we agree on the same set and way:
As a base, I would use https://unicode.org/emoji/charts/full-emoji-list.html to translate all emojis from their unicode to :cldr:

If we are willing we could additionally translate some to a shorter form, e.g. :), B), :P and so on. What do you think?

I think we would need multiple transliteration implentations, so that we can use the right one, or even more than one for each device.

So basically an interface Transliterator with implementations for for the charset dependent transliterations (眉 -> ue), and for different emoji/smiley encodings.

The DeviceCoordinator could then be asked for the right transliterator, typically returning a compound transliterator specific to the device, possibly even its firmware version.

Does this make sense? :-)

@mueller-ma: I took a look at the bibfont.py for unpacking and packing the font-file. If i'm right the amazfit bip can only display utf-8 encoded chars which fit into two Bytes?! I think it starts with "dec 32 space" and max. char is dec 65535. So it's impossible that emojis will be included in font file, right?!

I think a simple function that deletes every "char" in messages which is out of range would be nice :)

@neoxitric
Bip can only display characters that take two bytes in UTF-16. If the limit would be two bytes in UTF-8 then it could not display chinese characters at all. It is true though that it cannot display emoji and some chinese character that need more that two bytes in UTF-16 (like 黏綔)

The Cor has flashable "emoji files", but I havent tested those yet.

@ashimokawa but it also fails to display 眉 (german umlaut) which is even in ascii?

@nickvergessen
眉 can be added by using the font tool! Some already did that
眉 is not ascii but encodable in utf-16
(The problem here is that the bitmap f眉r 眉 is just not in the font, strangely enough 脺 (uppercase) is included)

眉 can be added by using the font tool! Some already did that

:confused: mind to tell me which wiki/tutorial I have to follow :)

@ashimokawa thanks for information! so, i was half right ;-) two bytes but utf-16.
@nickvergessen here's the font-tool i talked about: https://github.com/amazfitbip/tools/blob/master/bipfont.py

here you can download a german translated (custom) firmware:
https://github.com/yener90/bip_translator/tree/master/Firmware/German

i kept the original english firmware but extracted all bitmaps for the missing umlauts from the german firmware and added them to the english font file. german translation was not that good, but now i can read most of the messages ;-)

a "complete" font-file which includes all utf-16 chars that fit in two bytes would be great.

FYI, there is also the possibility to use the latin font which includes 盲枚眉, it also looks different and has no CJK characters at all. The latin font can be flashed in parallel to the normal font. Unfortunately that font only works when when the watch is set to spanish (which also disables the normal font).

But since the latest Mi Fit versions there is also a "latin firmware". I wonder if that "latin firmware" can be switched to english and if it uses the "latin font" for all languages. I never tested the latin firmware but I am curious.

But since the latest Mi Fit versions there is also a "latin firmware". I wonder if that "latin firmware" can be switched to english and if it uses the "latin font" for all languages. I never tested the latin firmware but I am curious.

I tested the "latin firmware", only spanish and russian are supported AFAIK. Umlauts are present but emoji aren't.

i have a working version replacing the emoji with their textual representation, for this i used this java library:
https://github.com/vdurmont/emoji-java

let me know if you are interested..

Sounds great, would you like to open a pull request?

The Cor has flashable "emoji files", but I havent tested those yet.

@ashimokawa
Could you give me a pointer to these "emoji files"? I'd like to check them out.

Hello.

I have a amazfit bip with a custom font installed. I can see graphical emojis with Notify and Fitness.
However with GadgetBridge my emojis are always translated to text :-) etc....

Is there a way to implement the same behavior?

Yes sure, we can implementiert a way to disable emoji transliteration.

Can you share your font?

FWIW in AmazfitBipCoordinator.java there is no override for the supportsUnicodeEmojis() method, so it runs the one from AbstractDeviceCoordinator.java which returns false, thus emoji transliteration is always enabled for the Amazfit Bip.

The coordinator is probably not the best place to change this, since the Amazfit Bip with stock firmware does not support Unicode emojis, but it can when the user flashes a custom font.

A preference checkbox in Language and region settings, or maybe in the Device specific settings, would be ideal.

Agree, i would like to try the font

Here's PR #1578. I tried to add it as a _Device specific setting_, but I wasn't sure how to make the preference apply only to certain devices, so it's global for now.

Works on my device.

Just made it a per-device preference and updated the PR, hope it's alright.

As for the fonts,

  • The custom font I am currently using is BOLD 4 by _ahsim_ and can be found here.
  • There is a newer font, BOLD 5, here, which is more compact than the 4. However, on the 5 many international characters are raised instead of inline, so I personally prefer the 4.
  • Both BOLD 4 and 5 support emojis, but require _non_-latin firmware on your Bip. With it, the Bip menus appear in English, but notifications can show text in many languages with international characters and emoji.
  • There are other custom fonts here for latin firmware. Among them is BOLD 6, but due to the format of the fonts in latin firmware, it only has a few emojis.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  7Comments

ihsan-driveyello picture ihsan-driveyello  路  6Comments

leonardomaccari picture leonardomaccari  路  5Comments

MagicFab picture MagicFab  路  7Comments

RustyRaptor picture RustyRaptor  路  3Comments