00001 // $Id: newfont.h,v 1.16 2007-04-13 16:15:53 mbickel Exp $ 00002 // 00003 // $Log: newfont.h,v $ 00004 // Revision 1.16 2007-04-13 16:15:53 mbickel 00005 // Merged ASC2 branch 00006 // 00007 // Revision 1.14.2.1 2006/03/01 21:00:50 mbickel 00008 // Clean up of source 00009 // Fixed to construction icons 00010 // 00011 // Revision 1.14 2004/07/14 19:26:48 mbickel 00012 // Fixed display glitches 00013 // Rewrote some endian dependent parts 00014 // 00015 // Revision 1.13 2004/07/12 18:15:08 mbickel 00016 // Lots of tweaks and fixed for more portability and compilation with mingw 00017 // 00018 // Revision 1.12 2004/05/20 14:01:10 mbickel 00019 // Many bugfixes and new features, among them: 00020 // - Container.FillUnitsAutomatically = 2 00021 // - generate Tech Tree 00022 // - show research info 00023 // - edit research in mapeditor 00024 // - limit production to units that can leave a building 00025 // 00026 // Revision 1.11 2001/12/14 10:20:05 mbickel 00027 // Cleanup and enhancements to configure.in 00028 // Removed last remains of octagonal version from source files 00029 // 00030 // Revision 1.10 2001/07/15 21:00:25 mbickel 00031 // Some cleanup in the vehicletype class 00032 // 00033 // Revision 1.9 2001/02/06 17:15:11 mbickel 00034 // Some changes for compilation by Borland C++ Builder 00035 // 00036 // Revision 1.8 2000/08/12 12:52:50 mbickel 00037 // Made DOS-Version compile and run again. 00038 // 00039 // Revision 1.7 2000/08/02 10:28:27 mbickel 00040 // Fixed: generator vehicle not working 00041 // Streams can now report their name 00042 // Field information shows units filename 00043 // 00044 // Revision 1.6 2000/05/23 20:40:48 mbickel 00045 // Removed boolean type 00046 // 00047 // Revision 1.5 1999/12/28 21:03:14 mbickel 00048 // Continued Linux port 00049 // Added KDevelop project files 00050 // 00051 // Revision 1.4 1999/11/25 22:00:07 mbickel 00052 // Added weapon information window 00053 // Added support for primary offscreen frame buffers to graphics engine 00054 // Restored file time handling for DOS version 00055 // 00056 // Revision 1.3 1999/11/22 18:27:45 mbickel 00057 // Restructured graphics engine: 00058 // VESA now only for DOS 00059 // BASEGFX should be platform independant 00060 // new interface for initialization 00061 // Rewrote all ASM code in C++, but it is still available for the Watcom 00062 // versions 00063 // Fixed bugs in RLE decompression, BI map importer and the view calculation 00064 // 00065 // Revision 1.2 1999/11/16 03:42:16 tmwilson 00066 // Added CVS keywords to most of the files. 00067 // Started porting the code to Linux (ifdef'ing the DOS specific stuff) 00068 // Wrote replacement routines for kbhit/getch for Linux 00069 // Cleaned up parts of the code that gcc barfed on (char vs unsigned char) 00070 // Added autoconf/automake capabilities 00071 // Added files used by 'automake --gnu' 00072 // 00073 // 00074 /* 00075 This file is part of Advanced Strategic Command; http://www.asc-hq.de 00076 Copyright (C) 1994-1999 Martin Bickel and Marc Schellenberger 00077 00078 This program is free software; you can redistribute it and/or modify 00079 it under the terms of the GNU General Public License as published by 00080 the Free Software Foundation; either version 2 of the License, or 00081 (at your option) any later version. 00082 00083 This program is distributed in the hope that it will be useful, 00084 but WITHOUT ANY WARRANTY; without even the implied warranty of 00085 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00086 GNU General Public License for more details. 00087 00088 You should have received a copy of the GNU General Public License 00089 along with this program; see the file COPYING. If not, write to the 00090 Free Software Foundation, Inc., 59 Temple Place, Suite 330, 00091 Boston, MA 02111-1307 USA 00092 */ 00093 00094 #ifndef newfont_h 00095 00096 #define newfont_h 00097 #include "global.h" 00098 #include "basestrm.h" 00099 #include "palette.h" 00100 00101 #pragma pack(1) 00102 00103 typedef char charr[49]; 00104 00105 struct toldcharacter { 00106 char width; 00107 Uint16 size; 00108 int diskposition; 00109 char* memposition; 00110 char dummy; 00111 }; 00112 00113 typedef signed char tkerning[101][101]; 00114 typedef char tkernchartable[256]; 00115 00116 // tkerning=Array[0..100,0..100] of Shortint; 00117 00118 struct toldfont { 00119 charr id; 00120 char name[256]; 00121 char number; 00122 char color; 00123 toldcharacter character[256]; 00124 Sint16 height; 00125 tkernchartable kernchartable; 00126 tkerning kerning; 00127 Uint16 dummy; 00128 char useems; 00129 char caps; 00130 dacpalette256* palette; 00131 char groundline; 00132 void read ( tnstream& stream ); 00133 }; 00134 00135 00136 00137 struct tcharacter { 00138 Uint16 width; 00139 Uint16 size; 00140 char* memposition; 00141 }; 00142 00143 struct tfont { 00144 char* name; 00145 char color; 00146 char caps; 00147 Sint16 height; 00148 tcharacter character[256]; 00149 signed char kerning[256][256]; 00150 dacpalette256* palette; 00151 char groundline; 00152 }; 00153 00154 00155 typedef tfont* pfont; 00156 00157 00158 00159 00160 00161 struct tfontsettings { 00162 pfont font; 00163 char color; 00164 char background; 00165 char markcolor; 00166 char colorfont; 00167 Uint16 length; 00168 char direction; 00169 char justify; 00170 signed char italic; 00171 char height; 00172 char compmode; 00173 pfont markfont; 00174 }; 00175 00176 00177 #define lefttext 0 00178 #define centertext 1 00179 #define righttext 2 00180 00181 extern void expand(void* p1, void* q1, int size); 00182 extern void showtext2( const ASCString& TextToOutput, int x1, int x2 ); 00183 extern void showtext2c( const ASCString& TextToOutput, int x1, int x2 ); 00184 00185 extern tfontsettings activefontsettings; 00186 00187 // extern pfont loadfont(char* filename); 00188 extern pfont loadfont( pnstream stream ); 00189 00190 extern void showtext4 ( const char* TextToOutput, int x1, int y1, ... ); 00191 extern void showtext4c ( const char* TextToOutput, int x1, int y1, ... ); 00192 00193 00194 extern void showtext3( const char * txt, int xpos, int ypos); 00195 extern void showtext3c( const char * txt, int xpos, int ypos); 00196 00197 extern int gettextwdth ( const char* txt, pfont font ); 00198 extern void shrinkfont ( pfont font, int diff ); 00199 00200 00201 extern const char* fontid; 00202 extern char* int2string ( int i, char* buf ); 00203 00204 #pragma pack() 00205 00206 #endif
1.4.2