/** PSP helper library ***************************************/ /** **/ /** genfont.c **/ /** **/ /** This file contains a simple font converter. It converts **/ /** 'fd' format fonts (by Simon Tatham) into array **/ /** used by the font rendering library **/ /** **/ /** Copyright (C) Akop Karapetyan 2007 **/ /** You are not allowed to distribute this software **/ /** commercially. Please, notify me, if you make any **/ /** changes to this file. **/ /*************************************************************/ #include int main(int argc, char* argv) { char line[256]; int widths[256]; int i,j,c; int ascent = 0; int height = 0; int ascii = 0; int chars = 0; scanf("height %i\n", &height); scanf("ascent %i\n", &ascent); printf("unsigned short _ch[][%i] = {\n", height); while (!feof(stdin)) { if (scanf("\nchar %d\n", &ascii) < 1 || chars > 255) break; scanf("width %d\n", &widths[chars]); printf(" { "); for (i=0;i=0;j--) if (line[j]=='1') c|=1<<(widths[chars]-j-1); printf("0x%04x%s", c, (i