AFONT.H 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //===========================================================================//
  2. // Copyright (C) Microsoft Corporation. All rights reserved. //
  3. //===========================================================================//
  4. #ifndef AFONT_H
  5. #define AFONT_H
  6. #include <gameOS.hpp>
  7. class aFont;
  8. class aFont
  9. {
  10. public:
  11. aFont();
  12. ~aFont();
  13. aFont( const aFont& src );
  14. aFont& operator=( const aFont& src );
  15. long init( const char* fontName);
  16. long init( long resourceID );
  17. void destroy();
  18. void render( const char* text, int XPos, int YPos, int areaWidth,
  19. int areaHeight, unsigned long color, bool bBold, int alignment );
  20. long load( const char* fontName);
  21. unsigned long height() const;
  22. unsigned long width( const char* st) const;
  23. unsigned long height( const char* st, int areaWidth ) const;
  24. void getSize( unsigned long& width, unsigned long& height, const char* pText );
  25. static HGOSFONT3D loadFont( long resourceID, long& size );
  26. long getSize() { return size; }
  27. HGOSFONT3D getTempHandle() { return gosFont; } // don't you dare hang on to this
  28. int getFontID() { return resID; }
  29. private:
  30. HGOSFONT3D gosFont;
  31. int resID;
  32. char fontName[64]; // so we can copy fonts
  33. long size;
  34. void copyData( const aFont& src );
  35. };
  36. // Error codes, local to this file...
  37. #define FONT_NOT_LOADED -3
  38. #endif