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 int showname
= 0;
33 static int verbose
= 0;
35 static struct options_t options
[] = {
40 int args_callback_option(char*name
,char*val
)
42 if(!strcmp(name
, "V")) {
43 printf("ttftool - part of %s %s\n", PACKAGE
, VERSION
);
45 } else if(!strcmp(name
, "n")) {
48 } else if(!strcmp(name
, "v")) {
52 printf("Unknown option: -%s\n", name
);
57 int args_callback_longoption(char*name
,char*val
)
59 return args_long2shortoption(options
, name
, val
);
61 void args_callback_usage(char *name
)
64 printf("Usage: %s <fontfile>\n", name
);
66 printf("-h , --help Print short help message and exit\n");
67 printf("-v , --verbose Be verbose. Use more than one -v for greater effect.\n");
68 printf("-o , --output <filename> Write output to file <filename>.\n");
69 printf("-V , --version Print version info and exit\n");
72 int args_callback_command(char*name
,char*val
)
75 fprintf(stderr
, "Please specify only one font\n");
83 int main(int argc
, char ** argv
)
85 processargs(argc
, argv
);
86 ttf_t
* font
= ttf_open(filename
);
87 if(showname
&& font
->full_name
) {
88 printf("%s\n", font
->full_name
);