[Horus] CZ font

This commit is contained in:
Bertrand Songis
2016-09-01 18:54:21 +02:00
parent 9639be152d
commit bf43aa839e
18 changed files with 32 additions and 31 deletions
-9
View File
@@ -382,15 +382,6 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t l
break;
}
else if (c >= 0x20) {
#if defined(TRANSLATIONS_FR)
if (c >= 0x80 && c <= 0x85) {
c = 0x20 + 115 + c - 0x80;
}
#elif defined(TRANSLATIONS_DE)
if (c >= 0x80 && c <= 0x86) {
c = 0x20 + 120 + c - 0x80;
}
#endif
uint8_t width;
if (fontcache)
width = drawCharWithCache(x-1, y, fontcache, fontspecs, getMappedChar(c), flags);
+22 -12
View File
@@ -26,36 +26,46 @@
display_t displayBuf[DISPLAY_BUFFER_SIZE];
#endif
uint16_t lcdColorTable[LCD_COLOR_COUNT];
coord_t lcdNextPos;
#define FONT_CHARS_COUNT 103
char getMappedChar(unsigned char c)
uint8_t getMappedChar(uint8_t c)
{
uint8_t result;
if (c == 0)
return 0;
else if (c >= 0x80 && c <= 0x85)
return 115 + c - 0x80;
result = 0;
#if defined(TRANSLATIONS_FR)
else if (c >= 0x80 && c <= 0x85) {
result = 115 + c - 0x80;
}
#elif defined(TRANSLATIONS_DE)
else if (c >= 0x80 && c <= 0x86) {
result = 120 + c - 0x80;
}
#elif defined(TRANSLATIONS_CZ)
else if (c >= 0x80 && c < 0x80+30) {
result = 127 + c - 0x80;
}
#endif
else if (c < 0xC0)
return c - 0x20;
result = c - 0x20;
else
return c - 0xC0 + 96;
result = c - 0xC0 + 96;
// TRACE("getMappedChar '%c' (%d) = %d", c, c, result);
return result;
}
int getFontPatternWidth(const uint16_t * spec, int index)
int getFontPatternWidth(const uint16_t * spec, uint8_t index)
{
return spec[index+1] - spec[index];
}
int getCharWidth(char c, const uint16_t * spec)
int getCharWidth(uint8_t c, const uint16_t * spec)
{
return getFontPatternWidth(spec, getMappedChar(c));
}
#define FONT_MAX_HEIGHT 42
void lcdPutFontPattern(coord_t x, coord_t y, const uint8_t * font, const uint16_t * spec, int index, LcdFlags flags)
{
coord_t offset = spec[index];
+2 -2
View File
@@ -235,9 +235,9 @@ inline int getBitmapHeight(const uint8_t * bmp)
return *(((const uint16_t *)bmp)+1);
}
char getMappedChar(unsigned char c);
uint8_t getMappedChar(uint8_t c);
uint8_t getFontHeight(LcdFlags flags);
int getTextWidth(const pm_char *s, int len=0, LcdFlags flags=0);
int getTextWidth(const char * s, int len=0, LcdFlags flags=0);
inline void lcdDrawBitmapPattern(coord_t x, coord_t y, const uint8_t * img, LcdFlags flags=0, coord_t offset=0, coord_t width=0)
{