FontBase.h 648 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. /*
  3. * FontBase.h, part of VCMI engine
  4. *
  5. * Authors: listed in file AUTHORS in main folder
  6. *
  7. * License: GNU General Public License v2.0 or later
  8. * Full text of license available in license.txt file, in main folder
  9. *
  10. */
  11. enum EFonts
  12. {
  13. FONT_BIG, FONT_CALLI, FONT_CREDITS, FONT_HIGH_SCORE, FONT_MEDIUM, FONT_SMALL, FONT_TIMES, FONT_TINY, FONT_VERD
  14. };
  15. struct Font
  16. {
  17. struct Char
  18. {
  19. si32 unknown1, width, unknown2, offset;
  20. ui8 *pixels;
  21. };
  22. Char chars[256];
  23. ui8 height;
  24. ui8 *data;
  25. Font(ui8 *Data);
  26. ~Font();
  27. int getWidth(const char *text) const;
  28. int getCharWidth(char c) const;
  29. };