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