diff options
author | Matthias Kramm <kramm@quiss.org> | 2011-10-14 13:53:29 -0700 |
---|---|---|
committer | Matthias Kramm <kramm@quiss.org> | 2011-10-14 13:53:29 -0700 |
commit | 47be628b3d678b66dde2d02f0cd923143753336d (patch) | |
tree | fd6b7f91a2a4cf8acb0980a116824330582d15c7 | |
parent | 22efe78616f03670ac182edaa3bcfe988327727e (diff) |
added -o option to ttftool
-rw-r--r-- | src/ttftool.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ttftool.c b/src/ttftool.c index a3a8da4f..914a80b5 100644 --- a/src/ttftool.c +++ b/src/ttftool.c @@ -29,11 +29,13 @@ #include "../lib/ttf.h" static char * filename = 0; +static char * output = 0; static int showname = 0; static int verbose = 0; static struct options_t options[] = { {"n", "name"}, +{"o", "output"}, {0,0} }; @@ -48,6 +50,9 @@ int args_callback_option(char*name,char*val) } else if(!strcmp(name, "v")) { verbose ++; return 0; + } else if(!strcmp(name, "o")) { + output = strdup(val); + return 1; } else { printf("Unknown option: -%s\n", name); exit(1); @@ -87,6 +92,9 @@ int main(int argc, char ** argv) if(showname && font->full_name) { printf("%s\n", font->full_name); } + if(output) { + ttf_save(font, output); + } return 0; } |