X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftext.c;h=24bde3c36019250f2930186ae41c48713403c42c;hb=f52e48e2f55dd3a724da00a47552b7edba5f4dfa;hp=d9e41150eb41a67ab0b52d98c53d8257503ab583;hpb=01d3feb7d0121737b3456a3cfbaf6a02b6362d8d;p=swftools.git diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index d9e4115..24bde3c 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -400,7 +400,7 @@ swf_FontExtract_DefineTextCallback(int id, SWFFONT * f, TAG * t, int jobs, SRECT r; MATRIX m; U8 gbits, abits; - int fid = 0; + int fid = -1; RGBA color; int x = 0, y = 0; int fontsize = 0; @@ -459,7 +459,6 @@ swf_FontExtract_DefineTextCallback(int id, SWFFONT * f, TAG * t, int jobs, adv = swf_GetBits(t, abits); xpos += adv; - // if (id == fid) { if (jobs & FEDTJ_PRINT) { int code = f->glyph2ascii[glyph]; @@ -467,12 +466,7 @@ swf_FontExtract_DefineTextCallback(int id, SWFFONT * f, TAG * t, int jobs, } if (jobs & FEDTJ_MODIFY) f->glyph[glyph].advance = adv * 20; //? - } else { - if (jobs & FEDTJ_PRINT) { - printf("?"); - } } - // buf[i] = glyph; } @@ -684,7 +678,7 @@ int swf_FontReduce_swfc(SWFFONT * f) } f->use->used_glyphs = j; for (i = 0; i < f->maxascii; i++) { - if(f->ascii2glyph[i] > -1) + if(f->ascii2glyph[i] > -1) { if (f->use->chars[f->ascii2glyph[i]]<0) { f->use->chars[f->ascii2glyph[i]] = 0; f->ascii2glyph[i] = -1; @@ -694,6 +688,7 @@ int swf_FontReduce_swfc(SWFFONT * f) max_unicode = i + 1; } } + } f->maxascii = max_unicode; f->use->is_reduced = 1; f->numchars = j; @@ -820,6 +815,7 @@ int swf_FontInitUsage(SWFFONT * f) } f->use = rfx_alloc(sizeof(FONTUSAGE)); f->use->is_reduced = 0; + f->use->used_glyphs = 0; f->use->chars = rfx_calloc(sizeof(f->use->chars[0]) * f->numchars); return 0; }