1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-19 14:25:11 +03:00

BOLD FONT

added Bold font definitions
MIXER: active mix weight is BOLDed instead of source, because we now have no international Bold definitions.
Bolded numbers are wider than before, but it seems it can fit.
This commit is contained in:
mhotar 2014-01-06 22:15:08 +01:00
parent bddfa3938a
commit 4a6acab3c9
8 changed files with 48 additions and 27 deletions

View file

@ -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, 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, 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, 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,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 636 B

After

Width:  |  Height:  |  Size: 623 B

Before After
Before After

View file

@ -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,

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

View file

@ -3559,9 +3559,9 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
if (mixCnt > 0) lcd_putsiAtt(FW, y, STR_VMLTPX2, md->mltpx, 0); 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 #if LCD_W >= 212
displayFlightModes(EXPO_LINE_FM_POS, y, md->phases); displayFlightModes(EXPO_LINE_FM_POS, y, md->phases);

View file

@ -113,10 +113,14 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
inv = true; inv = true;
} }
if (flags & DBLSIZE) {
// To save space only some DBLSIZE chars are available
// c has to be remapped. All non existing chars mapped to 0 (space)
unsigned char c_remapped; unsigned char c_remapped;
#if defined(BOLD_FONT) && !defined(CPUM64) || defined(EXTSTD)
if (flags & (DBLSIZE+BOLD)) {
#else
if (flags & DBLSIZE) {
#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)
if (c>=',' && c<=':') if (c>=',' && c<=':')
c_remapped = c - ',' + 1; 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; c_remapped = c - 'a' + 42;
else if (c=='_') else if (c=='_')
c_remapped = 4; c_remapped = 4;
#if defined(BOLD_FONT) && !defined(CPUM64) || defined(EXTSTD)
else if (c==' ')
c_remapped = 0;
else if (flags & BOLD)
flags &= ~BOLD;
#endif
#if defined(CPUARM) #if defined(CPUARM)
else if (c>= 128) else if ((c>= 128) && (flags & DBLSIZE))
c_remapped = c - 60; c_remapped = c - 60;
#endif #endif
else else
c_remapped = 0; c_remapped = 0;
#if defined(BOLD_FONT) && !defined(CPUM64) || defined(EXTSTD)
}
if (flags & DBLSIZE) {
#endif
/* each letter consists of ten top bytes followed by /* each letter consists of ten top bytes followed by
* by ten bottom bytes (20 bytes per * char) */ * by ten bottom bytes (20 bytes per * char) */
q = &font_10x14[((uint16_t)c_remapped)*20]; 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 { else {
uint8_t ym8 = (y & 0x07); uint8_t ym8 = (y & 0x07);
#if defined(BOLD_FONT) #if defined(BOLD_FONT) && defined(CPUM64) && !defined(EXTSTD)
#if !defined(CPUM64) || defined(EXTSTD)
uint8_t skipcol = 7;
if ( c >= 'A') skipcol = 4;
if ( c == 'T') skipcol = 5;
#endif
uint8_t bb = 0; uint8_t bb = 0;
if (inv) bb = 0xff; if (inv) bb = 0xff;
#endif
#if !defined(CPUM64) || defined(EXTSTD)
for (int8_t i=0; i<=7; i++) {
#else #else
for (int8_t i=0; i<=6; i++) { if (flags & BOLD) {
q = &font_5x7_B[(c_remapped)*5];
}
#endif #endif
for (int8_t i=0; i<=6; i++) {
uint8_t b = 0; uint8_t b = 0;
if ( !i ) { if ( !i ) {
if ( !x || !inv || (flags & BOLD)) { if ( !x || !inv ) {
lcdNextPos++; lcdNextPos++;
p++; p++;
continue; continue;
@ -292,15 +302,12 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
else continue; else continue;
} }
if (inv) b = ~b; if (inv) b = ~b;
#if !defined(CPUM64) || defined(EXTSTD)
if (!(flags & BOLD) && (i == 7)) continue;
#endif
if ((flags & CONDENSED) && i==2) { if ((flags & CONDENSED) && i==2) {
/*condense the letter by skipping column 3 */ /*condense the letter by skipping column 3 */
continue; continue;
} }
#if defined(BOLD_FONT) #if defined(BOLD_FONT) && defined(CPUM64) && !defined(EXTSTD)
if (flags & BOLD) { if (flags & BOLD) {
uint8_t a; uint8_t a;
if (inv) if (inv)
@ -309,9 +316,6 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
a = b | bb; a = b | bb;
bb = b; bb = b;
b = a; b = a;
#if !defined(CPUM64) || defined(EXTSTD)
if (i == skipcol) continue;
#endif
} }
#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) if (mode > 0)
x += 2; x += 2;
} }
#if defined(BOLD_FONT) && !defined(CPUM64) || defined(EXTSTD)
///////////////////////////////////////////////////////////////////
if (flags & BOLD) fw += 1;
#endif
} }
if (flags & LEFT) { if (flags & LEFT) {
@ -566,6 +574,10 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t
#endif #endif
val = qr.quot; val = qr.quot;
x-=fw; x-=fw;
#if defined(BOLD_FONT) && !defined(CPUM64) || defined(EXTSTD)
////////////////////////////////////////////////////////////
if (i==len && (flags & BOLD)) x += 1;
#endif
} }
if (xn) { 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); lcd_hline(xn, y+2*FH-2, ln);
} }
} }
x--;
if (neg) lcd_putcAtt(x, y, '-', flags); if (neg) lcd_putcAtt(x, y, '-', flags);
} }

View file

@ -586,6 +586,12 @@ const pm_uchar font_5x7[] PROGMEM = {
#endif #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 = { const pm_uchar font_10x14[] PROGMEM = {
#include "font_10x14_compressed.lbm" #include "font_10x14_compressed.lbm"
#if defined(CPUARM) #if defined(CPUARM)

View file

@ -536,6 +536,9 @@ extern const pm_char STR_RESET_BTN[];
extern const pm_uchar font_5x7[]; extern const pm_uchar font_5x7[];
extern const pm_uchar font_10x14[]; extern const pm_uchar font_10x14[];
#if !defined(CPUM64) || defined(EXTSTD)
extern const pm_uchar font_5x7_B[];
#endif
#if defined(CPUARM) #if defined(CPUARM)
extern const pm_uchar font_3x5[]; extern const pm_uchar font_3x5[];