-
• #2
Hi! I'm afraid at the moment displaying Korean from iPhone messages doesn't work - for Android we have Gadgetbridge running on the phone which can render the Korean characters on the phone and send them over, but for iOS, Apple sends the notification text direct to the watch (without any app involvement) so we would have to have every Korean character stored on the watch.
However, there has been some work done on this already. Recent Bangle.js firmwares have the ability to handle Unicode and to render those characters from a font file.
I've attached a file which contains over 50,000 characters (it's 2 megabytes, so uses about a quarter of your Bangle's flash!)
When you get your bangle and write code for it, you should be able to upload the font (which takes a while) and do:
g.setFontPBF(require("Storage").read("font.pbf")); g.drawString('\uc548\ub155\ud558\uc138\uc694\u0020\uc138\uc0c1');
And it'll display the korean text on-device.
So then in theory in the
iOS
app it should be possible to convert the raw data from the iPhone to UTF8 withE.asUTF8
and the messages app could instead use the pbf font for rendering.It's a shame it hasn't been all built in yet, but honestly there just hasn't been the demand for it, so it hasn't taken priority over all the other stuff that's being requested!
1 Attachment
-
• #4
The Bangle does have 8MB so 2 isn't the end of the world, but that does contain almost every character you should need for any language.
As far as I could tell there are 3 distinct areas of characters needed for Korean, so it would be possible to create a font that contained just those and would be substantially smaller (maybe 0.5mb?)
The hope was that we'd actually have different apps for different sets of fonts, and then you could install those, and the messages app would just use whatever one was installed.
-
• #5
Is there a software to modify the file, font.pbf to create a particular language set?
Thanks again, Gordon. -
• #6
Yes - the script to create it is: https://github.com/espruino/Espruino/blob/master/libs/graphics/font/fontconverter.js#L607
Right now we only do one full range, but it needs tweaking to be able to include various different ranges for different languages, for example for Korean I think you'd need:
U+AC00 -> U+D7A3 U+1100 -> U+11FF U+3130 -> U+318F U+A960 -> U+A97F U+D7B0 U+D7FF
Probably plus the standard ASCII range as well
However ideally I'd like to pull the script into https://github.com/espruino/EspruinoWebTools/blob/master/fontconverter.js
-
• #8
You could also try to reduce the font to the set of characters you really need to reduce the size. There is an open source app called Fontforge which allows you to modify fonts on a very detailed level.
-
• #10
@Hank I'm afraid Bangle.js's fonts are unlikely to be supported by Fontforge but I've got some solutions that do allow you to strip things down now.
I've just committed a bunch of code in https://github.com/espruino/BangleApps/commit/591c1f8cc5e538f935c82d6dd1c31a48e3e4d822 which should be in the development app loader now.
As a result, @JeonLab if you go to https://espruino.github.io/BangleApps/ and update everything on your Bangle, then install https://espruino.github.io/BangleApps/?id=fontall you should be able to get Korean messages from iOS onto your watch. Same applies for Chinese/Japanese/others too.
As-is all the fonts will be small, but if you update the Bangle.js firmware to cutting edge then you should be able to get the font double-sized where it's possible to fit it in.
It should be possible to (very easily) clone
fontall
intofontkorean
and use the utility to make a new font with just korean symbols in, but until we're sure everything works I'd rather not have too much duplication -
• #12
@Gordon, I got the Bangle and updated the firmware and all the updates for the apps and tried to install the Fonts (all languages), but after it started loading, maybe several seconds later, the browser (Chrome) lost it's connection and the Bangle seems to be frozen with a message that it's uploading. I tried a few times, but no success. On the watch, the BLE and Programmable are enabled. How do I keep its connection for this large file installation?
Thanks. -
• #13
If you clear browser cookies for the App Loader and reload the page, does it work after that?
-
• #15
Two things, do them separately or at the same time. Don't know what's best.
- Bring out the web console (
Ctrl
+shift
+c
). And see what output you get there when trying to upload. - Have another tab open with the Web IDE that is connected to your Bangle. Then again, try upload from the App Loader. See what output you get to the Web IDE console.
- Bring out the web console (
-
• #16
@Ganblejs, I did those two tests you suggested and got the messages at the end that it was disconnected. After that, I had to restart my laptop for other things and I tried to upload it and it worked. I didn't make any changes, but it worked all of a sudden. I don't understand.
Thank you for your help anyway.@Gordon, after installing the Fonts app (2MB), I tested with a short email to myself with a mixed message in English and Korean, but I can only see English.
Any thoughts?Thanks.
-
• #17
Did you manage to do the update ok? I guess it's possible there wasn't enough space on the watch storage or something like that?
And you definitely uploaded from the Development App loader (so the Message UI app is 0.77 and iOS Integration is 0.17)?
-
• #19
Ahh - this one: https://espruino.github.io/BangleApps/
You need the apps at those versions or later, and make sure you hold the button to reload after installing
-
• #21
Please can you try connecting with the Web IDE and pasting in:
require("messages").pushMessage({"t":"add","id":1575479849,"src":"Skype","title":"\uc548\ub155\ud558\uc138\uc694\u0020\uc138\uc0c1","body":"\uc548\ub155\ud558\uc138\uc694\u0020\uc138\uc0c1",positive:1,negative:1})
and see what happens? And you definitely installed the
all languages
font and not the150 languages
one? -
• #22
After pasting the message in the WebIDE and entered, it says "=undefined"
I made sure to install the all languages (2MB).
Oh, wait a second. The bangle shows "Hello World" in Korean!
I won't be able to test it again until tonight. But it's a good sign that it will work with other notifications. I will test it more tonight and update you.
Thank you, @Gordon!!Quick update: It still doesn’t show Korean when the message was sent from my iPhone. So I guess it’s the iOS message processing issue.
-
• #23
Ok, thanks for the info!
That would make sense then - I wasn't able to test out the iOS stuff properly because I only have an old iPad and no other apple devices, and I couldn't find a way of getting notifications on it (Hangouts which I had used previously has been deprecated!).
Please could you use the
Custom Boot Code
app and enter:E.on('notify',msg=>{ require("Storage").open("messages.log","a").write(JSON.stringify(msg)+"\n"); });
then receive some messages with iOS. Then if you disconnect and reconnect with the Web IDE, click the 'Storage' icon (4 disc icon in the middle bar of the screen), scroll right down, and click to download 'messages.log', and upload it here I can try to take a look and see what's up
-
• #24
@Gordon, here is the message.log.
{"event":"add","uid":4,"category":0,"categoryCnt":2,"silent":false,"important":false,"preExisting":false,"positive":false,"negative":true,"appId":"com.google.calendar","title":"\u00EA\u00B0\u009C\u00EA\u00B5\u00B4","subtitle":"","message":"11:20\u00E2\u0080\u00AFAM","messageSize":"10","date":"20240318T112000","posAction":"","negAction":"Clear","new":true}
{"event":"remove","uid":4,"category":0,"categoryCnt":1,"silent":false,"important":false,"preExisting":false}
{"event":"remove","uid":3,"category":0,"categoryCnt":0,"silent":false,"important":false,"preExisting":false} -
• #25
@Gordon, I did some test. After doing your suggested tests above, I sent an email to my gmail with the same title and message in your test pushMessage in the post #21, which is 'Hello World' in Korean, '안녕하세요 세상.' And then I compared the unicode between your test message and received notification sent from my iPhone. Below is the message log after I received the notification.
{"event":"add","uid":5,"category":0,"categoryCnt":5,"silent":false,"important":false,"preExisting":false,"positive":false,"negative":true,"appId":"com.google.Gmail","title":"Jeon, Jinseok","subtitle":"\u00EC\u0095\u0088\u00EB\u0085\u0095\u00ED\u0095\u0098\u00EC\u0084\u00B8\u00EC\u009A\u0094 \u00EC\u0084\u00B8\u00EC\u0083\u0081","message":"\u00EC\u0095\u0088\u00EB\u0085\u0095\u00ED\u0095\u0098\u00EC\u0084\u00B8\u00EC\u009A\u0094 \u00EC\u0084\u00B8\u00EC\u0083\u0081","messageSize":"22","date":"20240318T211844","posAction":"","negAction":"Clear","new":true}
So, the title (and the message) should be '\uc548\ub155\ud558\uc138\uc694\u0020\uc138\uc0c1' but iPhone sends '\u00EC\u0095\u0088\u00EB\u0085\u0095\u00ED\u0095\u0098\u00EC\u0084\u00B8\u00EC\u009A\u0094 \u00EC\u0084\u00B8\u00EC\u0083\u0081' instead.
I checked the unicode for the message '안녕하세요 세상' from the website, https://koreanstudies.com/unicode-converter.html and the unicode in your test code was correct.
So, the apps iOS Integration and/or Message UI seem to interpret the unicode incorrectly at least for Korean.
Hey everyone!
I just ordered a Bangle.js 2 and I'm super excited to start using it and creating my own apps. It has everything I need - a transflective LCD (which is the best feature for me), a GPS, 3 axis accelerometer/magnetometer, a pressure/temp sensor, and it's PROGRAMMABLE! I don't have much experience with JS programming, but I can't wait to learn.
While I wait for my watch to arrive, I have a question. I have an iPhone 14 and I want to receive notifications on the watch. Since I'm Korean, I want to see those messages in Korean. Will it work automatically or do I need to install an app (I couldn't find anything in the App Loader page)?
Thanks!
J