Polish characters in Messages

Posted on
  • Hi,

    just got Bangle.js. It's great.
    Only drawback for me is lack of polish characters in bangle.
    There is "ó" but other polish characters i.e. "ąężźść" are missing.
    Is there easy solution for that.

  • Hi - the problem is that there's not enough space to store anything like the full unicode character set, so we stick with the standard 'ISO Latin' 8 bit codepage: http://www.espruino.com/Fonts#character-­sets

    So... if it's your own app, you could use something like the Font Converter at http://www.espruino.com/Font+Converter to make your own font with a different codepage like Mazovia and then convert your text? You'd have to modify the font converter to do that though.

    Where exactly are you hitting problems though? With the on-device app translations, or when you receive messages from Android/iOS?

    There are some other ways of fixing this - especially with Gadgetbridge the plan is to eventually render characters that aren't part of the normal ISO Latin character set into bitmaps and then send the bitmaps over.

  • My main concern are iOS notifications. I don't use app translations.
    I get the memory problem. But maybe in the future there is a chance to set and download font for language of my choice or at least to convert polish characters to standard Iso Latin e.g. ę --> e.

    Because sometimes text is hard to understand with all the missing characters. Message containing "Zażółć" will show only "Zaó" on Bangle.

  • Just curious - is there any sort of timeline on when the 'sending bitmaps' solution might be ready?

  • @DavSlinker not really I'm afraid, on Gadgetbridge the code is basically already there - I hope that when the custom version is in the play store, features will get added more quickly

    @user142091 ok, well that's easier in some ways since in iOS we can't render in the phone.

    There's a list of unicode remappings at https://github.com/espruino/BangleApps/b­lob/master/apps/ios/boot.js#L116 which is currently very empty.

    You could either:

    • simply remap the unicode for ż to z, OR...
    • make an image for ż on your PC, use https://www.espruino.com/Image+Converter­ to convert it to an image string, add \0 to the front of it, and use that.
    • One other option (which isn't handled yet) is for me to allow drawString to write one character over the top of the last. So for instance z and ' could be rendered on top of each other to produce something that looked at least a little like ż without having to include a bitmap font.

    The replacements are something I'd love to get in, so if I can help with that I'd be very happy to. I guess the first option is pretty easy and would (for now) at least make messages readable?

  • @Gordon thank you for detailed answer! I will look into it. I am not js expert, so I need some time to digest things but I will try :).

  • Ok, I've done remaping in iOS integration app. Now I want to explore second option.
    But I am not sure what do you mean by:

    make an image for ż on your PC, use https://www.espruino.com/Image+Converter­ to convert >it to an image string, add \0 to the front of it, and use that.

    After conversion to string, where should I use it in code?

  • That's great! Please feel free to send in whatever changes you have and I'll pull them into the main app.

    For the image, suppose you put ż into the image converter (best to tick transparency + invert + crop) and got var img = E.toArrayBuffer(atob("BwsBEAAD4MEEECCB8A­=="))

    "ż".charCodeAt() gives you 380

    So then you'd put in:

    var unicodeRemap = {
    380:"\0"+atob("BwsBEAAD4MEEECCB8A==")
    };
    

    And that should hopefully do it for you :)

    I should add that right now the character will be rendered in the image's size regardless of the size of the font. I've been considering changing Espruino so that if you provide an image it'll scale it up until it matches the current font size though - so I think that would be a big help

  • @Gordon If you ever need characters to test or to "hard code," let me know. I can discuss the essential characters in all the European languages, including those in Cyrillic, although I'm guessing that would be going a bit beyond.

  • Thanks, I think I will stick with maping as using images makes it look weird with different font sizes. But when this update with scaling comes I will happily get back to it and help with the code.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Polish characters in Messages

Posted by Avatar for user142091 @user142091

Actions