X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=src%2Ffont2swf.c;h=972f2943084e17afb744fc427039ac6e299b77b5;hp=8107a8fbb37c1828badf8277e57ac79f970a798b;hb=c63b2bf21dc1df9a736f0b4c08f6cba828cdab92;hpb=41e559456eae150a5789fef38c3e4be7271e8eda diff --git a/src/font2swf.c b/src/font2swf.c index 8107a8f..972f294 100644 --- a/src/font2swf.c +++ b/src/font2swf.c @@ -31,10 +31,12 @@ static char * destfilename = "output.swf"; static int all=0; static int verbose=0; static char * fontname = 0; +static char config_flashtype = 0; static struct options_t options[] = { {"h", "help"}, {"v", "verbose"}, +{"T", "flashtype"}, {"o", "output"}, {"V", "version"}, {0,0} @@ -54,9 +56,13 @@ int args_callback_option(char*name,char*val) verbose ++; return 0; } + else if(!strcmp(name, "T")) { + config_flashtype=1; + return 0; + } else if(!strcmp(name, "n")) { fontname = val; - return 0; + return 1; } else if(!strcmp(name, "a")) { all = 1; @@ -79,7 +85,6 @@ void args_callback_usage(char *name) printf("\n"); printf("-h , --help Print short help message and exit\n"); printf("-v , --verbose Be verbose. Use more than one -v for greater effect.\n"); - printf("-n , --name Name of the font (class) in the output file\n"); printf("-o , --output Write output to file .\n"); printf("-V , --version Print version info and exit\n"); printf("\n"); @@ -98,10 +103,11 @@ static void convertFont(char*infile, char*outfile) { SWFFONT * font; - font = swf_LoadFont(infile); + font = swf_LoadFont(infile, config_flashtype); + swf_FontCreateAlignZones(font); if(fontname) - font->name = fontname; + font->name = strdup(fontname); swf_WriteFont(font, outfile); swf_FontFree(font);