X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fexample%2Fdumpfont.c;h=1481ed6e6c0d17c182a72463c44dff816bab9e2b;hb=b3ae7bccfb9f4ed16e26631fee072fa011f9847e;hp=986f8531c036b1dc600e1244f8560f0c9d7d92ad;hpb=e028a6ae98c3b02bb56fab55d6bbe93905329ed5;p=swftools.git diff --git a/lib/example/dumpfont.c b/lib/example/dumpfont.c index 986f853..1481ed6 100644 --- a/lib/example/dumpfont.c +++ b/lib/example/dumpfont.c @@ -25,7 +25,7 @@ #include #include "../rfxswf.h" -#define PRINTABLE(a) ((a>='A')&&(a<='Z'))||((a>='a')&&(a<='z'))||((a>='0')&&(a<='9')) +#define PRINTABLE(a) (((a>0x20)&&(a<0xff)&&(a!='\\'))?a:0x20) SWF swf; @@ -68,13 +68,13 @@ void DumpFont(SWFFONT * f,char * name) printf(" f->glyph = (SWFGLYPH*)malloc(sizeof(SWFGLYPH)*%d);\n",f->numchars); printf(" f->glyph2ascii = (U16*)malloc(sizeof(U16)*%d);\n",f->numchars); printf(" f->ascii2glyph = (int*)malloc(sizeof(int)*%d);\n",f->maxascii); - printf(" memset(f->ascii2glyph, -1, sizeof(int)*%d)\n\n", f->maxascii); + printf(" memset(f->ascii2glyph, -1, sizeof(int)*%d);\n\n", f->maxascii); for (i=0;inumchars;i++) if (f->glyph[i].shape) { printf(" addGlyph(f,%3i, 0x%02x,%4i, &Glyphs_%s[0x%04x],%4i); // %c\n", i, f->glyph2ascii[i], f->glyph[i].advance, name, gpos[i], - f->glyph[i].shape->bitlen,(i!='\\')?i:0x20); + f->glyph[i].shape->bitlen,PRINTABLE(f->glyph2ascii[i])); } printf(" return f;\n}\n\n");