FONT.H 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /***************************************************************************
  15. ** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
  16. ***************************************************************************
  17. * *
  18. * Project Name : Font and text print 32 bit library *
  19. * *
  20. * File Name : FONT.H *
  21. * *
  22. * Programmer : Scott K. Bowen *
  23. * *
  24. * Start Date : June 27, 1994 *
  25. * *
  26. * Last Update : June 29, 1994 [SKB] *
  27. * *
  28. *-------------------------------------------------------------------------*
  29. * Functions: *
  30. * VVPC::Text_Print -- Text print into a virtual viewport. *
  31. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  32. #ifndef FONT_H
  33. #define FONT_H
  34. #ifndef GBUFFER_H
  35. #include <gbuffer.h>
  36. #endif
  37. //////////////////////////////////////// Defines //////////////////////////////////////////
  38. // defines for font header, offsets to block offsets
  39. #define FONTINFOBLOCK 4
  40. #define FONTOFFSETBLOCK 6
  41. #define FONTWIDTHBLOCK 8
  42. #define FONTDATABLOCK 10
  43. #define FONTHEIGHTBLOCK 12
  44. // defines for font info block
  45. #define FONTINFOMAXHEIGHT 4
  46. #define FONTINFOMAXWIDTH 5
  47. //////////////////////////////////////// Prototypes //////////////////////////////////////////
  48. /*=========================================================================*/
  49. /* The following prototypes are for the file: SET_FONT.CPP */
  50. /*=========================================================================*/
  51. void * __cdecl Set_Font(void const *fontptr);
  52. /*=========================================================================*/
  53. /* The following prototypes are for the file: FONT.CPP */
  54. /*=========================================================================*/
  55. int __cdecl Char_Pixel_Width(char chr);
  56. unsigned int __cdecl String_Pixel_Width(char const *string);
  57. void __cdecl Get_Next_Text_Print_XY(GraphicViewPortClass& vp, unsigned long offset, INT *x, INT *y);
  58. /*=========================================================================*/
  59. /* The following prototypes are for the file: LOADFONT.CPP */
  60. /*=========================================================================*/
  61. void * __cdecl Load_Font(char const *name);
  62. /*=========================================================================*/
  63. /* The following prototypes are for the file: TEXTPRNT.ASM */
  64. /*=========================================================================*/
  65. #ifdef __cplusplus
  66. extern "C" {
  67. #endif
  68. void __cdecl Set_Font_Palette_Range(void const *palette, INT start_idx, INT end_idx);
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72. /*=========================================================================*/
  73. //////////////////////////////////////// External varables ///////////////////////////////////////
  74. extern "C" int FontXSpacing;
  75. extern "C" int FontYSpacing;
  76. extern char FontWidth ;
  77. extern char FontHeight;
  78. extern char *FontWidthBlockPtr;
  79. extern "C" void const *FontPtr;
  80. #endif // FONT_H