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.

71 lines
1.5 KiB

  1. //========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef FONTAMALGAM_H
  8. #define FONTAMALGAM_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "vguifont.h"
  13. #include "BitmapFont.h"
  14. #include "utlvector.h"
  15. //-----------------------------------------------------------------------------
  16. // Purpose: object that holds a set of fonts in specified ranges
  17. //-----------------------------------------------------------------------------
  18. class CFontAmalgam
  19. {
  20. public:
  21. CFontAmalgam();
  22. ~CFontAmalgam();
  23. // adds a font to the amalgam
  24. void AddFont( font_t *font, int lowRange, int highRange);
  25. // returns the font for the given character
  26. font_t *GetFontForChar(int ch);
  27. // returns the max height of the font set
  28. int GetFontHeight();
  29. // returns the maximum width of a character in a font
  30. int GetFontMaxWidth();
  31. // returns the flags used to make the first font
  32. int GetFlags(int i);
  33. // returns the windows name for the font
  34. const char *GetFontName(int i);
  35. // returns the number of fonts in this amalgam
  36. int GetCount();
  37. // returns true if this font is underlined
  38. bool GetUnderlined();
  39. // sets the scale of a bitmap font
  40. void SetFontScale(float sx, float sy);
  41. // clears the fonts
  42. void RemoveAll();
  43. private:
  44. struct TFontRange
  45. {
  46. int lowRange;
  47. int highRange;
  48. font_t *pWin32Font;
  49. };
  50. CUtlVector<TFontRange> m_Fonts;
  51. int m_iMaxWidth;
  52. int m_iMaxHeight;
  53. };
  54. #endif // FONTAMALGAM_H