From: kramm Date: Sat, 12 Jun 2004 16:02:47 +0000 (+0000) Subject: fixed a font bug, added handling for NULL in glyphnames. X-Git-Tag: release-0-6-0~121 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=c8da09410c94c5da425f5dfcf471a67fd3f8375e;hp=151e7df6db3719bed920fa13ac149080c75f9c8a;p=swftools.git fixed a font bug, added handling for NULL in glyphnames. --- diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index affedb3..2b2bf91 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -625,7 +625,7 @@ int swf_FontSetDefine2(TAG *tag, SWFFONT * f) flags |= 4; //wide codecs if(fontSize(f)>65535) flags |= 8; //wide offsets - flags |= 8; //FIXME: the above check doesn't work + flags |= 8|4; //FIXME: the above check doesn't work if(f->encoding & FONT_ENCODING_ANSI) flags |= 16; // ansi @@ -805,7 +805,8 @@ void swf_FontFree(SWFFONT * f) if(f->glyphnames) { int t; for(t=0;tnumchars;t++) { - free(f->glyphnames[t]); + if(f->glyphnames[t]) + free(f->glyphnames[t]); } free(f->glyphnames); } @@ -1028,7 +1029,10 @@ void swf_WriteFont(SWFFONT*font, char* filename) swf_SetU16(t, WRITEFONTID); swf_SetU16(t, font->numchars); for(c=0;cnumchars;c++) { - swf_SetString(t, font->glyphnames[c]); + if(font->glyphnames[c]) + swf_SetString(t, font->glyphnames[c]); + else + swf_SetString(t, ""); } }