/* * Load an rbf font, store in incore format and display - or - * Read an incore font and display it. * * If FONT defined, just link in FONT and display it * otherwise, load av[1] and display it * * Copyright (c) 2002 by Greg Haerr */ #include /* this should go in a library...*/ #define DEBUGF printf #include "../firmware/loadfont.c" #ifdef FONT extern MWCFONT FONT; PMWCFONT pf = &FONT; #endif /* printf display an incore font*/ void dispfont(PMWCFONT pf) { int i; printf("Font: '%s' %dx%d ", pf->name, pf->maxwidth, pf->height); printf("0x%02x-0x%02x (size %d)\n", pf->firstchar, pf->firstchar+pf->size, pf->size); printf("\tDefault char 0x%02x ", pf->defaultchar); printf("(%s width)\n", pf->width? "proportional": "fixed"); for (i=0; isize; ++i) { int width = pf->width ? pf->width[i] : pf->maxwidth; int height = pf->height; int x; int bitcount = 0; MWIMAGEBITS *bits = pf->bits + (pf->offset? pf->offset[i]: (height * i)); MWIMAGEBITS bitvalue; printf("\nCharacter 0x%02x (width %d)\n", i+pf->firstchar, width); printf("+"); for (x=0; x 0) { if (x == 0) printf("|"); if (bitcount <= 0) { bitcount = MWIMAGE_BITSPERIMAGE; bitvalue = *bits++; } printf( MWIMAGE_TESTBIT(bitvalue)? "*": " "); bitvalue = MWIMAGE_SHIFTBIT(bitvalue); --bitcount; if (++x == width) { printf("|\n"); --height; x = 0; bitcount = 0; } } printf("+"); for (x=0; x