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
if(f->glyphnames) {
int t;
for(t=0;t<f->numchars;t++) {
- free(f->glyphnames[t]);
+ if(f->glyphnames[t])
+ free(f->glyphnames[t]);
}
free(f->glyphnames);
}
swf_SetU16(t, WRITEFONTID);
swf_SetU16(t, font->numchars);
for(c=0;c<font->numchars;c++) {
- swf_SetString(t, font->glyphnames[c]);
+ if(font->glyphnames[c])
+ swf_SetString(t, font->glyphnames[c]);
+ else
+ swf_SetString(t, "");
}
}
}
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);