You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
46 lines
1.2 KiB
2 years ago
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
|
struct X {
|
||
|
uint8_t data[5];
|
||
|
};
|
||
|
|
||
|
const struct X font[] = {
|
||
|
{{0xFE, 0x82, 0x82, 0x82, 0xFE}},
|
||
|
{{0x22, 0x14, 0x08, 0x14, 0x22}},
|
||
|
{{0x08, 0x04, 0x3e, 0x04, 0x08}},
|
||
|
{{0x08, 0x10, 0x3e, 0x10, 0x08}},
|
||
|
{{0x08, 0x1c, 0x2a, 0x08, 0x08}},
|
||
|
{{0x08, 0x08, 0x2a, 0x1c, 0x08}},
|
||
|
{{0x1c, 0x22, 0x2e, 0x2a, 0x1c}},
|
||
|
{{0x63, 0x55, 0x4d, 0x55, 0x63}},
|
||
|
{{0x1c, 0x22, 0x2a, 0x22, 0x1c}},
|
||
|
{{0x10, 0x38, 0x54, 0x10, 0x1e}},
|
||
|
{{0x60, 0x9e, 0x81, 0x9e, 0x6a}},
|
||
|
{{0x00, 0x07, 0x05, 0x07, 0x00}},
|
||
|
{{0x7C, 0x20, 0x20, 0x10, 0x3C}},
|
||
|
{{0x04, 0x4e, 0x55, 0x44, 0x38}},
|
||
|
{{0x7f, 0x3e, 0x1c, 0x08, 0x00}},
|
||
|
{{0x00, 0x08, 0x1c, 0x3e, 0x7f}},
|
||
|
};
|
||
|
|
||
|
void main() {
|
||
|
printf("const char* symbols[] = {\n");
|
||
|
for(int c = 0; c < sizeof(font)/sizeof(font[0]); c++) {
|
||
|
printf(" // Extra %d\n", c, c);
|
||
|
for(int j=0;j<7;j++){
|
||
|
printf(" \"");
|
||
|
for(int k=0;k<5;k++){
|
||
|
if (font[c].data[k]& (1<<j)) {
|
||
|
printf("#");
|
||
|
} else {
|
||
|
printf(" ");
|
||
|
}
|
||
|
}
|
||
|
printf("\",\n");
|
||
|
}
|
||
|
}
|
||
|
printf("};\n");
|
||
|
}
|