added new options
[swftools.git] / src / swfdump.c
index c9ca395..99917eb 100644 (file)
@@ -70,6 +70,7 @@ static struct options_t options[] = {
 {"a", "action"},
 {"t", "text"},
 {"s", "shapes"},
+{"F", "fonts"},
 {"p", "placements"},
 {"b", "bbox"},
 {"X", "width"},
@@ -176,6 +177,7 @@ void args_callback_usage(char *name)
     printf("-a , --action                  Disassemble action tags\n");
     printf("-t , --text                    Show text fields (like swfstrings).\n");
     printf("-s , --shapes                  Show shape coordinates/styles\n");
+    printf("-F , --fonts                   Show font information\n");
     printf("-p , --placements              Show placement information\n");
     printf("-b , --bbox                    Print tag's bounding boxes\n");
     printf("-X , --width                   Prints out a string of the form \"-X width\".\n");
@@ -286,7 +288,8 @@ void dumpFont(TAG*tag, char*prefix)
     printf("%slanguage: %02x\n", prefix,font->language);
     int t;
     for(t=0;t<font->numchars;t++) {
-       printf("%s== Glyph %d: advance=%d ==\n", prefix, t, font->glyph[t].advance);
+       int u = font->glyph2ascii?font->glyph2ascii[t]:-1;
+       printf("%s== Glyph %d: advance=%d encoding=%d ==\n", prefix, t, font->glyph[t].advance, u);
        SHAPE2* shape = swf_ShapeToShape2(font->glyph[t].shape);
        SHAPELINE*line = shape->lines;
 
@@ -1245,7 +1248,7 @@ int main (int argc,char ** argv)
        }
        else if(tag->id == ST_PLACEOBJECT2 || tag->id == ST_PLACEOBJECT3) {
        }
-       else if(tag->id == ST_NAMECHARACTER) {
+       else if(tag->id == ST_NAMECHARACTER || tag->id==ST_DEFINEFONTNAME) {
            swf_GetU16(tag);
            printf(" \"%s\"\n", swf_GetString(tag));
        }
@@ -1280,7 +1283,7 @@ int main (int argc,char ** argv)
            if(tag->len)
                dumperror("End Tag not empty");
         }
-       else if(tag->id == ST_EXPORTASSETS) {
+       else if(tag->id == ST_EXPORTASSETS || tag->id == ST_SYMBOLCLASS) {
            handleExportAssets(tag, myprefix);
        }
         else if(tag->id == ST_DOACTION && action) {
@@ -1309,6 +1312,13 @@ int main (int argc,char ** argv)
        else if(tag->id == ST_PLACEOBJECT2 || tag->id == ST_PLACEOBJECT3) {
            handlePlaceObject23(tag, myprefix);
        }
+       else if(tag->id == ST_DEFINEFONTNAME) {
+           swf_SetTagPos(tag, 0);
+           swf_GetU16(tag); //id
+           swf_GetString(tag); //name
+           char* copyright = swf_GetString(tag);
+           printf("%s%s\n", myprefix, copyright);
+       }
        else if(tag->id == ST_DEFINESHAPE ||
                tag->id == ST_DEFINESHAPE2 ||
                tag->id == ST_DEFINESHAPE3 ||