diff --git a/radio/src/fonts/480x272/font_dblsize.png b/radio/src/fonts/480x272/font_dblsize.png index 2d304a4dd..806a75e63 100644 Binary files a/radio/src/fonts/480x272/font_dblsize.png and b/radio/src/fonts/480x272/font_dblsize.png differ diff --git a/radio/src/fonts/480x272/font_dblsize.specs b/radio/src/fonts/480x272/font_dblsize.specs index d6fa34d4a..70c4b83e1 100644 --- a/radio/src/fonts/480x272/font_dblsize.specs +++ b/radio/src/fonts/480x272/font_dblsize.specs @@ -1 +1 @@ -0,4,14,28,54,76,110,139,146,160,173,193,217,228,242,251,266,289,310,331,352,375,397,420,441,464,487,497,508,532,556,580,598,613,641,665,689,715,736,757,783,808,818,832,859,880,910,935,963,987,1015,1040,1062,1087,1112,1140,1178,1206,1234,1258,1272,1287,1300,1324,1343,1356,1378,1401,1420,1443,1466,1484,1507,1529,1539,1553,1576,1586,1618,1640,1663,1686,1709,1726,1746,1764,1786,1810,1841,1865,1889,1909,1933,1940,1964,1992,2019,2037,2055,2078,2101,2124,2147,2175,2175,2175,2175,2175,2175,2175,2175,2175,2175,2175,2175,2175,2198,2221,2243,2258,2277,2305,2327,2355,2378,2403,2425,2448 \ No newline at end of file +0,4,14,28,54,76,110,139,146,160,173,193,217,228,242,251,266,289,310,331,352,375,397,420,441,464,487,497,508,532,556,580,598,613,641,665,689,715,736,757,783,808,818,832,859,880,910,935,963,987,1015,1040,1062,1087,1112,1140,1178,1206,1234,1258,1272,1287,1300,1324,1343,1356,1378,1401,1420,1443,1466,1484,1507,1529,1539,1553,1576,1586,1618,1640,1663,1686,1709,1726,1746,1764,1786,1810,1841,1865,1889,1909,1933,1940,1964,1992,2019,2037,2055,2078,2101,2124,2147,2175,2175,2175,2175,2175,2175,2175,2175,2175,2175,2175,2175,2175,2198,2221,2243,2258,2277,2305,2327,2355,2378,2403,2425,2448,2471,2491,2510,2527,2547,2571,2593,2607,2630,2652,2675,2697,2719,2750,2770,2791,2813,2837,2862,2886,2914,2942,2955,2976,3001,3029,3054,3079,3105,3130 \ No newline at end of file diff --git a/radio/src/fonts/480x272/font_midsize.png b/radio/src/fonts/480x272/font_midsize.png index 3db409b8c..027c17fae 100644 Binary files a/radio/src/fonts/480x272/font_midsize.png and b/radio/src/fonts/480x272/font_midsize.png differ diff --git a/radio/src/fonts/480x272/font_midsize.specs b/radio/src/fonts/480x272/font_midsize.specs index 9eae1a16d..ff0cd1c2b 100644 --- a/radio/src/fonts/480x272/font_midsize.specs +++ b/radio/src/fonts/480x272/font_midsize.specs @@ -1 +1 @@ -0,4,10,20,41,56,80,100,106,115,125,140,159,167,177,184,196,212,227,242,258,274,290,306,322,338,354,361,369,388,407,426,440,451,471,487,505,524,539,553,572,589,595,605,623,638,658,675,695,710,730,747,763,782,799,819,845,864,883,901,910,922,931,950,967,976,991,1006,1020,1036,1052,1064,1080,1095,1101,1110,1125,1131,1154,1169,1185,1200,1216,1227,1241,1253,1268,1285,1306,1323,1340,1354,1373,1379,1398,1419,1440,1455,1470,1487,1504,1521,1538,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1576,1592,1607,1618,1632,1652,1667,1687,1703,1720,1735,1751 \ No newline at end of file +0,4,10,20,41,56,80,100,106,115,125,140,159,167,177,184,196,212,227,242,258,274,290,306,322,338,354,361,369,388,407,426,440,451,471,487,505,524,539,553,572,589,595,605,623,638,658,675,695,710,730,747,763,782,799,819,845,864,883,901,910,922,931,950,967,976,991,1006,1020,1036,1052,1064,1080,1095,1101,1110,1125,1131,1154,1169,1185,1200,1216,1227,1241,1253,1268,1285,1306,1323,1340,1354,1373,1379,1398,1419,1440,1455,1470,1487,1504,1521,1538,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1576,1592,1607,1618,1632,1652,1667,1687,1703,1720,1735,1751,1767,1781,1795,1806,1820,1837,1852,1861,1877,1892,1908,1923,1938,1958,1971,1986,2002,2020,2037,2055,2074,2094,2102,2117,2134,2154,2171,2188,2207,2226 \ No newline at end of file diff --git a/radio/src/fonts/480x272/font_smlsize.png b/radio/src/fonts/480x272/font_smlsize.png index fba75017a..67d7d1d10 100644 Binary files a/radio/src/fonts/480x272/font_smlsize.png and b/radio/src/fonts/480x272/font_smlsize.png differ diff --git a/radio/src/fonts/480x272/font_smlsize.specs b/radio/src/fonts/480x272/font_smlsize.specs index e5877b65a..33a44c893 100644 --- a/radio/src/fonts/480x272/font_smlsize.specs +++ b/radio/src/fonts/480x272/font_smlsize.specs @@ -1 +1 @@ -0,4,9,15,26,35,48,59,63,69,74,82,93,97,103,107,113,122,131,139,148,157,166,175,184,193,202,206,210,221,232,243,250,257,267,276,286,297,306,314,324,334,338,342,352,361,372,382,393,402,413,423,432,441,451,461,475,485,494,504,509,515,520,531,539,545,553,562,570,579,588,594,603,612,616,620,629,633,646,655,664,673,682,689,697,703,712,721,733,742,751,759,770,774,785,797,809,819,829,840,851,862,873,884,884,884,884,884,884,884,884,884,884,884,884,884,893,902,910,916,924,934,942,953,962,972,981,990 \ No newline at end of file +0,4,9,15,26,35,48,59,63,69,74,82,93,97,103,107,113,122,131,139,148,157,166,175,184,193,202,206,210,221,232,243,250,257,267,276,286,297,306,314,324,334,338,342,352,361,372,382,393,402,413,423,432,441,451,461,475,485,494,504,509,515,520,531,539,545,553,562,570,579,588,594,603,612,616,620,629,633,646,655,664,673,682,689,697,703,712,721,733,742,751,759,770,774,785,797,809,819,829,840,851,862,873,884,884,884,884,884,884,884,884,884,884,884,884,884,893,902,910,916,924,934,942,953,962,972,981,990,999,1007,1015,1022,1030,1039,1047,1053,1062,1071,1080,1089,1098,1109,1116,1125,1134,1144,1154,1164,1173,1183,1188,1197,1207,1218,1228,1238,1249,1258 \ No newline at end of file diff --git a/radio/src/fonts/480x272/font_stdsize.png b/radio/src/fonts/480x272/font_stdsize.png index 9ae57eb63..044b1ef16 100644 Binary files a/radio/src/fonts/480x272/font_stdsize.png and b/radio/src/fonts/480x272/font_stdsize.png differ diff --git a/radio/src/fonts/480x272/font_stdsize.specs b/radio/src/fonts/480x272/font_stdsize.specs index 091aa1eda..64358052c 100644 --- a/radio/src/fonts/480x272/font_stdsize.specs +++ b/radio/src/fonts/480x272/font_stdsize.specs @@ -1 +1 @@ -0,4,9,16,30,40,56,69,73,79,85,94,107,112,118,123,130,141,151,161,171,182,192,203,213,224,235,240,245,258,271,284,293,301,313,324,336,349,360,370,383,395,400,405,417,427,441,453,466,477,490,502,513,524,536,548,565,577,588,600,606,613,619,632,642,649,659,670,679,689,699,706,716,726,730,734,745,749,765,775,785,796,806,814,823,830,840,850,864,874,884,893,906,911,924,938,952,964,976,989,1002,1015,1028,1042,1057,1072,1087,1102,1117,1132,1147,1162,1177,1192,1207,1222,1232,1242,1252,1258,1267,1279,1289,1302,1312,1324,1334,1345 \ No newline at end of file +0,4,9,16,30,40,56,69,73,79,85,94,107,112,118,123,130,141,151,161,171,182,192,203,213,224,235,240,245,258,271,284,293,301,313,324,336,349,360,370,383,395,400,405,417,427,441,453,466,477,490,502,513,524,536,548,565,577,588,600,606,613,619,632,642,649,659,670,679,689,699,706,716,726,730,734,745,749,765,775,785,796,806,814,823,830,840,850,864,874,884,893,906,911,924,938,952,964,976,989,1002,1015,1028,1042,1057,1072,1087,1102,1117,1132,1147,1162,1177,1192,1207,1222,1232,1242,1252,1258,1267,1279,1289,1302,1312,1324,1334,1345,1355,1364,1373,1381,1390,1400,1410,1416,1426,1436,1446,1456,1466,1479,1486,1497,1508,1520,1532,1544,1555,1567,1572,1583,1595,1608,1620,1632,1645,1656 \ No newline at end of file diff --git a/radio/src/fonts/480x272/font_stdsizebold.png b/radio/src/fonts/480x272/font_stdsizebold.png index 4e2e37cd9..7fdd14a67 100644 Binary files a/radio/src/fonts/480x272/font_stdsizebold.png and b/radio/src/fonts/480x272/font_stdsizebold.png differ diff --git a/radio/src/fonts/480x272/font_stdsizebold.specs b/radio/src/fonts/480x272/font_stdsizebold.specs index e2007dede..0fab80877 100644 --- a/radio/src/fonts/480x272/font_stdsizebold.specs +++ b/radio/src/fonts/480x272/font_stdsizebold.specs @@ -1 +1 @@ -0,4,11,19,33,45,62,77,82,90,97,107,120,126,133,139,146,158,170,181,192,204,216,228,239,251,263,269,275,288,301,314,324,332,346,359,371,385,396,407,420,433,439,445,459,470,486,499,513,526,540,553,565,577,590,604,623,637,650,662,670,677,684,697,706,713,724,736,746,758,770,779,791,803,809,815,827,833,850,862,874,886,898,907,917,926,938,950,966,978,990,1000,1013,1018,1031,1045,1059,1071,1083,1096,1109,1122,1135,1149,1164,1179,1194,1209,1224,1239,1254,1269,1284,1299,1314,1329,1341,1353,1364,1371,1381,1395,1406,1420,1432,1445,1457,1469 \ No newline at end of file +0,4,11,19,33,45,62,77,82,90,97,107,120,126,133,139,146,158,170,181,192,204,216,228,239,251,263,269,275,288,301,314,324,332,346,359,371,385,396,407,420,433,439,445,459,470,486,499,513,526,540,553,565,577,590,604,623,637,650,662,670,677,684,697,706,713,724,736,746,758,770,779,791,803,809,815,827,833,850,862,874,886,898,907,917,926,938,950,966,978,990,1000,1013,1018,1031,1045,1059,1071,1083,1096,1109,1122,1135,1149,1164,1179,1194,1209,1224,1239,1254,1269,1284,1299,1314,1329,1341,1353,1364,1371,1381,1395,1406,1420,1432,1445,1457,1469,1481,1491,1501,1510,1520,1532,1543,1551,1563,1575,1587,1599,1611,1626,1635,1646,1658,1670,1683,1695,1708,1722,1729,1740,1753,1767,1780,1793,1807,1819 \ No newline at end of file diff --git a/radio/src/fonts/480x272/font_tinsize.png b/radio/src/fonts/480x272/font_tinsize.png index 7af221123..eeed3f9ce 100644 Binary files a/radio/src/fonts/480x272/font_tinsize.png and b/radio/src/fonts/480x272/font_tinsize.png differ diff --git a/radio/src/fonts/480x272/font_tinsize.specs b/radio/src/fonts/480x272/font_tinsize.specs index 1d38c9281..700e59da3 100644 --- a/radio/src/fonts/480x272/font_tinsize.specs +++ b/radio/src/fonts/480x272/font_tinsize.specs @@ -1 +1 @@ -0,4,8,13,21,27,37,45,48,52,56,62,70,73,77,80,85,92,98,104,110,117,123,130,136,143,150,153,156,164,172,180,186,191,199,206,213,221,228,234,242,249,252,255,263,269,277,284,292,299,307,314,321,328,335,343,353,360,367,374,378,383,387,395,401,405,411,418,424,430,437,442,448,454,457,460,467,470,479,485,492,499,505,510,516,521,527,534,542,549,556,562,570,573,581,590,599,606,613,621,629,637,645,653,653,653,653,653,653,653,653,653,653,653,653,653,660,667,673,677,683,691,697,705,712,719,725,732 \ No newline at end of file +0,4,8,13,21,27,37,45,48,52,56,62,70,73,77,80,85,92,98,104,110,117,123,130,136,143,150,153,156,164,172,180,186,191,199,206,213,221,228,234,242,249,252,255,263,269,277,284,292,299,307,314,321,328,335,343,353,360,367,374,378,383,387,395,401,405,411,418,424,430,437,442,448,454,457,460,467,470,479,485,492,499,505,510,516,521,527,534,542,549,556,562,570,573,581,590,599,606,613,621,629,637,645,653,653,653,653,653,653,653,653,653,653,653,653,653,660,667,673,677,683,691,697,705,712,719,725,732,739,745,751,756,762,769,775,779,786,792,799,805,811,819,824,831,838,845,852,859,866,874,878,885,892,900,907,914,922,929 \ No newline at end of file diff --git a/radio/src/fonts/480x272/font_xxlsize.png b/radio/src/fonts/480x272/font_xxlsize.png index 80377fa70..00b5ad9c4 100644 Binary files a/radio/src/fonts/480x272/font_xxlsize.png and b/radio/src/fonts/480x272/font_xxlsize.png differ diff --git a/radio/src/fonts/480x272/font_xxlsize.specs b/radio/src/fonts/480x272/font_xxlsize.specs index cd50e8e66..33bc5d758 100644 --- a/radio/src/fonts/480x272/font_xxlsize.specs +++ b/radio/src/fonts/480x272/font_xxlsize.specs @@ -1 +1 @@ -0,4,12,29,66,93,137,173,181,195,210,235,269,280,296,305,325,353,378,404,431,460,487,515,542,570,598,607,618,652,686,720,743,762,798,827,859,893,920,944,979,1010,1019,1035,1067,1093,1129,1160,1197,1224,1261,1292,1320,1354,1384,1420,1468,1502,1536,1568,1582,1602,1616,1650,1679,1695,1722,1749,1774,1802,1830,1850,1878,1904,1912,1925,1952,1960,2002,2028,2056,2083,2111,2130,2154,2174,2200,2229,2268,2297,2326,2351,2385,2393,2427,2466,2505,2530,2555,2586,2617,2648,2679,2719,2719,2719,2719,2719,2719,2719,2719,2719,2719,2719,2719,2719,2747,2775,2802,2821,2846,2882,2909,2946,2974,3004,3030,3058 \ No newline at end of file +0,4,12,29,66,93,137,173,181,195,210,235,269,280,296,305,325,353,378,404,431,460,487,515,542,570,598,607,618,652,686,720,743,762,798,827,859,893,920,944,979,1010,1019,1035,1067,1093,1129,1160,1197,1224,1261,1292,1320,1354,1384,1420,1468,1502,1536,1568,1582,1602,1616,1650,1679,1695,1722,1749,1774,1802,1830,1850,1878,1904,1912,1925,1952,1960,2002,2028,2056,2083,2111,2130,2154,2174,2200,2229,2268,2297,2326,2351,2385,2393,2427,2466,2505,2530,2555,2586,2617,2648,2679,2719,2719,2719,2719,2719,2719,2719,2719,2719,2719,2719,2719,2719,2747,2775,2802,2821,2846,2882,2909,2946,2974,3004,3030,3058,3086,3110,3135,3155,3180,3209,3236,3251,3279,3305,3333,3359,3385,3421,3441,3468,3496,3528,3559,3591,3625,3661,3674,3701,3732,3769,3799,3829,3863,3897 \ No newline at end of file diff --git a/radio/src/gui/480x272/bitmapbuffer.cpp b/radio/src/gui/480x272/bitmapbuffer.cpp index 81207a429..d7c26ea0a 100644 --- a/radio/src/gui/480x272/bitmapbuffer.cpp +++ b/radio/src/gui/480x272/bitmapbuffer.cpp @@ -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); diff --git a/radio/src/gui/480x272/lcd.cpp b/radio/src/gui/480x272/lcd.cpp index 9851e153c..3f82dd4eb 100644 --- a/radio/src/gui/480x272/lcd.cpp +++ b/radio/src/gui/480x272/lcd.cpp @@ -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]; diff --git a/radio/src/gui/480x272/lcd.h b/radio/src/gui/480x272/lcd.h index 0315856ee..e1b441edb 100644 --- a/radio/src/gui/480x272/lcd.h +++ b/radio/src/gui/480x272/lcd.h @@ -236,9 +236,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) { diff --git a/radio/src/translations/CMakeLists.txt b/radio/src/translations/CMakeLists.txt index 9f2aafb9d..79f5aa15e 100644 --- a/radio/src/translations/CMakeLists.txt +++ b/radio/src/translations/CMakeLists.txt @@ -3,6 +3,9 @@ foreach(translation ${translations}) get_filename_component(language ${translation} NAME_WE) get_filename_component(path ${translation} DIRECTORY) set(target ${language}.h) + if(NOT(PCB STREQUAL HORUS) AND language STREQUAL "cz") + set(language cz_reduced) + endif() add_custom_command( OUTPUT ${target} COMMAND python ${RADIO_DIRECTORY}/util/translate.py ${translation} ${target} ${language} @@ -11,4 +14,4 @@ foreach(translation ${translations}) list(APPEND translations_files ${target}) endforeach() -add_custom_target(firmware_translations DEPENDS ${translations_files}) \ No newline at end of file +add_custom_target(firmware_translations DEPENDS ${translations_files}) diff --git a/radio/util/font2png.py b/radio/util/font2png.py index ed6d2d7db..7ba435ce2 100755 --- a/radio/util/font2png.py +++ b/radio/util/font2png.py @@ -13,11 +13,12 @@ for f in glob.glob("fonts/*.ttf"): chars_en = u""" !"#$%&'()*+,-./0123456789:;<=>?°ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz~|≥→←↑↓↗↘↙↖△""" chars_fr = u"""éèàîç""" chars_de = u"""ÄäÖöÜüß""" +chars_cz = u"""ěščřžýáíéňóůúďťĚŠČŘŽÝÁÍÉŇÓÚŮĎŤ""" COUNT_EXTRA_CHARS = 12 chars_extra = u"".join([chr(1+i) for i in range(COUNT_EXTRA_CHARS)]) -chars = chars_en + chars_extra + chars_fr + chars_de +chars = chars_en + chars_extra + chars_fr + chars_de + chars_cz def createFontBitmap(filename, fontname, fontsize, fontbold, foreground, background, coordsfile=True): diff --git a/radio/util/translate.py b/radio/util/translate.py index 908e8be4f..9eb037423 100755 --- a/radio/util/translate.py +++ b/radio/util/translate.py @@ -6,7 +6,7 @@ import argparse import codecs import sys -translations = {'cz': [('\\200', u'á'), +translations = {'cz_reduced': [('\\200', u'á'), ('\\201', u'č'), ('\\201', u'Č'), ('\\202', u'é'), @@ -28,6 +28,37 @@ translations = {'cz': [('\\200', u'á'), ('\\217', u'Ž'), ('\\220', u'É')], + 'cz': [('\\200', u'ě'), + ('\\201', u'š'), + ('\\202', u'č'), + ('\\203', u'ř'), + ('\\204', u'ž'), + ('\\205', u'ý'), + ('\\206', u'á'), + ('\\207', u'í'), + ('\\210', u'é'), + ('\\211', u'ň'), + ('\\212', u'ó'), + ('\\213', u'ů'), + ('\\214', u'ú'), + ('\\215', u'ď'), + ('\\216', u'ť'), + ('\\217', u'Ě'), + ('\\220', u'Š'), + ('\\221', u'Č'), + ('\\222', u'Ř'), + ('\\223', u'Ž'), + ('\\224', u'Ý'), + ('\\225', u'Á'), + ('\\226', u'Í'), + ('\\227', u'É'), + ('\\230', u'Ň'), + ('\\231', u'Ó'), + ('\\232', u'Ú'), + ('\\233', u'Ů'), + ('\\234', u'Ď'), + ('\\235', u'Ť')], + 'de': [('\\200', u'Ä'), ('\\201', u'ä'), ('\\202', u'Ö'),