InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.71k stars 926 forks source link

Notifications don't show all utf-8 characters #261

Closed mareksamec closed 2 years ago

mareksamec commented 3 years ago

I have noticed that characters like ščřžěšÅÄÖ are omitted from the notifications shown on PineTime. I also tested this in Gadgetbridge by sending messages with these characters. It does not seem to be Gadgetbridge issue but I cannot rule it out 100%.

Please let me know if there is any way I can help with debugging, testing etc. Sorry if this has already been fixed in the newer releases.

InfiniTime 0.14.0 Gadgetbridge 0.55.0 (patched version by Joaquim)

joaquimorg commented 3 years ago

The Infinitime font don't have the complete characters set for international languages.

https://github.com/JF002/InfiniTime/tree/develop/src/displayapp/fonts#readme

JF002 commented 3 years ago

That's a known... missing feature. ITF-8 defines 1,112,064 valid characters and adding all of them into the font would probably fill the memory of the pinetime several time! For now, we've only included basic ASCII characters and cyrillic ones. It's still missing all accentuated letters from French Language (éèêë), German characters (https://github.com/JF002/InfiniTime/issues/212) and many other characters from other languages.

As the flash memory of the device is nearly full right now, we'll have to find a smart way to implement internationalization into infinitime :)

Avamander commented 3 years ago

As the flash memory of the device is nearly full right now, we'll have to find a smart way to implement internationalization into infinitime :)

:smiley: fonts stored on LFS loaded by LVGL's storage driver (I'd really love a blobmoji font)

mareksamec commented 3 years ago

That's a known... missing feature. ITF-8 defines 1,112,064 valid characters and adding all of them into the font would probably fill the memory of the pinetime several time! For now, we've only included basic ASCII characters and cyrillic ones. It's still missing all accentuated letters from French Language (éèêë), German characters (#212) and many other characters from other languages.

As the flash memory of the device is nearly full right now, we'll have to find a smart way to implement internationalization into infinitime :)

Too bad 😁. Not sure how difficult would it be, but perpahs the Gadgetbridge could send letters and strip the accents. This way it would be at least readable. For instance in Python I would use something like unidecode

blaueente commented 3 years ago

For more complicated emojis, maybe Gadgetbrige could just render them to bitmap and send them with the message?

ptman commented 3 years ago

can a larger font be stored on the SPI flash? where could we find statistics on most used glyphs?

lafriks commented 3 years ago

can a larger font be stored on the SPI flash? where could we find statistics on most used glyphs?

I would say that's really region dependent, I wonder how much would it be to include at least European languages?

Riksu9000 commented 3 years ago

There are 64 letters in the Latin-1 Supplement unicode block. I presume that includes a lot of the characters that people want. Adding these characters in range 0xC0-0xFF increases binary text size 1832. Removing the two mathematical symbols from the range surprisingly doesn't change the binary size at all. https://en.wikipedia.org/wiki/Latin-1_Supplement_%28Unicode_block%29

Bloodaxe95 commented 3 years ago

I've noticed this issue as well, specifically with the letters Æ,Ø and Å. It would be pretty awesome to have my native letters supported :-D But from the posts above mine it seems there isn't a super-simple solution to this issue :-(

esijg commented 3 years ago

I am experiencing the same thing with Icelandic special characters. I can alleviate that a bit by enabling transliteration in gadgetbridge but that does not cover all the cases sadly.

string:     éþýúíóöáæð
transliterated: eyuiooaae

Gadgetbridge seems to transliterate all of them correctly except for þ and ð. Which should transliterate to th and d. Now I do realize that this is an impossible task for the watch to store all these fonts, but would it be possible to make infinitime handle transliteration instead of hoping for 3rd party apps to handle it correctly? or is that asking too much of it?

Avamander commented 3 years ago

but would it be possible to make infinitime handle transliteration instead of hoping for 3rd party apps to handle it correctly?

Nope, too language-specific. Open an issue on Gadgetbridge's repository about it being incorrect in your language.

LVGL can load fonts from external storage, in theory, someone just has to do it.

esijg commented 3 years ago

Open an issue on Gadgetbridge's repository about it being incorrect in your language.

Done. here's the link for anyone interested. https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/2388

kieranc commented 2 years ago

Duplicate of #212 and known issue, can be closed?

esijg commented 2 years ago

Leaving a note here for future readers. Fixing/improving transliteration in Gadgetbridge seems to be super straight forward and they are quick to fix it once pointed out. I opened an issue on their issue tracker and it was fixed in couple of days. It just arrived in f-droid couple of days ago even and works wonders.

5kat3R commented 2 years ago

Hi, I created and font pack with the excellent instructions included in Infinitime to support special characters of Finnish, Swedish and Polish languages. You can download it from here