14 virtual bool getLetter(
const char inChar,
byte* outBuffer) = 0;
17 bool getLetter4x4(
const char inChar,
byte* outBuffer,
const byte* fontData,
size_t fontDataSize)
19 const byte* ptr = fontData;
20 const byte* end = fontData + fontDataSize;
21 for (; ptr < end; ptr += 3)
23 if (pgm_read_byte(ptr++) == inChar)
25 for (
byte i = 0; i < 3; i++)
27 outBuffer[i] = pgm_read_byte(ptr++);
33 for (
byte i = 0; i < 3; i++)
35 outBuffer[i] = pgm_read_byte(ptr++);
51 virtual bool getLetter(
const char inChar,
byte* outBuffer) = 0;
54 bool getLetter8x5(
const char inChar,
byte* outBuffer,
const byte* fontData,
size_t fontDataSize)
56 const byte* ptr = fontData;
57 const byte* end = fontData + fontDataSize;
58 for (; ptr < end; ptr += 5)
60 if (pgm_read_byte(ptr++) == inChar)
62 for (
byte i = 0; i < 5; i++)
64 outBuffer[i] = pgm_read_byte(ptr++);
70 for (
byte i = 0; i < 5; i++)
72 outBuffer[i] = pgm_read_byte(ptr++);
88 virtual bool getLetter(
const char inChar,
byte* outBuffer) = 0;
101 virtual bool getLetter(
const char inChar,
byte* outBuffer,
byte &rowBytes,
byte& advance);
104 bool getLetterVar4Pt(
const char inChar,
byte* outBuffer,
byte &rowBytes,
byte& advance,
const byte* fontData,
size_t fontDataSize)
106 const byte* ptr = fontData;
107 const byte* end = fontData + fontDataSize;
110 char ch = pgm_read_byte(ptr++);
111 advance = pgm_read_byte(ptr++);
112 rowBytes = (advance <= 4) ? 1 : 2;
115 byte* dst = outBuffer;
116 for (
byte y = 0; y < 4; y++)
118 for (
byte i = 0; i < rowBytes; i++)
119 *dst++ = pgm_read_byte(ptr++);
148 virtual bool getLetter(
const char inChar,
byte* outBuffer,
byte &rowBytes,
byte& advance)
150 static const byte sData[] PROGMEM =
291 0b11000000, 0b11000000,
292 0b11001100, 0b11000000,
293 0b11101110, 0b11000000,
294 0b00110011, 0b00000000,
392 return getLetterVar4Pt(inChar, outBuffer, rowBytes, advance, sData,
sizeof(sData));
412 virtual bool getLetter(
const char inChar,
byte* outBuffer)
414 static const byte sData[] PROGMEM =
520 return getLetter4x4(inChar, outBuffer, sData,
sizeof(sData));
540 virtual bool getLetter(
const char inChar,
byte* outBuffer)
544 static const byte sData[] PROGMEM =
875 return getLetter8x5(inChar, outBuffer, sData,
sizeof(sData));
895 virtual bool getLetter(
const char inChar,
byte* outBuffer)
899 static const byte sData[] PROGMEM =
1097 return getLetter8x5(inChar, outBuffer, sData,
sizeof(sData));
1122 static const byte sData[128][8] PROGMEM = {
1123 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1124 {0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e},
1125 {0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e},
1126 {0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00},
1127 {0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00},
1128 {0x38, 0x7c, 0x38, 0xfe, 0xfe, 0x7c, 0x38, 0x7c},
1129 {0x10, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x7c},
1130 {0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00},
1131 {0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff},
1132 {0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00},
1133 {0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff},
1134 {0x0f, 0x07, 0x0f, 0x7d, 0xcc, 0xcc, 0xcc, 0x78},
1135 {0x3c, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18},
1136 {0x3f, 0x33, 0x3f, 0x30, 0x30, 0x70, 0xf0, 0xe0},
1137 {0x7f, 0x63, 0x7f, 0x63, 0x63, 0x67, 0xe6, 0xc0},
1138 {0x99, 0x5a, 0x3c, 0xe7, 0xe7, 0x3c, 0x5a, 0x99},
1139 {0x80, 0xe0, 0xf8, 0xfe, 0xf8, 0xe0, 0x80, 0x00},
1140 {0x02, 0x0e, 0x3e, 0xfe, 0x3e, 0x0e, 0x02, 0x00},
1141 {0x18, 0x3c, 0x7e, 0x18, 0x18, 0x7e, 0x3c, 0x18},
1142 {0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00},
1143 {0x7f, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x00},
1144 {0x3e, 0x63, 0x38, 0x6c, 0x6c, 0x38, 0xcc, 0x78},
1145 {0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x00},
1146 {0x18, 0x3c, 0x7e, 0x18, 0x7e, 0x3c, 0x18, 0xff},
1147 {0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x00},
1148 {0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00},
1149 {0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00},
1150 {0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00},
1151 {0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00},
1152 {0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00},
1153 {0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x00, 0x00},
1154 {0x00, 0xff, 0xff, 0x7e, 0x3c, 0x18, 0x00, 0x00},
1155 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1156 {0x30, 0x78, 0x78, 0x30, 0x30, 0x00, 0x30, 0x00},
1157 {0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00},
1158 {0x6c, 0x6c, 0xfe, 0x6c, 0xfe, 0x6c, 0x6c, 0x00},
1159 {0x30, 0x7c, 0xc0, 0x78, 0x0c, 0xf8, 0x30, 0x00},
1160 {0x00, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xc6, 0x00},
1161 {0x38, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0x76, 0x00},
1162 {0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00},
1163 {0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00},
1164 {0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00},
1165 {0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00},
1166 {0x00, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x00, 0x00},
1167 {0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60},
1168 {0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00},
1169 {0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00},
1170 {0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00},
1171 {0x7c, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0x7c, 0x00},
1172 {0x30, 0x70, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x00},
1173 {0x78, 0xcc, 0x0c, 0x38, 0x60, 0xc4, 0xfc, 0x00},
1174 {0x78, 0xcc, 0x0c, 0x38, 0x0c, 0xcc, 0x78, 0x00},
1175 {0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x1e, 0x00},
1176 {0xfc, 0xc0, 0xf8, 0x0c, 0x0c, 0xcc, 0x78, 0x00},
1177 {0x38, 0x60, 0xc0, 0xf8, 0xcc, 0xcc, 0x78, 0x00},
1178 {0xfc, 0xcc, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x00},
1179 {0x78, 0xcc, 0xcc, 0x78, 0xcc, 0xcc, 0x78, 0x00},
1180 {0x78, 0xcc, 0xcc, 0x7c, 0x0c, 0x18, 0x70, 0x00},
1181 {0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00},
1182 {0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0x00},
1183 {0x18, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x18, 0x00},
1184 {0x00, 0x00, 0xfc, 0x00, 0x00, 0xfc, 0x00, 0x00},
1185 {0x60, 0x30, 0x18, 0x0c, 0x18, 0x30, 0x60, 0x00},
1186 {0x78, 0xcc, 0x0c, 0x18, 0x30, 0x00, 0x30, 0x00},
1187 {0x7c, 0xc6, 0xde, 0xde, 0xde, 0xc0, 0x78, 0x00},
1188 {0x30, 0x78, 0xcc, 0xcc, 0xfc, 0xcc, 0xcc, 0x00},
1189 {0xfc, 0x66, 0x66, 0x7c, 0x66, 0x66, 0xfc, 0x00},
1190 {0x3c, 0x66, 0xc0, 0xc0, 0xc0, 0x66, 0x3c, 0x00},
1191 {0xf8, 0x6c, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00},
1192 {0xfe, 0x62, 0x68, 0x78, 0x68, 0x62, 0xfe, 0x00},
1193 {0xfe, 0x62, 0x68, 0x78, 0x68, 0x60, 0xf0, 0x00},
1194 {0x3c, 0x66, 0xc0, 0xc0, 0xce, 0x66, 0x3e, 0x00},
1195 {0xcc, 0xcc, 0xcc, 0xfc, 0xcc, 0xcc, 0xcc, 0x00},
1196 {0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00},
1197 {0x1e, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x78, 0x00},
1198 {0xe6, 0x66, 0x6c, 0x78, 0x6c, 0x66, 0xe6, 0x00},
1199 {0xf0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00},
1200 {0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0x00},
1201 {0xc6, 0xe6, 0xf6, 0xde, 0xce, 0xc6, 0xc6, 0x00},
1202 {0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x00},
1203 {0xfc, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00},
1204 {0x78, 0xcc, 0xcc, 0xcc, 0xdc, 0x78, 0x1c, 0x00},
1205 {0xfc, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0xe6, 0x00},
1206 {0x78, 0xcc, 0xe0, 0x70, 0x1c, 0xcc, 0x78, 0x00},
1207 {0xfc, 0xb4, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00},
1208 {0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xfc, 0x00},
1209 {0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x30, 0x00},
1210 {0xc6, 0xc6, 0xc6, 0xd6, 0xfe, 0xee, 0xc6, 0x00},
1211 {0xc6, 0xc6, 0x6c, 0x38, 0x38, 0x6c, 0xc6, 0x00},
1212 {0xcc, 0xcc, 0xcc, 0x78, 0x30, 0x30, 0x78, 0x00},
1213 {0xfe, 0xc6, 0x8c, 0x18, 0x32, 0x66, 0xfe, 0x00},
1214 {0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x00},
1215 {0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x02, 0x00},
1216 {0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00},
1217 {0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00},
1218 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff},
1219 {0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00},
1220 {0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0x76, 0x00},
1221 {0xe0, 0x60, 0x60, 0x7c, 0x66, 0x66, 0xdc, 0x00},
1222 {0x00, 0x00, 0x78, 0xcc, 0xc0, 0xcc, 0x78, 0x00},
1223 {0x1c, 0x0c, 0x0c, 0x7c, 0xcc, 0xcc, 0x76, 0x00},
1224 {0x00, 0x00, 0x78, 0xcc, 0xfc, 0xc0, 0x78, 0x00},
1225 {0x38, 0x6c, 0x60, 0xf0, 0x60, 0x60, 0xf0, 0x00},
1226 {0x00, 0x00, 0x76, 0xcc, 0xcc, 0x7c, 0x0c, 0xf8},
1227 {0xe0, 0x60, 0x6c, 0x76, 0x66, 0x66, 0xe6, 0x00},
1228 {0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00},
1229 {0x0c, 0x00, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x78},
1230 {0xe0, 0x60, 0x66, 0x6c, 0x78, 0x6c, 0xe6, 0x00},
1231 {0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00},
1232 {0x00, 0x00, 0xcc, 0xfe, 0xfe, 0xd6, 0xc6, 0x00},
1233 {0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xcc, 0xcc, 0x00},
1234 {0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0x78, 0x00},
1235 {0x00, 0x00, 0xdc, 0x66, 0x66, 0x7c, 0x60, 0xf0},
1236 {0x00, 0x00, 0x76, 0xcc, 0xcc, 0x7c, 0x0c, 0x1e},
1237 {0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0xf0, 0x00},
1238 {0x00, 0x00, 0x7c, 0xc0, 0x78, 0x0c, 0xf8, 0x00},
1239 {0x10, 0x30, 0x7c, 0x30, 0x30, 0x34, 0x18, 0x00},
1240 {0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00},
1241 {0x00, 0x00, 0xcc, 0xcc, 0xcc, 0x78, 0x30, 0x00},
1242 {0x00, 0x00, 0xc6, 0xd6, 0xfe, 0xfe, 0x6c, 0x00},
1243 {0x00, 0x00, 0xc6, 0x6c, 0x38, 0x6c, 0xc6, 0x00},
1244 {0x00, 0x00, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xf8},
1245 {0x00, 0x00, 0xfc, 0x98, 0x30, 0x64, 0xfc, 0x00},
1246 {0x1c, 0x30, 0x30, 0xe0, 0x30, 0x30, 0x1c, 0x00},
1247 {0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00},
1248 {0xe0, 0x30, 0x30, 0x1c, 0x30, 0x30, 0xe0, 0x00},
1249 {0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1250 {0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0x00}
1252 if (
unsigned(inChar) >= 128)
1254 for (
byte i = 0; i < 8; i++)
1258 const byte* ptr = &sData[unsigned(inChar)][0];
1259 for (
byte i = 0; i < 8; i++)
1260 outBuffer[i] = pgm_read_byte(ptr++);