MeVisLabToolboxReference
MeVisLab/Standard/Sources/Inventor/SoView2D/View2DFontQt.h
Go to the documentation of this file.
00001 #ifndef __View2DFontQt_H
00002 #define __View2DFontQt_H
00003 //----------------------------------------------------------------------------------
00004 // **InsertLicense** code
00005 //----------------------------------------------------------------------------------
00007 
00013 //----------------------------------------------------------------------------------
00014 
00015 #include "View2DFont.h"
00016 
00017 #include <QFont>
00018 
00019 class View2DShader;
00020 
00022 class SOVIEW2D_API View2DFontQt : public View2DFont {
00023 
00024 public:
00025   View2DFontQt();
00026   virtual ~View2DFontQt();
00027 
00030   virtual bool   init(const char* fontname = NULL);
00031 
00033   virtual int    getFontHeight(float fontSize) const;
00034 
00036   virtual int    getFontAscender(float fontSize) const;
00037 
00039   virtual int    getFontDescender(float fontSize) const;
00040 
00042   virtual int    getStringWidth(float fontSize, const char* string, int len) const;
00043 
00045   virtual void   drawString(float dx, float dy, float fontSize, const float* color, const char* string, int length, bool shadow=true);
00046 
00047 private:
00048   static int fontSizeToPointSize(float fontSize);
00049 
00050   QFont _baseFont;
00051   View2DShader* _haloShader;
00052 };
00053 
00054 #endif