Advanced Strategic Command
newfont.h
Go to the documentation of this file.
1 // $Id: newfont.h,v 1.18 2009-12-26 18:44:59 mbickel Exp $
2 //
3 // $Log: not supported by cvs2svn $
4 // Revision 1.17 2009-04-18 13:48:38 mbickel
5 // Major refactoring:
6 // Added many more unittests
7 // Changed AI to use commands
8 // Removed and separated lots of legacy code
9 // TransferUnitControl is now undo capable
10 //
11 // Revision 1.16 2007/04/13 16:15:53 mbickel
12 // Merged ASC2 branch
13 //
14 // Revision 1.14.2.1 2006/03/01 21:00:50 mbickel
15 // Clean up of source
16 // Fixed to construction icons
17 //
18 // Revision 1.14 2004/07/14 19:26:48 mbickel
19 // Fixed display glitches
20 // Rewrote some endian dependent parts
21 //
22 // Revision 1.13 2004/07/12 18:15:08 mbickel
23 // Lots of tweaks and fixed for more portability and compilation with mingw
24 //
25 // Revision 1.12 2004/05/20 14:01:10 mbickel
26 // Many bugfixes and new features, among them:
27 // - Container.FillUnitsAutomatically = 2
28 // - generate Tech Tree
29 // - show research info
30 // - edit research in mapeditor
31 // - limit production to units that can leave a building
32 //
33 // Revision 1.11 2001/12/14 10:20:05 mbickel
34 // Cleanup and enhancements to configure.in
35 // Removed last remains of octagonal version from source files
36 //
37 // Revision 1.10 2001/07/15 21:00:25 mbickel
38 // Some cleanup in the vehicletype class
39 //
40 // Revision 1.9 2001/02/06 17:15:11 mbickel
41 // Some changes for compilation by Borland C++ Builder
42 //
43 // Revision 1.8 2000/08/12 12:52:50 mbickel
44 // Made DOS-Version compile and run again.
45 //
46 // Revision 1.7 2000/08/02 10:28:27 mbickel
47 // Fixed: generator vehicle not working
48 // Streams can now report their name
49 // Field information shows units filename
50 //
51 // Revision 1.6 2000/05/23 20:40:48 mbickel
52 // Removed boolean type
53 //
54 // Revision 1.5 1999/12/28 21:03:14 mbickel
55 // Continued Linux port
56 // Added KDevelop project files
57 //
58 // Revision 1.4 1999/11/25 22:00:07 mbickel
59 // Added weapon information window
60 // Added support for primary offscreen frame buffers to graphics engine
61 // Restored file time handling for DOS version
62 //
63 // Revision 1.3 1999/11/22 18:27:45 mbickel
64 // Restructured graphics engine:
65 // VESA now only for DOS
66 // BASEGFX should be platform independant
67 // new interface for initialization
68 // Rewrote all ASM code in C++, but it is still available for the Watcom
69 // versions
70 // Fixed bugs in RLE decompression, BI map importer and the view calculation
71 //
72 // Revision 1.2 1999/11/16 03:42:16 tmwilson
73 // Added CVS keywords to most of the files.
74 // Started porting the code to Linux (ifdef'ing the DOS specific stuff)
75 // Wrote replacement routines for kbhit/getch for Linux
76 // Cleaned up parts of the code that gcc barfed on (char vs unsigned char)
77 // Added autoconf/automake capabilities
78 // Added files used by 'automake --gnu'
79 //
80 //
81 /*
82  This file is part of Advanced Strategic Command; http://www.asc-hq.de
83  Copyright (C) 1994-2010 Martin Bickel and Marc Schellenberger
84 
85  This program is free software; you can redistribute it and/or modify
86  it under the terms of the GNU General Public License as published by
87  the Free Software Foundation; either version 2 of the License, or
88  (at your option) any later version.
89 
90  This program is distributed in the hope that it will be useful,
91  but WITHOUT ANY WARRANTY; without even the implied warranty of
92  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93  GNU General Public License for more details.
94 
95  You should have received a copy of the GNU General Public License
96  along with this program; see the file COPYING. If not, write to the
97  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
98  Boston, MA 02111-1307 USA
99 */
100 
101 #ifndef newfont_h
102 
103 #define newfont_h
104 #include "global.h"
105 #include "basestrm.h"
106 #include "palette.h"
107 
108 #pragma pack(1)
109 
110 typedef char charr[49];
111 
113  Uint8 width;
114  Uint16 size;
116  Uint8* memposition;
117  Uint8 dummy;
118  };
119 
120 typedef signed char tkerning[101][101];
121 typedef char tkernchartable[256];
122 
123 // tkerning=Array[0..100,0..100] of Shortint;
124 
125 struct toldfont {
127  char name[256];
128  Uint8 number;
129  Uint8 color;
131  Sint16 height;
134  Uint16 dummy;
135  Uint8 useems;
136  Uint8 caps;
138  Uint8 groundline;
139  void read ( tnstream& stream );
140  };
141 
142 
143 
144 struct tcharacter {
145  Uint16 width;
146  Uint16 size;
147  Uint8* memposition;
148  };
149 
150 struct tfont {
151  char* name;
152  Uint8 color;
153  Uint8 caps;
154  Sint16 height;
156  signed char kerning[256][256];
159  };
160 
161 
162 typedef tfont* pfont;
163 
164 
165 
166 
167 
170  Uint8 color;
171  Uint8 background;
172  Uint8 markcolor;
173  Uint8 colorfont;
174  Uint16 length;
175  Uint8 direction;
176  Uint8 justify;
177  signed char italic;
178  Uint8 height;
179  Uint8 compmode;
181  };
182 
183 
184 #define lefttext 0
185 #define centertext 1
186 #define righttext 2
187 
188 extern void expand(void* p1, void* q1, int size);
189 extern void showtext2( const ASCString& TextToOutput, int x1, int x2 );
190 extern void showtext2c( const ASCString& TextToOutput, int x1, int x2 );
191 
193 
194 extern pfont loadfont( tnstream* stream );
195 
196 extern void showtext4 ( const char* TextToOutput, int x1, int y1, ... );
197 extern void showtext4c ( const char* TextToOutput, int x1, int y1, ... );
198 
199 
200 extern void showtext3( const char * txt, int xpos, int ypos);
201 extern void showtext3c( const char * txt, int xpos, int ypos);
202 
203 extern int gettextwdth ( const char* txt, pfont font );
204 extern void shrinkfont ( pfont font, int diff );
205 
206 
207 extern const char* fontid;
208 extern char* int2string ( int i, char* buf );
209 
210 #pragma pack()
211 
212 #endif
char charr[49]
Definition: newfont.h:110
toldcharacter character[256]
Definition: newfont.h:130
Uint8 markcolor
Definition: newfont.h:172
Uint8 background
Definition: newfont.h:171
char tkernchartable[256]
Definition: newfont.h:121
int diskposition
Definition: newfont.h:115
char name[256]
Definition: newfont.h:127
Uint16 dummy
Definition: newfont.h:134
Uint8 compmode
Definition: newfont.h:179
Sint16 height
Definition: newfont.h:131
Uint8 number
Definition: newfont.h:128
Uint8 justify
Definition: newfont.h:176
Sint16 height
Definition: newfont.h:154
Uint8 colorfont
Definition: newfont.h:173
Global platform dependant definitions. This file just branches to the platform specific files in thei...
Uint8 width
Definition: newfont.h:113
The interface for all kinds of IO stream.
tfont * pfont
Definition: newfont.h:162
Uint8 color
Definition: newfont.h:170
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
Uint8 color
Definition: newfont.h:152
void showtext2(const ASCString &TextToOutput, int x1, int x2)
Definition: basegfx.cpp:1953
Uint8 caps
Definition: newfont.h:136
Uint8 caps
Definition: newfont.h:153
dacpalette256 * palette
Definition: newfont.h:137
Uint8 * memposition
Definition: newfont.h:147
dacpalette256 * palette
Definition: newfont.h:157
char * int2string(int i, char *buf)
Definition: newfont.cpp:448
void read(tnstream &stream)
Definition: newfont.cpp:80
pfont font
Definition: newfont.h:169
void expand(void *p1, void *q1, int size)
Definition: newfont.cpp:53
signed char kerning[256][256]
Definition: newfont.h:156
Uint16 length
Definition: newfont.h:174
The interface for the various streams that ASC offers, like file and memory streams.
Uint8 color
Definition: newfont.h:129
signed char italic
Definition: newfont.h:177
Uint8 groundline
Definition: newfont.h:138
Uint16 width
Definition: newfont.h:145
Uint16 size
Definition: newfont.h:146
charr id
Definition: newfont.h:126
tfontsettings activefontsettings
Definition: newfont.cpp:51
tkerning kerning
Definition: newfont.h:133
void showtext2c(const ASCString &TextToOutput, int x1, int x2)
Definition: basegfx.cpp:1958
void showtext4(const char *TextToOutput, int x1, int y1,...)
Definition: newfont.cpp:416
Uint8 * memposition
Definition: newfont.h:116
Uint8 direction
Definition: newfont.h:175
signed char tkerning[101][101]
Definition: newfont.h:120
char * name
Definition: newfont.h:151
void showtext3c(const char *txt, int xpos, int ypos)
Definition: newfont.cpp:337
pfont loadfont(tnstream *stream)
Definition: newfont.cpp:107
void showtext4c(const char *TextToOutput, int x1, int y1,...)
Definition: newfont.cpp:428
tcharacter character[256]
Definition: newfont.h:155
void showtext3(const char *txt, int xpos, int ypos)
Definition: newfont.cpp:246
pfont markfont
Definition: newfont.h:180
Uint16 size
Definition: newfont.h:114
void shrinkfont(pfont font, int diff)
Definition: newfont.cpp:206
The color palette and various color translation tables.
Uint8 dacpalette256[256][3]
Definition: palette.h:76
Uint8 height
Definition: newfont.h:178
Uint8 useems
Definition: newfont.h:135
int gettextwdth(const char *txt, pfont font)
Definition: newfont.cpp:217
char groundline
Definition: newfont.h:158
Uint8 dummy
Definition: newfont.h:117
const char * fontid
Definition: newfont.cpp:45
tkernchartable kernchartable
Definition: newfont.h:132
Definition: newfont.h:150