10 #define FN "default_font"
13 main(int argc
, char *argv
[])
19 fprintf(stderr
, "Usage: %s font.mbf\n", argv
[0]);
22 font
= load_font(argv
[1]);
24 fprintf(stderr
, "Failed to load font '%s'.\n", argv
[1]);
28 printf("static Range "FN
"_ranges[%d] = {\n", font
->header
.nr
);
29 for(i
=0; i
<font
->header
.nr
; i
++) {
30 printf(" { %d, %d }%s\n",
31 (int) font
->ranges
[i
].offset
,
32 (int) font
->ranges
[i
].length
,
33 i
+1 == font
->header
.nr
?"":",");
37 printf("static uint8_t "FN
"_data[] = {\n");
38 for (i
= 0; i
< font
->header
.ng
* font
->stride
* font
->header
.h
; i
++) {
44 printf("0x%02x", font
->data
[i
]);
48 printf("Font "FN
"[1] = {{ ");
50 printf("{ %d, %d, %d, %d }, ",
51 (int) font
->header
.ng
,
54 (int) font
->header
.nr
);
56 printf("%d, "FN
"_ranges, "FN
"_data }};\n",