esp32-sk6812/font/verify.c

46 lines
740 B
C
Raw Normal View History

#include <stdio.h>
#include "font16_data.h"
int main(void)
{
FILE *cfile = fopen("characters16.txt", "r");
if(!cfile) {
printf("Failed to open characters16.txt\n");
return 1;
}
char characters[256];
fgets(characters, 256, cfile);
fclose(cfile);
char *c = characters;
while(*c) {
uint8_t idx = font_lut[(uint8_t)(*c)];
uint16_t char_start = font_pos[idx];
uint16_t char_end = char_start + font_width[idx];
for(uint16_t char_pos = char_start; char_pos < char_end; char_pos++) {
uint16_t char_data = font_data[char_pos];
for(uint8_t y = 0; y < font_height; y++) {
if(char_data & (1 << y)) {
printf("#");
} else {
printf("-");
}
}
printf("\n");
}
printf("\n");
c++;
}
}