SatDump icon indicating copy to clipboard operation
SatDump copied to clipboard

Projection: Custom labels don't support UTF-8

Open jpjonte opened this issue 3 years ago • 8 comments

Hi,

I just tried adding "Lübeck" as a custom map label and discovered that the ü isn't rendered properly. As far as I can tell, this is a limitation of CImg.

jpjonte avatar Nov 13 '21 14:11 jpjonte

Hi! Indeed, as of now everything is done as ASCII.. I guess UTF-8 support would probably be a good thing to consider, but may perhaps require some more work around CImg to get it working.

Aang23 avatar Nov 17 '21 10:11 Aang23

Update : Since the image / text handling is now custom, this will be easier to implement.

Aang23 avatar Jan 05 '22 15:01 Aang23

currently labels aren't implemented anymore but we will work on them. they will include utf-8 support

ZbychuButItWasTaken avatar Sep 16 '22 13:09 ZbychuButItWasTaken

This issue was not forgotten btw, it just turned out to be something more complicated, as we will have to implement a font engine to the image lib. However we will probably use imgui's impl, so it shouldn't take long!

ZbychuButItWasTaken avatar Feb 24 '23 16:02 ZbychuButItWasTaken

ImGui supports UTF-8 natively but the issue is the font atlas gets quite big when adding CJK stuff and it causes issues on older devices with a lower texture size limitation (especially common on Android, even for mid-range devices).

AlexandreRouma avatar Feb 24 '23 16:02 AlexandreRouma

yes I know it does, but our image lib (which is what the whole issue is about) doesn't.. (For now we used a pre-renderd font image which obviously is not optimal. We are gonna switch to rendering the font from a ttf)

We use imgui with some custom glyph ranges to help with performance and it seems to work quite well (yes we run into issues on android lol)

ZbychuButItWasTaken avatar Feb 24 '23 16:02 ZbychuButItWasTaken

Even on some slightly older laptops this was killing the font... Either way, in this case it's for rendering to images internally so a while different story.

Another reason it took so long to get to this is simply a certain rewrite.

Aang23 avatar Feb 24 '23 18:02 Aang23

Appreciate the insight. Font rendering can be a bitch.

jpjonte avatar Feb 24 '23 21:02 jpjonte