CFontTool.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef IRR_FONT_TOOL_INCLUDED
  2. #define IRR_FONT_TOOL_INCLUDED
  3. #include "irrlicht.h"
  4. #if defined(_IRR_WINDOWS_)
  5. #ifdef _MBCS
  6. #undef _MBCS
  7. #endif
  8. #define UNICODE
  9. #define _WIN32_WINNT 0x0500
  10. #include "windows.h"
  11. #else
  12. #ifdef _IRR_COMPILE_WITH_X11_
  13. #include <X11/Xlib.h>
  14. #endif
  15. #include <X11/Xft/Xft.h>
  16. #include <set>
  17. #endif
  18. namespace irr {
  19. class CFontTool : public irr::IReferenceCounted
  20. {
  21. public:
  22. CFontTool(irr::IrrlichtDevice* device);
  23. ~CFontTool();
  24. virtual bool makeBitmapFont(u32 fontIndex, u32 charsetIndex,
  25. s32 fontSize, u32 texturewidth, u32 textureHeight,
  26. bool bold, bool italic, bool aa, bool alpha);
  27. virtual bool saveBitmapFont(const c8* filename, const c8* format);
  28. virtual void selectCharSet(u32 currentCharSet);
  29. struct SFontArea
  30. {
  31. SFontArea() : rectangle(), underhang(0), overhang(0), sourceimage(0) {}
  32. core::rect<s32> rectangle;
  33. s32 underhang;
  34. s32 overhang;
  35. u32 sourceimage;
  36. };
  37. /* struct SFontMap
  38. {
  39. SFontMap() : areas(), start(0), count(0) {}
  40. core::array< SFontArea > areas;
  41. s32 start;
  42. s32 count;
  43. };*/
  44. core::array<core::stringw> FontNames;
  45. core::array<core::stringw> CharSets;
  46. //core::array<SFontMap> Mappings;
  47. core::array<SFontArea> Areas;
  48. core::map<wchar_t, u32> CharMap;
  49. core::array<video::ITexture*> currentTextures;
  50. core::array<video::IImage*> currentImages;
  51. const int *FontSizes;
  52. IrrlichtDevice *Device;
  53. bool UseAlphaChannel;
  54. // windows
  55. #ifdef _IRR_WINDOWS_
  56. HDC dc;
  57. #endif
  58. };
  59. }
  60. #endif // IRR_FONT_TOOL_INCLUDED