]> icculus.org git repositories - taylor/freespace2.git/blob - src/fonttool/fonttool.cpp
Initial revision
[taylor/freespace2.git] / src / fonttool / fonttool.cpp
1 /*
2  * $Logfile: /Freespace2/code/Fonttool/FontTool.cpp $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Tool for creating/kerning fonts
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:08  root
11  * Initial revision
12  *
13  * 
14  * 2     10/24/98 5:15p Dave
15  * 
16  * 1     10/24/98 4:58p Dave
17  * 
18  * 4     10/30/97 4:56p John
19  * Fixed up font stuff to build.  Fixed bug where it didn't show the last
20  * 3 characters in kerning table.
21  * 
22  * 3     6/23/97 6:05p Hoffoss
23  * Added stubbs to fix linking errors.
24  * 
25  * 2     6/05/97 4:53p John
26  * First rev of new antialiased font stuff.
27  * 
28  * 1     6/02/97 4:04p John
29  *
30  * $NoKeywords: $
31  */
32
33 #include <stdlib.h>
34 #include <stdlib.h>
35 #include <stdio.h>
36 #include <io.h>
37 #include <conio.h>
38
39 #include "pstypes.h"
40 #include "osapi.h"
41 #include "cfile.h"
42 #include "2d.h"
43 #include "key.h"
44 #include "mouse.h"
45 #include "palman.h"
46 #include "timer.h"
47
48 #include "fonttool.h"
49
50 char Usage[] = "Usage:\n"       \
51 "\nFontTool x.pcx [y.vf]\n" \
52 "\n  If you specify a PCX file, then a font will be\n" \
53 "  created with the same base name.   If you also\n" \
54 "  specify a font file, then it will use the kerning\n" \
55 "  data from that font file when it creates the new\n" \
56 "  font from the PCX file.\n" \
57 "\nFontTool x.vf\n" \
58 "\n  If you specify a font file by itself then it will\n" \
59 "  allow you to interactively kern that font.\n" \
60 "\nFontTool x.vf y.vf\n" \
61 "\n  If you specify two font files, then the kerning\n" \
62 "  data from the first font will be copied into the\n" \
63 "  second font.\n" \
64 "\n";
65
66 #define NONE 0
67 #define PCX 1
68 #define FONT 2
69
70 int Font1 = -1;
71
72 void demo_set_playback_filter() {}
73 float flFrametime = 0.0f;
74
75 void freespace_menu_background()
76 {
77         gr_reset_clip();
78         gr_clear();
79 }
80
81 int main(int argc, char *argv[] )
82 {
83         int t1, t2;
84
85         t1 = NONE;
86         t2 = NONE;
87
88         if ( (argc < 1) || (argc>3) )   {
89                 printf( Usage );
90                 return 1;
91         }
92
93         if ( argc > 1 ) {
94                 strlwr( argv[1] );
95
96                 if ( strstr( argv[1], ".pcx" ) )
97                         t1 = PCX;
98                 else if ( strstr( argv[1], ".vf" ) )
99                         t1 = FONT;
100         }
101
102         if ( argc > 2 ) {
103                 strlwr( argv[2] );
104
105                 if ( strstr( argv[2], ".pcx" ) )
106                         t2 = PCX;
107                 else if ( strstr( argv[2], ".vf" ) )
108                         t2 = FONT;
109         }
110
111         if ( (t1==PCX) && (t2==NONE) )
112                 fonttool_create_font( argv[1], NULL );
113         else if ( (t1==PCX) && (t2==FONT) )
114                 fonttool_create_font( argv[1], argv[2] );
115         else if ( (t1==FONT) && (t2==NONE) )
116                 fonttool_edit_kerning( argv[1] );
117         else if ( (t1==FONT) && (t2==FONT) )
118                 fonttool_kerning_copy( argv[1], argv[2] );
119         else
120                 printf( Usage );
121
122         return 0;
123 }