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";
33 static char * fontname = 0;
35 static struct options_t options[] = {
43 int args_callback_option(char*name,char*val)
45 if(!strcmp(name, "V")) {
46 printf("font2swf - part of %s %s\n", PACKAGE, VERSION);
49 else if(!strcmp(name, "o")) {
53 else if(!strcmp(name, "v")) {
57 else if(!strcmp(name, "n")) {
61 else if(!strcmp(name, "a")) {
66 printf("Unknown option: -%s\n", name);
71 int args_callback_longoption(char*name,char*val)
73 return args_long2shortoption(options, name, val);
75 void args_callback_usage(char *name)
78 printf("Usage: %s <fontfile>\n", name);
80 printf("-h , --help Print short help message and exit\n");
81 printf("-v , --verbose Be verbose. Use more than one -v for greater effect.\n");
82 printf("-n , --name <name> Name of the font (class) in the output file\n");
83 printf("-o , --output <filename> Write output to file <filename>.\n");
84 printf("-V , --version Print version info and exit\n");
87 int args_callback_command(char*name,char*val)
90 fprintf(stderr, "Please specify only one font\n");
97 static void convertFont(char*infile, char*outfile)
101 font = swf_LoadFont(infile);
104 font->name = fontname;
106 swf_WriteFont(font, outfile);
110 int main(int argc, char ** argv)
114 processargs(argc, argv);
115 if(!all && !filename) {
116 fprintf(stderr, "You must supply a filename.\n");
121 convertFont(filename, destfilename);
126 printf("--all not implemented yet.\n");