Open Source Tomb Raider Engine
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.

Font.h 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*!
  2. * \file include/Font.h
  3. * \brief Font interface
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _FONT_H_
  8. #define _FONT_H_
  9. #include <string>
  10. /*!
  11. * \brief Font interface
  12. */
  13. class Font {
  14. public:
  15. /*!
  16. * \brief Deconstructs an object of Font
  17. */
  18. virtual ~Font();
  19. virtual void setFont(const char *font);
  20. virtual int initialize() = 0;
  21. virtual unsigned int widthText(float scale, std::string s) = 0;
  22. virtual void drawText(unsigned int x, unsigned int y, float scale,
  23. const unsigned char color[4], std::string s) = 0;
  24. virtual unsigned int heightText(float scale, unsigned int maxWidth, std::string s) = 0;
  25. virtual void drawTextWrapped(unsigned int x, unsigned int y, float scale,
  26. const unsigned char color[4], unsigned int maxWidth, std::string s) = 0;
  27. // Implemented in Font.cpp using widthText & drawText
  28. virtual void drawTextCentered(unsigned int x, unsigned int y, float scale,
  29. const unsigned char color[4], unsigned int width, std::string s);
  30. protected:
  31. bool mFontInit;
  32. char *mFontName;
  33. };
  34. Font &getFont();
  35. #endif