3 Utility for converting TrueType and Type 1 fonts to SWF.
5 Part of the swftools package.
7 Copyright (c) 2004 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 */
26 #include "../lib/rfxswf.h"
27 #include "../lib/args.h"
29 static char * filename = 0;
30 static char * destfilename = "output.swf";
34 static struct options_t options[] =
42 int args_callback_option(char*name,char*val)
44 if(!strcmp(name, "V")) {
45 printf("font2swf - part of %s %s\n", PACKAGE, VERSION);
48 else if(!strcmp(name, "o")) {
52 else if(!strcmp(name, "v")) {
56 else if(!strcmp(name, "a")) {
61 printf("Unknown option: -%s\n", name);
66 int args_callback_longoption(char*name,char*val)
68 return args_long2shortoption(options, name, val);
70 void args_callback_usage(char*name)
73 printf("Usage: %s <font> [...]\n", name);
74 printf(" OR: %s --all\n", name);
77 printf("\t-h , --help\t\t Print help and exit\n");
78 printf("\t-o , --output filename\t set output filename\n");
79 printf("\t-a , --all\t\tGenerate a set of standard fonts into the current directory\n");
80 printf("\t-v , --verbose\t\t Be more verbose\n");
81 printf("\t-V , --version\t\t Print program version and exit\n");
84 int args_callback_command(char*name,char*val)
90 static void convertFont(char*infile, char*outfile)
94 font = swf_LoadFont(infile);
96 swf_WriteFont(font, outfile);
100 int main(int argc, char ** argv)
104 processargs(argc, argv);
105 if(!all && !filename) {
106 fprintf(stderr, "You must supply a filename.\n");
111 convertFont(filename, destfilename);
116 printf("--all not implemented yet.\n");