diff --git a/firmware/application/ui/ui_geomap.hpp b/firmware/application/ui/ui_geomap.hpp index 028cd2e4..297c28d8 100644 --- a/firmware/application/ui/ui_geomap.hpp +++ b/firmware/application/ui/ui_geomap.hpp @@ -84,8 +84,8 @@ class GeoPos : public View { Labels labels_position{ {{1 * 8, 0 * 16}, "Alt:", Color::light_grey()}, - {{1 * 8, 1 * 16}, "Lat: \x90 ' \"", Color::light_grey()}, // 0x90 is degree ° symbol in our 8x16 font - {{1 * 8, 2 * 16}, "Lon: \x90 ' \"", Color::light_grey()}, + {{1 * 8, 1 * 16}, "Lat: \xB0 ' \"", Color::light_grey()}, // 0xB0 is degree ° symbol in our 8x16 font + {{1 * 8, 2 * 16}, "Lon: \xB0 ' \"", Color::light_grey()}, }; NumberField field_altitude{ diff --git a/firmware/common/ui_text.cpp b/firmware/common/ui_text.cpp index 0bac1641..77428f52 100644 --- a/firmware/common/ui_text.cpp +++ b/firmware/common/ui_text.cpp @@ -24,11 +24,26 @@ namespace ui { Glyph Font::glyph(const char c) const { + size_t index; + if (c < c_start) { + // Non-display C0 Control characters - map to blank (index 0) return {w, h, data}; } - const size_t index = c - c_start; - if (index >= c_count) { + + // Handle gap in glyphs table for C1 Control characters 0x80-0x9F + if (c < C1_CONTROL_CHARS_START) { + // ASCII chars <0x80: + index = c - c_start; + } else if (c >= C1_CONTROL_CHARS_START + C1_CONTROL_CHARS_COUNT) { + // Latin 1 chars 0xA0-0xFF + index = c - c_start - C1_CONTROL_CHARS_COUNT; + } else { + // C1 Control characters - map to blank + return {w, h, data}; + } + + if (index >= c_count) { // Latin Extended characters > 0xFF - not supported return {w, h, data}; } else { return {w, h, &data[index * data_stride]}; diff --git a/firmware/common/ui_text.hpp b/firmware/common/ui_text.hpp index cdf31b09..123da536 100644 --- a/firmware/common/ui_text.hpp +++ b/firmware/common/ui_text.hpp @@ -28,6 +28,10 @@ #include "ui.hpp" +// C1 Control Characters are an unprintable range of glyphs missing from the font files +#define C1_CONTROL_CHARS_START 0x80 +#define C1_CONTROL_CHARS_COUNT 32 + namespace ui { class Glyph {