git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
treat glyphs with alpha=0 differently than normal glyphs (remove outlines)
[swftools.git]
/
src
/
font2swf.c
diff --git
a/src/font2swf.c
b/src/font2swf.c
index
be8134b
..
972f294
100644
(file)
--- a/
src/font2swf.c
+++ b/
src/font2swf.c
@@
-30,10
+30,13
@@
static char * filename = 0;
static char * destfilename = "output.swf";
static int all=0;
static int verbose=0;
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"},
static struct options_t options[] = {
{"h", "help"},
{"v", "verbose"},
+{"T", "flashtype"},
{"o", "output"},
{"V", "version"},
{0,0}
{"o", "output"},
{"V", "version"},
{0,0}
@@
-53,6
+56,14
@@
int args_callback_option(char*name,char*val)
verbose ++;
return 0;
}
verbose ++;
return 0;
}
+ else if(!strcmp(name, "T")) {
+ config_flashtype=1;
+ return 0;
+ }
+ else if(!strcmp(name, "n")) {
+ fontname = val;
+ return 1;
+ }
else if(!strcmp(name, "a")) {
all = 1;
return 0;
else if(!strcmp(name, "a")) {
all = 1;
return 0;
@@
-80,6
+91,10
@@
void args_callback_usage(char *name)
}
int args_callback_command(char*name,char*val)
{
}
int args_callback_command(char*name,char*val)
{
+ if(filename) {
+ fprintf(stderr, "Please specify only one font\n");
+ exit(1);
+ }
filename = name;
return 0;
}
filename = name;
return 0;
}
@@
-88,7
+103,11
@@
static void convertFont(char*infile, char*outfile)
{
SWFFONT * font;
{
SWFFONT * font;
- font = swf_LoadFont(infile);
+ font = swf_LoadFont(infile, config_flashtype);
+ swf_FontCreateAlignZones(font);
+
+ if(fontname)
+ font->name = strdup(fontname);
swf_WriteFont(font, outfile);
swf_FontFree(font);
swf_WriteFont(font, outfile);
swf_FontFree(font);