80 unsigned char header [62] = {
97 0xF0, 0xFF, 0xFF, 0xFF,
126 while (fgets (instring,
MAXSTRING - 1, stdin) != NULL) {
128 sscanf (instring,
"%X:%s", &code_point, glyph);
130 glyph_width = strlen (glyph) / (glyph_height / 4);
131 snprintf (filename,
MAXFILENAME,
"U+%06X.bmp", code_point);
132 header [18] = glyph_width;
133 header [22] = -glyph_height;
134 if ((outfp = fopen (filename,
"w")) != NULL) {
135 for (i = 0; i < 62; i++) fputc (header[i], outfp);
143 for (i = 0; i < glyph_height; i++) {
145 sscanf (&glyph[string_index],
"%2X", &nextbyte);
147 fputc (nextbyte, outfp);
148 if (glyph_width <= 8) {
149 fputc (0x00, outfp); fputc (0x00, outfp); fputc (0x00, outfp);
152 sscanf (&glyph[string_index],
"%2X", &nextbyte);
154 fputc (nextbyte, outfp);
155 if (glyph_width <= 16) {
156 fputc (0x00, outfp); fputc (0x00, outfp);
159 sscanf (&glyph[string_index],
"%2X", &nextbyte);
161 fputc (nextbyte, outfp);
162 if (glyph_width <= 24) {
166 sscanf (&glyph[string_index],
"%2X", &nextbyte);
168 fputc (nextbyte, outfp);
int main(void)
The main function.