From b0fee17d6e1a463dcd84568e5997663b69488998 Mon Sep 17 00:00:00 2001 From: Marcoen Hirschberg Date: Tue, 6 Dec 2005 13:27:15 +0000 Subject: waiting is over: initial unicode commit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8169 a1c6a512-1295-4272-9138-f99709370657 --- tools/convbdf.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'tools/convbdf.c') 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) return 0; } + fprintf(stderr, "Header parsed\n"); return 1; } @@ -955,6 +956,7 @@ int gen_c_source(struct font* pf, char *path) " %s /* offset */\n" " %s\n" " %d, /* defaultchar */\n" + " %d /* bits_size */\n" "};\n" "#endif /* HAVE_LCD_BITMAP */\n", pf->maxwidth, pf->height, @@ -963,7 +965,8 @@ int gen_c_source(struct font* pf, char *path) pf->size, obuf, buf, - pf->defaultchar); + pf->defaultchar, + pf->bits_size); return 0; } @@ -1071,12 +1074,29 @@ int gen_fnt_file(struct font* pf, char *path) ofr += size; } - if (ftell(ofp) & 1) - writebyte(ofp, 0); /* pad to 16-bit boundary*/ + if ( pf->bits_size < 0xFFDB ) + { + /* bitmap offset is small enough, use unsigned short for offset */ + if (ftell(ofp) & 1) + writebyte(ofp, 0); /* pad to 16-bit boundary*/ + } + else + { + /* bitmap offset is large then 64K, use unsigned long for offset */ + while (ftell(ofp) & 3) + writebyte(ofp, 0); /* pad to 32-bit boundary*/ + } if (pf->offset) + { for (i=0; isize; ++i) - writeshort(ofp, pf->offrot[i]); + { + if ( pf->bits_size < 0xFFDB ) + writeshort(ofp, pf->offrot[i]); + else + writelong(ofp, pf->offrot[i]); + } + } if (pf->width) for (i=0; isize; ++i) -- cgit v1.2.3