TwFonts.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // ---------------------------------------------------------------------------
  2. //
  3. // @file TwFonts.h
  4. // @brief Bitmaps fonts
  5. // @author Philippe Decaudin - http://www.antisphere.com
  6. // @license This file is part of the AntTweakBar library.
  7. // For conditions of distribution and use, see License.txt
  8. //
  9. // note: Private header
  10. //
  11. // ---------------------------------------------------------------------------
  12. #if !defined ANT_TW_FONTS_INCLUDED
  13. #define ANT_TW_FONTS_INCLUDED
  14. //#include <AntTweakBar.h>
  15. /*
  16. A source bitmap includes 224 characters starting from ascii char 32 (i.e. space) to ascii char 255:
  17. !"#$%&'()*+,-./0123456789:;<=>?
  18. @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
  19. `abcdefghijklmnopqrstuvwxyz{|}~
  20. €�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ
  21.  ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿
  22. ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß
  23. àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
  24. First column of a source bitmap is a delimiter with color=zero at the end of each line of characters.
  25. Last row of a line of characters is a delimiter with color=zero at the last pixel of each character.
  26. */
  27. struct CTexFont
  28. {
  29. unsigned char * m_TexBytes;
  30. int m_TexWidth; // power of 2
  31. int m_TexHeight; // power of 2
  32. float m_CharU0[256];
  33. float m_CharV0[256];
  34. float m_CharU1[256];
  35. float m_CharV1[256];
  36. int m_CharWidth[256];
  37. int m_CharHeight;
  38. int m_NbCharRead;
  39. CTexFont();
  40. ~CTexFont();
  41. };
  42. CTexFont *TwGenerateFont(const unsigned char *_Bitmap, int _BmWidth, int _BmHeight);
  43. extern CTexFont *g_DefaultSmallFont;
  44. extern CTexFont *g_DefaultNormalFont;
  45. extern CTexFont *g_DefaultNormalFontAA;
  46. extern CTexFont *g_DefaultLargeFont;
  47. extern CTexFont *g_DefaultFixed1Font;
  48. void TwGenerateDefaultFonts();
  49. void TwDeleteDefaultFonts();
  50. #endif // !defined ANT_TW_FONTS_INCLUDED