#include #include #include #include #include "cg2.c" int32_t main(int32_t argc, char *argv[]) { (void)argc; (void)argv; for (int32_t glyph = 0; glyph < 256; ++glyph) { int32_t code; if (glyph < 32) { code = 10240 + glyph; } else if (glyph < 127) { code = glyph; } else { code = (10240 + 32) + (glyph - 127); } char name[16]; snprintf(name, sizeof(name), "glyphs/%04x.svg", code); FILE *fh = fopen(name, "w"); assert(fh != NULL); fprintf(fh, "\n"); fprintf(fh, "\n"); for (int32_t row = 0; row < cg_rows; ++row) { int32_t y = row * 256 + 8; int32_t bits = cgtable[cg_rows - 1 - row][glyph]; int32_t mask = 0x01; for (int32_t col = 0; col < 8; ++col) { if ((bits & mask) != 0) { int32_t x = col * 256 + 8; fprintf(fh, " \n", x, y); } mask <<= 1; } } fprintf(fh, "\n"); fclose(fh); } return 0; }