From 8f05e89aea4b0bf754a87d32a638dcef9086e83e Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Wed, 1 Apr 2009 12:14:50 +0200 Subject: [PATCH] swfdump: added (optimal) unicode2glyph mapping dump --- src/swfdump.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/swfdump.c b/src/swfdump.c index 2967d91..0020661 100644 --- a/src/swfdump.c +++ b/src/swfdump.c @@ -343,6 +343,35 @@ void dumpFont(TAG*tag, char*prefix) swf_Shape2Free(shape); free(shape); } + + /* + not part of the file + + printf("%sencoding table:", prefix, prefix); + char filled0=0, lastfilled=0; + for(t=0;tmaxascii;t++) { + if((t&15)==0) { + printf("\n%s%08x ", prefix, t); + int s; + if(!filled0 && t) { + for(s=t;smaxascii;s++) { + if(font->ascii2glyph[s]>=0) break; + } + if(s>t+32) { + printf("*"); + t = ((s-16)&~15)-1; + continue; + } + } + filled0 = 0; + for(s=t;smaxascii;s++) { + if(font->ascii2glyph[s]>=0) filled0=1; + } + } + printf("%4d ", font->ascii2glyph[t]); + } + printf("\n");*/ + swf_FontFree(font); } @@ -985,8 +1014,8 @@ int main (int argc,char ** argv) char header[3]; read(f, header, 3); char compressed = (header[0]=='C'); - char isflash = header[0]=='F' && header[1] == 'W' && header[2] == 'S' || - header[0]=='C' && header[1] == 'W' && header[2] == 'S'; + char isflash = (header[0]=='F' && header[1] == 'W' && header[2] == 'S') || + (header[0]=='C' && header[1] == 'W' && header[2] == 'S'); close(f); int fl=strlen(filename); -- 1.7.10.4