Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.5 KiB

  1. //===== Copyright 1996-2005, Valve Corporation, All rights reserved. ======
  2. //
  3. // Baked Bitmap fonts
  4. //
  5. //===========================================================================
  6. #ifndef _BITMAPFONT_H_
  7. #define _BITMAPFONT_H_
  8. #include "vguifont.h"
  9. #include "BitmapFontFile.h"
  10. class ITexture;
  11. //-----------------------------------------------------------------------------
  12. // Purpose: encapsulates a windows font
  13. //-----------------------------------------------------------------------------
  14. class CBitmapFont : public font_t
  15. {
  16. public:
  17. CBitmapFont();
  18. ~CBitmapFont();
  19. // creates the font. returns false if the compiled font does not exist.
  20. virtual bool Create(const char *windowsFontName, float scalex, float scaley, int flags);
  21. // returns true if the font is equivalent to that specified
  22. virtual bool IsEqualTo(const char *windowsFontName, float scalex, float scaley, int flags);
  23. // gets the abc widths for a character
  24. virtual void GetCharABCWidths(int ch, int &a, int &b, int &c);
  25. virtual void GetKernedCharWidth( wchar_t ch, wchar_t chBefore, wchar_t chAfter, float &wide, float &abcA, float &abcC );
  26. // gets the texture coords in the compiled texture page
  27. void GetCharCoords( int ch, float *left, float *top, float *right, float *bottom );
  28. // sets the scale of the font.
  29. void SetScale( float sx, float sy );
  30. // gets the compiled texture page
  31. ITexture *GetTexturePage();
  32. private:
  33. int m_bitmapFontHandle;
  34. float m_scalex;
  35. float m_scaley;
  36. };
  37. #endif // _BITMAPFONT_H