From: kramm Date: Fri, 28 May 2004 08:50:53 +0000 (+0000) Subject: fixed fontUsage functions. X-Git-Tag: release-0-6-0~176 X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=7155f27b636876b1b3c2c9f39c6393b9b5ce0f8d;p=swftools.git fixed fontUsage functions. --- diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index 6b13c64..3d6a49b 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -478,7 +478,7 @@ int swf_FontReduce(SWFFONT * f,FONTUSAGE * use) j = 0; for (i=0;inumchars;i++) if (f->glyph[i].shape) - { if (f->glyph2ascii[i]numchars&& + { if (f->glyph2ascii[i]maxascii&& use->code[f->glyph2ascii[i]]) { f->ascii2glyph[f->glyph2ascii[i]] = j; f->glyph2ascii[j] = f->glyph2ascii[i]; @@ -501,8 +501,8 @@ int swf_FontReduce(SWFFONT * f,FONTUSAGE * use) int swf_FontInitUsage(SWFFONT* f, FONTUSAGE * use) { if (!use) return -1; - use->code = malloc(sizeof(use->code[0])*f->numchars); - memset(use->code,0,sizeof(use->code[0])*f->numchars); + use->code = malloc(sizeof(use->code[0])*f->maxascii); + memset(use->code,0,sizeof(use->code[0])*f->maxascii); return 0; } @@ -511,7 +511,7 @@ void swf_FontClearUsage(SWFFONT* f, FONTUSAGE * use) free(use->code); } -int swf_FontUse(FONTUSAGE * use,U8 * s) +int swf_FontUse(SWFFONT*f, FONTUSAGE * use,U8 * s) { if ((!use)||(!s)) return -1; while (s[0]) { use->code[s[0]] = 1;