diff --git a/radio/src/fonts/std/font_05x07.lbm b/radio/src/fonts/std/font_05x07.lbm index 51377730e..d370d9101 100644 --- a/radio/src/fonts/std/font_05x07.lbm +++ b/radio/src/fonts/std/font_05x07.lbm @@ -1,4 +1,4 @@ -0x00,0x00,0xff,0xff,0xff,0xff,0xff,0x6f,0xff,0xff,0xff,0x07,0x00,0x07,0xff,0x18,0x30,0x18,0x0c,0x06,0x08,0x7f,0x7f,0x7f,0x08,0x23,0x13,0x08,0x64,0x62,0x36,0x49,0x55,0x22,0x50,0xff,0x05,0x03,0xff,0xff,0xff,0x1c,0x22,0x41,0xff,0xff,0x41,0x22,0x1c,0xff,0x14,0x08,0x3e,0x08,0x14,0x08,0x08,0x3e,0x08,0x08,0xff,0x50,0x30,0xff,0xff,0x00,0x08,0x08,0x08,0x08,0xff,0xff,0x40,0xff,0xff,0x20,0x10,0x08,0x04,0x02, +0x00,0x00,0xff,0xff,0xff,0xff,0xff,0x6f,0xff,0xff,0xff,0x07,0x00,0x07,0xff,0x18,0x30,0x18,0x0c,0x06,0x08,0x7f,0x7f,0x7f,0x08,0x23,0x13,0x08,0x64,0x62,0x36,0x49,0x55,0x22,0x50,0xff,0x05,0x03,0xff,0xff,0xff,0x1c,0x22,0x41,0xff,0xff,0x41,0x22,0x1c,0xff,0x14,0x08,0x3e,0x08,0x14,0x08,0x08,0x3e,0x08,0x08,0xff,0x50,0x30,0xff,0xff,0x00,0x08,0x08,0x08,0xff,0xff,0xff,0x40,0xff,0xff,0x20,0x10,0x08,0x04,0x02, 0x3e,0x41,0x41,0x3e,0xff,0x00,0x42,0x7f,0x40,0xff,0x62,0x51,0x49,0x46,0xff,0x41,0x49,0x49,0x36,0xff,0x18,0x14,0x12,0x7f,0xff,0x27,0x45,0x45,0x39,0xff,0x3e,0x49,0x49,0x32,0xff,0x01,0x79,0x05,0x03,0xff,0x36,0x49,0x49,0x36,0xff,0x06,0x49,0x29,0x1e,0xff,0xff,0x36,0x36,0xff,0xff,0xff,0x56,0x36,0xff,0xff,0xff,0x08,0x14,0x22,0x41,0x14,0x14,0x14,0x14,0x14,0x41,0x22,0x14,0x08,0xff,0x02,0x01,0x51,0x09,0x06, 0x06,0x09,0x09,0x06,0xff,0x7e,0x09,0x09,0x09,0x7e,0x7f,0x49,0x49,0x49,0x36,0x3e,0x41,0x41,0x41,0x22,0x7f,0x41,0x41,0x22,0x1c,0x7f,0x49,0x49,0x49,0x41,0x7f,0x09,0x09,0x09,0x01,0x3e,0x41,0x49,0x49,0x7a,0x7f,0x08,0x08,0x08,0x7f,0xff,0x41,0x7f,0x41,0xff,0x20,0x40,0x41,0x3f,0x01,0x7f,0x08,0x14,0x22,0x41,0x7f,0x40,0x40,0x40,0xff,0x7f,0x02,0x0c,0x02,0x7f,0x7f,0x04,0x08,0x10,0x7f,0x3e,0x41,0x41,0x41,0x3e, 0x7f,0x09,0x09,0x09,0x06,0x3e,0x41,0x51,0x21,0x5e,0x7f,0x09,0x19,0x29,0x46,0x26,0x49,0x49,0x49,0x32,0x01,0x01,0x7f,0x01,0x01,0x3f,0x40,0x40,0x40,0x3f,0x1f,0x20,0x40,0x20,0x1f,0x3f,0x40,0x30,0x40,0x3f,0x63,0x14,0x08,0x14,0x63,0x07,0x08,0x70,0x08,0x07,0x61,0x51,0x49,0x45,0x43,0x7f,0x41,0x41,0x00,0xff,0x02,0x04,0x08,0x10,0x20,0x00,0x41,0x41,0x7f,0xff,0x04,0x02,0x01,0x02,0x04,0x40,0x40,0x40,0x40,0xff, diff --git a/radio/src/fonts/std/font_05x07.png b/radio/src/fonts/std/font_05x07.png index 4922f3cfd..9f7dfaf4b 100644 Binary files a/radio/src/fonts/std/font_05x07.png and b/radio/src/fonts/std/font_05x07.png differ diff --git a/radio/src/fonts/std/font_05x07_B_compressed.lbm b/radio/src/fonts/std/font_05x07_B_compressed.lbm new file mode 100644 index 000000000..6c9ed49db --- /dev/null +++ b/radio/src/fonts/std/font_05x07_B_compressed.lbm @@ -0,0 +1 @@ +0x00,0x00,0x00,0xff,0xff,0xff,0x80,0xe0,0x60,0xff,0x00,0x18,0x18,0x18,0xff,0xff,0x60,0x60,0xff,0xff,0x60,0x60,0x60,0x60,0xff,0x3e,0x7f,0x41,0x7f,0x3e,0x00,0x42,0x7f,0x7f,0x40,0x62,0x73,0x59,0x4f,0x46,0x41,0x49,0x7f,0x7f,0x36,0x18,0x1c,0x12,0x7f,0x7f,0x27,0x67,0x45,0x7d,0x39,0x3e,0x7f,0x49,0x7b,0x32,0x01,0x79,0x7d,0x07,0x03,0x36,0x7f,0x49,0x7f,0x36,0x06,0x4f,0x69,0x3f,0x1e,0xff,0x36,0x36,0xff,0xff,0x7e,0x7f,0x09,0x7f,0x7e,0x7f,0x7f,0x49,0x7f,0x36,0x3e,0x7f,0x41,0x77,0x36,0x7f,0x7f,0x41,0x3e,0x1c,0x7f,0x7f,0x49,0x49,0x41,0x7f,0x7f,0x09,0x09,0x01,0x3e,0x7f,0x41,0x59,0x7a,0x7f,0x7f,0x08,0x7f,0x7f,0x41,0x7f,0x7f,0x41,0xff,0x30,0x70,0x41,0x7f,0x3f,0x7f,0x7f,0x14,0x63,0x41,0x7f,0x7f,0x40,0x40,0xff,0x7f,0x07,0x1e,0x07,0x7f,0x7f,0x7f,0x0c,0x18,0x7f,0x3e,0x7f,0x41,0x7f,0x3e,0x7f,0x7f,0x09,0x0f,0x06,0x3e,0x7f,0x41,0x2f,0x5e,0x7f,0x7f,0x19,0x6f,0x46,0x26,0x4f,0x5d,0x79,0x32,0x01,0x7f,0x7f,0x01,0xff,0x3f,0x7f,0x60,0x7f,0x3f,0x1f,0x3f,0x60,0x3f,0x1f,0x3f,0x70,0x38,0x70,0x3f,0x63,0x77,0x1c,0x77,0x63,0x07,0x1f,0x78,0x1f,0x07,0x71,0x79,0x5d,0x4f,0x47,0x20,0x74,0x54,0x7c,0x78,0x7f,0x7f,0x44,0x7c,0x38,0x38,0x7c,0x44,0x44,0x20,0x38,0x7c,0x44,0x7f,0x7f,0x38,0x7c,0x54,0x5c,0x18,0x08,0x7e,0x7f,0x09,0x02,0x0c,0x5e,0x52,0x7e,0x3e,0x7f,0x7f,0x04,0x7c,0x78,0x44,0x7d,0x7d,0x40,0xff,0x30,0x70,0x44,0x7d,0x3d,0x7f,0x7f,0x28,0x44,0xff,0x41,0x7f,0x7f,0x40,0xff,0x7c,0x1c,0x38,0x1c,0x78,0x7c,0x78,0x0c,0x7c,0x78,0x38,0x7c,0x44,0x7c,0x38,0x7c,0x7c,0x24,0x3c,0x18,0x18,0x3c,0x24,0x7c,0x7c,0x7c,0x78,0x0c,0x1c,0x18,0x48,0x5c,0x7c,0x74,0x20,0x04,0x3f,0x7f,0x44,0x20,0x3c,0x7c,0x60,0x3c,0x7c,0x1c,0x3c,0x60,0x3c,0x1c,0x3c,0x70,0x38,0x70,0x3c,0x44,0x6c,0x38,0x6c,0x44,0x0c,0x5c,0x50,0x7c,0x3c,0x44,0x64,0x74,0x5c,0x4c, diff --git a/radio/src/fonts/std/font_05x07_B_compressed.png b/radio/src/fonts/std/font_05x07_B_compressed.png new file mode 100644 index 000000000..41b21c72c Binary files /dev/null and b/radio/src/fonts/std/font_05x07_B_compressed.png differ diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index 7cbcd3d84..5dab9a585 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -3559,9 +3559,9 @@ void menuModelExpoMix(uint8_t expo, uint8_t event) if (mixCnt > 0) lcd_putsiAtt(FW, y, STR_VMLTPX2, md->mltpx, 0); - putsMixerSource(MIX_LINE_SRC_POS, y, md->srcRaw, isMixActive(i) ? BOLD : 0); + putsMixerSource(MIX_LINE_SRC_POS, y, md->srcRaw, 0); - gvarWeightItem(MIX_LINE_WEIGHT_POS, y, md, attr, event); + gvarWeightItem(MIX_LINE_WEIGHT_POS, y, md, attr | (isMixActive(i) ? BOLD : 0), event); #if LCD_W >= 212 displayFlightModes(EXPO_LINE_FM_POS, y, md->phases); diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index 723dce392..1b5973f49 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -113,10 +113,14 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags) inv = true; } + unsigned char c_remapped; +#if defined(BOLD_FONT) && !defined(CPUM64) || defined(EXTSTD) + if (flags & (DBLSIZE+BOLD)) { +#else if (flags & DBLSIZE) { - // To save space only some DBLSIZE chars are available +#endif + // To save space only some DBLSIZE and BOLD chars are available // c has to be remapped. All non existing chars mapped to 0 (space) - unsigned char c_remapped; if (c>=',' && c<=':') c_remapped = c - ',' + 1; @@ -126,13 +130,24 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags) c_remapped = c - 'a' + 42; else if (c=='_') c_remapped = 4; -#if defined(CPUARM) - else if (c>= 128) +#if defined(BOLD_FONT) && !defined(CPUM64) || defined(EXTSTD) + else if (c==' ') + c_remapped = 0; + else if (flags & BOLD) + flags &= ~BOLD; +#endif +#if defined(CPUARM) + else if ((c>= 128) && (flags & DBLSIZE)) c_remapped = c - 60; -#endif +#endif else c_remapped = 0; +#if defined(BOLD_FONT) && !defined(CPUM64) || defined(EXTSTD) + } + if (flags & DBLSIZE) { +#endif + /* each letter consists of ten top bytes followed by * by ten bottom bytes (20 bytes per * char) */ q = &font_10x14[((uint16_t)c_remapped)*20]; @@ -264,23 +279,18 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags) else { uint8_t ym8 = (y & 0x07); -#if defined(BOLD_FONT) -#if !defined(CPUM64) || defined(EXTSTD) - uint8_t skipcol = 7; - if ( c >= 'A') skipcol = 4; - if ( c == 'T') skipcol = 5; -#endif +#if defined(BOLD_FONT) && defined(CPUM64) && !defined(EXTSTD) uint8_t bb = 0; if (inv) bb = 0xff; -#endif -#if !defined(CPUM64) || defined(EXTSTD) - for (int8_t i=0; i<=7; i++) { #else - for (int8_t i=0; i<=6; i++) { + if (flags & BOLD) { + q = &font_5x7_B[(c_remapped)*5]; + } #endif + for (int8_t i=0; i<=6; i++) { uint8_t b = 0; if ( !i ) { - if ( !x || !inv || (flags & BOLD)) { + if ( !x || !inv ) { lcdNextPos++; p++; continue; @@ -292,15 +302,12 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags) else continue; } if (inv) b = ~b; -#if !defined(CPUM64) || defined(EXTSTD) - if (!(flags & BOLD) && (i == 7)) continue; -#endif if ((flags & CONDENSED) && i==2) { /*condense the letter by skipping column 3 */ continue; } -#if defined(BOLD_FONT) +#if defined(BOLD_FONT) && defined(CPUM64) && !defined(EXTSTD) if (flags & BOLD) { uint8_t a; if (inv) @@ -309,9 +316,6 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags) a = b | bb; bb = b; b = a; -#if !defined(CPUM64) || defined(EXTSTD) - if (i == skipcol) continue; -#endif } #endif @@ -509,6 +513,10 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t if (mode > 0) x += 2; } +#if defined(BOLD_FONT) && !defined(CPUM64) || defined(EXTSTD) +/////////////////////////////////////////////////////////////////// + if (flags & BOLD) fw += 1; +#endif } if (flags & LEFT) { @@ -566,6 +574,10 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t #endif val = qr.quot; x-=fw; +#if defined(BOLD_FONT) && !defined(CPUM64) || defined(EXTSTD) +//////////////////////////////////////////////////////////// + if (i==len && (flags & BOLD)) x += 1; +#endif } if (xn) { @@ -583,7 +595,6 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t lcd_hline(xn, y+2*FH-2, ln); } } - x--; if (neg) lcd_putcAtt(x, y, '-', flags); } diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 98d62ab7b..cce2952aa 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -586,6 +586,12 @@ const pm_uchar font_5x7[] PROGMEM = { #endif }; +#if !defined(CPUM64) || defined(EXTSTD) +const pm_uchar font_5x7_B[] PROGMEM = { +#include "font_05x07_B_compressed.lbm" +}; +#endif + const pm_uchar font_10x14[] PROGMEM = { #include "font_10x14_compressed.lbm" #if defined(CPUARM) diff --git a/radio/src/translations.h b/radio/src/translations.h index 4a3e0600a..1b27dacb9 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -536,6 +536,9 @@ extern const pm_char STR_RESET_BTN[]; extern const pm_uchar font_5x7[]; extern const pm_uchar font_10x14[]; +#if !defined(CPUM64) || defined(EXTSTD) +extern const pm_uchar font_5x7_B[]; +#endif #if defined(CPUARM) extern const pm_uchar font_3x5[];