MeVisLabToolboxReference
|
00001 #ifndef __View2DFont_H 00002 #define __View2DFont_H 00003 //---------------------------------------------------------------------------------- 00004 // **InsertLicense** code 00005 //---------------------------------------------------------------------------------- 00007 00013 //---------------------------------------------------------------------------------- 00014 00015 #include "SoView2DSystem.h" 00016 00020 00026 class SOVIEW2D_API View2DFont { 00027 00028 public: 00029 View2DFont(); 00030 virtual ~View2DFont(); 00031 00033 enum AlignXMode { 00034 ALIGN_LEFT, 00035 ALIGN_RIGHT, 00036 ALIGN_CENTER 00037 }; 00038 00041 virtual bool init(const char* fontname = NULL) = 0; 00042 00044 virtual int getFontHeight(float fontSize) const = 0; 00045 00047 virtual int getFontAscender(float fontSize) const = 0; 00048 00050 virtual int getFontDescender(float fontSize) const = 0; 00051 00053 virtual int getStringWidth(float fontSize, const char* string, int len) const = 0; 00054 00056 virtual void drawString(float dx, float dy, float fontSize, const float* color, const char* string, int length, bool shadow=true) = 0; 00057 00059 virtual void getTextSize(float fontSize, const char* text, int &width, int &height, float lineSpacing = 0.0f) const; 00060 00062 virtual void drawText(float dx, float dy, float fontSize, const float* color, const char* text, AlignXMode mode, bool shadow=true, float lineSpacing = 0.0f); 00063 00064 }; 00065 00066 #endif