X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftext.c;h=21382756aac8db56566d85e176c88957dab413a8;hb=e9631a8e0e3870d2d758ba9c584210f64a202419;hp=affedb3dc8a366df6076d55eb9a2b23b7d2a1d35;hpb=15427fbf8192372b6391a3af0b94319117066118;p=swftools.git diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index affedb3..2138275 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, ""); } } @@ -1200,7 +1204,15 @@ SRECT swf_SetDefineText(TAG*tag, SWFFONT*font, RGBA*rgb, char*text, int scale) } swf_SetRect(tag,&r); - swf_SetMatrix(tag,NULL); + + /* The text matrix is pretty boring, as it doesn't apply to + individual characters, but rather whole text objects (or + at least whole char records- haven't tested). + So it can't do anything which we can't already do with + the placeobject tag we use for placing the text on the scene. + */ + swf_SetMatrix(tag,0); + swf_TextCountBitsUTF8(font,text,scale*20,&gbits,&abits); swf_SetU8(tag,gbits); swf_SetU8(tag,abits);