int fontnum = 0;
SWFFONT**fonts;
-void textcallback(int*glyphs, int nr, int fontid)
+void textcallback(void*self, int*glyphs, int*ypos, int nr, int fontid, int fontsize, int startx, int starty, RGBA*color)
{
int font=-1,t;
- printf(" <%2d glyphs in font %2d> ",nr, fontid);
+ printf(" <%2d glyphs in font %2d, color #%02x%02x%02x%02x> ",nr, fontid, color->r, color->g, color->b, color->a);
for(t=0;t<fontnum;t++)
{
if(fonts[t]->id == fontid) {
if(font>=0) {
if(glyphs[t] >= fonts[font]->numchars /*glyph is in range*/
|| !fonts[font]->glyph2ascii /* font has ascii<->glyph mapping */
- )
- continue;
- a = fonts[font]->glyph2ascii[glyphs[t]];
+ ) a = glyphs[t];
+ else
+ a = fonts[font]->glyph2ascii[glyphs[t]];
} else {
a = glyphs[t];
}
void handleText(TAG*tag)
{
printf("\n");
- swf_FontExtract_DefineTextCallback(-1,0,tag,4, textcallback);
+ swf_ParseDefineText(tag,textcallback, 0);
}
void handleDefineSound(TAG*tag)
char pstr[3][160];
int ppos[3] = {0,0,0};
swf_GetU16(tag); //depth
+
//flags&1: move
if(flags&2) swf_GetU16(tag); //id
if(flags&4) {
printf(" ");
if(xy&4)
- printf("-r %d", swf.frameRate*100/256);
+ printf("-r %.2f", swf.frameRate/256.0);
if((xy&7) && (xy&8))
printf(" ");
swf_GetUsedIDs(tag, used);
printf("%s%suses IDs: ", indent, prefix);
for(t=0;t<num;t++) {
+ int id;
swf_SetTagPos(tag, used[t]);
- printf("%d%s", swf_GetU16(tag), t<num-1?", ":"");
+ id = swf_GetU16(tag);
+ printf("%d%s", id, t<num-1?", ":"");
+ if(!idtab[id]) {
+ dumperror("Id %04d is not yet defined.\n", id);
+ }
}
printf("\n");
}