From d2aa7116d21637fcc0804a545426906f50f48b7e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 9 Sep 2002 14:42:27 +0000 Subject: support -v for verbose (debug) output git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2240 a1c6a512-1295-4272-9138-f99709370657 --- tools/bdf2ajf.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'tools') diff --git a/tools/bdf2ajf.c b/tools/bdf2ajf.c index 6733f00..4d47c5a 100644 --- a/tools/bdf2ajf.c +++ b/tools/bdf2ajf.c @@ -66,14 +66,15 @@ void write_short(unsigned short s, unsigned char* buf) void usage() { - printf("bdf2ajf - compile BDF font for use with Rockbox\n"); - printf("Usage: bdf2ajf -f -o \n"); - printf("Options:\n"); - printf(" -f - input BDF file\n"); - printf(" -o - output AJF file\n"); - printf(" -h - print help\n"); - printf(" -t - print string as bitmap\n"); - printf(" -t2 - print string as Archos bitmap (must be the same result as -t)\n"); + printf("bdf2ajf - compile BDF font for use with Rockbox\n" + "Usage: bdf2ajf -f -o \n" + "Options:\n" + " -f - input BDF file\n" + " -o - output AJF file\n" + " -v - verbose debug output\n" + " -h - print help\n" + " -t - print string as bitmap\n" + " -t2 - print string as Archos bitmap (must be the same result as -t)\n"); exit(0); } @@ -81,6 +82,8 @@ void usage() int do_test1 = 0; int do_test2 = 0; +int verbose; + int main(int argc, char** argv) { FILE *outfd = 0; @@ -113,6 +116,11 @@ int main(int argc, char** argv) if (i==argc) usage(); strcpy(out_file, argv[i]); } + else if (!strcmp(argv[i], "-v")) + { + i++; + verbose = 1; + } else if (!strcmp(argv[i], "-t")) { i++; @@ -229,6 +237,13 @@ void writeAJF(BDF* bdf, const char* out_file) { bmp_bytes = rows*glyph->dwidth_x; getBitmap(glyph, &outbuf[idx]); + if(verbose) { + int i; + printf("char %c (%02x) width %d\n", c, c, glyph->dwidth_x); + for(i=0; i< bmp_bytes;i++) + printf("%02x, ", outbuf[idx+i]); + printf("\n"); + } } else { -- cgit v1.1