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