From: kramm Date: Mon, 5 Nov 2001 15:05:57 +0000 (+0000) Subject: * enumerate also definefont2 tags X-Git-Tag: release-0-1-2~46 X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;ds=inline;h=6c8cd5189daa2577ca5f0d1ce4ba7ae74496467f;p=swftools.git * enumerate also definefont2 tags * fixed ascii/glyph advance value bug --- diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index 62618f2..c1eafaf 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -46,7 +46,8 @@ int swf_FontEnumerate(SWF * swf,void (*FontCallback) (U16,U8*)) n = 0; while (t) - { if (swf_GetTagID(t)==ST_DEFINEFONTINFO) + { if (swf_GetTagID(t)==ST_DEFINEFONTINFO || + swf_GetTagID(t)==ST_DEFINEFONT2) { n++; if (FontCallback) { U16 id; @@ -54,8 +55,10 @@ int swf_FontEnumerate(SWF * swf,void (*FontCallback) (U16,U8*)) U8 s[257]; swf_SaveTagPos(t); swf_SetTagPos(t,0); - + id = swf_GetU16(t); + if(swf_GetTagID(t) == ST_DEFINEFONT2) + swf_GetU16(t); l = swf_GetU8(t); swf_GetBlock(t,s,l); s[l] = 0; @@ -293,7 +296,7 @@ int swf_FontExtract_DefineText(int id,SWFFONT * f,TAG * t,int jobs) { int code = f->glyph2ascii[glyph]; if (jobs&FEDTJ_PRINT) printf("%c",code); if (jobs&FEDTJ_MODIFY) - /*if (!f->glyph[code].advance)*/ f->glyph[code].advance = adv; + /*if (!f->glyph[code].advance)*/ f->glyph[glyph].advance = adv; } } if ((id==fid)&&(jobs&FEDTJ_PRINT)) printf("\n");