From: Matthias Kramm Date: Wed, 1 Apr 2009 10:12:29 +0000 (+0200) Subject: allow to set the name of the font class X-Git-Tag: release-0-9-0~33 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=41e559456eae150a5789fef38c3e4be7271e8eda;p=swftools.git allow to set the name of the font class --- diff --git a/src/font2swf.c b/src/font2swf.c index 3eee844..8107a8f 100644 --- a/src/font2swf.c +++ b/src/font2swf.c @@ -30,6 +30,7 @@ static char * filename = 0; static char * destfilename = "output.swf"; static int all=0; static int verbose=0; +static char * fontname = 0; static struct options_t options[] = { {"h", "help"}, @@ -53,6 +54,10 @@ int args_callback_option(char*name,char*val) verbose ++; return 0; } + else if(!strcmp(name, "n")) { + fontname = val; + return 0; + } else if(!strcmp(name, "a")) { all = 1; return 0; @@ -74,6 +79,7 @@ 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"); @@ -94,6 +100,9 @@ static void convertFont(char*infile, char*outfile) font = swf_LoadFont(infile); + if(fontname) + font->name = fontname; + swf_WriteFont(font, outfile); swf_FontFree(font); }