5 Part of the swftools package.
7 Copyright (c) 2010 Matthias Kramm <kramm@quiss.org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
28 #include "../lib/args.h"
29 #include "../lib/ttf.h"
31 static char * filename
= 0;
32 static char * output
= 0;
33 static int showname
= 0;
34 static int verbose
= 0;
36 static struct options_t options
[] = {
42 int args_callback_option(char*name
,char*val
)
44 if(!strcmp(name
, "V")) {
45 printf("ttftool - part of %s %s\n", PACKAGE
, VERSION
);
47 } else if(!strcmp(name
, "n")) {
50 } else if(!strcmp(name
, "v")) {
53 } else if(!strcmp(name
, "o")) {
57 printf("Unknown option: -%s\n", name
);
62 int args_callback_longoption(char*name
,char*val
)
64 return args_long2shortoption(options
, name
, val
);
66 void args_callback_usage(char *name
)
69 printf("Usage: %s <fontfile>\n", name
);
71 printf("-h , --help Print short help message and exit\n");
72 printf("-v , --verbose Be verbose. Use more than one -v for greater effect.\n");
73 printf("-o , --output <filename> Write output to file <filename>.\n");
74 printf("-V , --version Print version info and exit\n");
77 int args_callback_command(char*name
,char*val
)
80 fprintf(stderr
, "Please specify only one font\n");
88 int main(int argc
, char ** argv
)
90 processargs(argc
, argv
);
91 ttf_t
* font
= ttf_open(filename
);
92 if(showname
&& font
->full_name
) {
93 printf("%s\n", font
->full_name
);
96 ttf_save(font
, output
);