diff options
Diffstat (limited to 'tools/convbdf.c')
-rw-r--r-- | tools/convbdf.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/tools/convbdf.c b/tools/convbdf.c index 05f2c83209..c85690a2da 100644 --- a/tools/convbdf.c +++ b/tools/convbdf.c | |||
@@ -443,6 +443,7 @@ int bdf_read_header(FILE *fp, struct font* pf) | |||
443 | return 0; | 443 | return 0; |
444 | } | 444 | } |
445 | 445 | ||
446 | fprintf(stderr, "Header parsed\n"); | ||
446 | return 1; | 447 | return 1; |
447 | } | 448 | } |
448 | 449 | ||
@@ -955,6 +956,7 @@ int gen_c_source(struct font* pf, char *path) | |||
955 | " %s /* offset */\n" | 956 | " %s /* offset */\n" |
956 | " %s\n" | 957 | " %s\n" |
957 | " %d, /* defaultchar */\n" | 958 | " %d, /* defaultchar */\n" |
959 | " %d /* bits_size */\n" | ||
958 | "};\n" | 960 | "};\n" |
959 | "#endif /* HAVE_LCD_BITMAP */\n", | 961 | "#endif /* HAVE_LCD_BITMAP */\n", |
960 | pf->maxwidth, pf->height, | 962 | pf->maxwidth, pf->height, |
@@ -963,7 +965,8 @@ int gen_c_source(struct font* pf, char *path) | |||
963 | pf->size, | 965 | pf->size, |
964 | obuf, | 966 | obuf, |
965 | buf, | 967 | buf, |
966 | pf->defaultchar); | 968 | pf->defaultchar, |
969 | pf->bits_size); | ||
967 | 970 | ||
968 | return 0; | 971 | return 0; |
969 | } | 972 | } |
@@ -1071,12 +1074,29 @@ int gen_fnt_file(struct font* pf, char *path) | |||
1071 | ofr += size; | 1074 | ofr += size; |
1072 | } | 1075 | } |
1073 | 1076 | ||
1074 | if (ftell(ofp) & 1) | 1077 | if ( pf->bits_size < 0xFFDB ) |
1075 | writebyte(ofp, 0); /* pad to 16-bit boundary*/ | 1078 | { |
1079 | /* bitmap offset is small enough, use unsigned short for offset */ | ||
1080 | if (ftell(ofp) & 1) | ||
1081 | writebyte(ofp, 0); /* pad to 16-bit boundary*/ | ||
1082 | } | ||
1083 | else | ||
1084 | { | ||
1085 | /* bitmap offset is large then 64K, use unsigned long for offset */ | ||
1086 | while (ftell(ofp) & 3) | ||
1087 | writebyte(ofp, 0); /* pad to 32-bit boundary*/ | ||
1088 | } | ||
1076 | 1089 | ||
1077 | if (pf->offset) | 1090 | if (pf->offset) |
1091 | { | ||
1078 | for (i=0; i<pf->size; ++i) | 1092 | for (i=0; i<pf->size; ++i) |
1079 | writeshort(ofp, pf->offrot[i]); | 1093 | { |
1094 | if ( pf->bits_size < 0xFFDB ) | ||
1095 | writeshort(ofp, pf->offrot[i]); | ||
1096 | else | ||
1097 | writelong(ofp, pf->offrot[i]); | ||
1098 | } | ||
1099 | } | ||
1080 | 1100 | ||
1081 | if (pf->width) | 1101 | if (pf->width) |
1082 | for (i=0; i<pf->size; ++i) | 1102 | for (i=0; i<pf->size; ++i) |