Problem with some characters

Hi guys,

do you know about some issues some devices have (or had) with displaying degree ([SUP]o[/SUP]) characters?

- I am using Gfx.FONT_LARGE to display latitude and longitude.
- To get coordinates, I call Location.toGeoString(format), and split it in half (maybe it is not the best idea, but it worked well during testing)

So basically I should have latitude and longitude as strings ready to be drawn. But:

- in simulator, FR920XT does not render the text at all; if I change the text from lat/long to "A"/"B" it gets rendered
- in simulator, all other devices render lat/long perfectly
- on real Fenix3, everything is rendered perfectly
- some users of vivoactive, FR920XT and Epix report that it works well
- one user of vivoactive reports that lat/long is not rendered, and sent me screenshots to prove that

So it seems that some version or configuration of vivoactive, and simulator of 920xt have problem with rendering degree character. The issue of this particular user may be caused by his firmware version, or the fact he seems to be in China, so either the watch uses different codepages internally, or the coordinates are somehow different from my tested scenarios. If the issue occurs, it does not render any replacement character like <?>, but does not render the whole text at all...

Do someone have some info about this?

Thanks,
David
  • It's been a while since I looked at this, but the weirdness does seem to involve the "degrees" symbol. IIRC, the 920 doesn't support it at all.

    And there were actually two different values for it, and the one returned by toGeoString() is problematic in some cases based on device and font used. (like I said, it's been months since I looked at this, and things can vary based on device and FW versions too, IIRC, so this may be outdated) Appendix B of the UX guide in the SDK talks about about devices, fonts, and what's supported

    For degree I use:
    var degree="°"; //utf-8, b0 hex, 176 dec

    and build my own strings using that for GEO_DEG (based on +/- you can get n/s or e/w easily, and can use less than 6 decimal places if you want, or leave off the degree symbol if it's too much of a pain). Build your own strings as it's easy and will be more flexible.

    Also, one other thing I recall is GEO_MGRS works in the simulator for the vivoactive, but on the real device it's always zeros.

    Sonething else - If you do a "Sys.println()" on the string in the sim, you'll see there where the degree symbol looks correct and where it doesn't. I think that's where I first saw they were different.
  • var degree="°"; //utf-8, b0 hex, 176 dec


    Hi jim,

    thanks for your input. So you have settled on using the quoted character and have a positive response that it works well in text fonts on various devices, as opposed to a different character returned by API toGeoString? Are you just replacing / parsing what is returned by toGeoString, or you rather use toDegrees and calculate / format by yourself?

    Thanks again,
    David
  • I reported this last year (see this post), but it doesn't seem that any changes have been made to fix the problem. I think your best bet is to either use a different font (according to my report, it worked for a few of them) or to use some other format. An easy solution would be to strip out the degree symbol on the 920xt.

    Travis
  • There are actually quite a few characters that look like degree symbol:
    https://en.wikipedia.org/wiki/Degree_symbol

    I still have quite inconsistent results for these symbols, between various device simulators and devices. Sometimes question mark char is shown instead, sometimes the text containing the character is not shown at all. It also seems that every device implements toGeoString() method differently, and there may be even differences in what character is used in result, and it can also return character which cannot be shown on the device... or something like that.

    So I ended doing the DDMMSS conversion by myself. I hardcoded the ALT+0176 (°) character in the code, and (important tip) saved the code file in UTF-8 instead of CP-1250 or what is the default on Windows :-). By doing so, simulators for all devices can show the symbol, including 920XT. I am not sure about the devices - but Fenix 3 is fine...
  • Interesting info if you come into the same issue:

    User who reported problem to me on vivoactive (from China or somewhere around :-)) who cannot see coordinates which I get by using toGeoString can see the coordinates easily when I use hardcoded degree symbol, saved in a code file in UTF-8, instead.

    So it seems to me it is not inability of a device to show the character, it may be just that the character really needs to be encoded in unicode.