MeVisLab Toolbox Reference
View2DFontQt Class Reference

Qt based implementation of View2DFont. More...

#include <View2DFontQt.h>

Inheritance diagram for View2DFontQt:
View2DFont

Public Member Functions

 View2DFontQt ()
 
 ~View2DFontQt () override
 
bool init (const char *fontname=nullptr) override
 init with given font (either just a font name without .ttf or an absolute path) requires a valid GL context! More...
 
int getFontHeight (float fontSize) const override
 get height of font (ascender + descender) More...
 
int getFontAscender (float fontSize) const override
 get ascender of font More...
 
int getFontDescender (float fontSize) const override
 get descender of font More...
 
int getStringWidth (float fontSize, const char *string, int len) const override
 get width of simple string More...
 
void drawString (float dx, float dy, float fontSize, const float *color, const char *string, int length, bool shadow=true, const float *shadowColor=nullptr, bool flipped=false) override
 draws a simple string with no line feeds, the drawing starts at the top-left corner color needs to point to a float[4] array (RGBA) shadowColor is optional and needs to point to a float[3] array (RGB), alpha is taken from color. More...
 
- Public Member Functions inherited from View2DFont
 View2DFont ()
 
virtual ~View2DFont ()
 
void drawStringFlipped (float dx, float dy, float fontSize, const float *color, const char *string, int length, bool shadow=true, const float *shadowColor=nullptr)
 as above for drawing a string up-side down where you don't need to specify all parameters More...
 
virtual void getTextSize (float fontSize, const char *text, int &width, int &height, float lineSpacing=0.0f) const
 returns size of the box spanned by text box More...
 
virtual void drawText (float dx, float dy, float fontSize, const float *color, const char *text, AlignXMode mode, bool shadow=true, float lineSpacing=0.0f, const float *shadowColor=nullptr)
 draws a multi-line text, lines are separated by
, the drawing starts at the top-left corner. More...
 

Additional Inherited Members

- Public Types inherited from View2DFont
enum  AlignXMode { ALIGN_LEFT , ALIGN_RIGHT , ALIGN_CENTER }
 align mode of multi-line text More...
 
- Static Public Member Functions inherited from View2DFont
static View2DFontglobalFont ()
 get the global font used for annotations etc. (only call this within a valid GL context!) More...
 
static View2DFontcreateFont (const char *fontname=nullptr)
 create a new font object with the given font name (/see init). More...
 

Detailed Description

Qt based implementation of View2DFont.

Definition at line 25 of file View2DFontQt.h.

Constructor & Destructor Documentation

◆ View2DFontQt()

View2DFontQt::View2DFontQt ( )

◆ ~View2DFontQt()

View2DFontQt::~View2DFontQt ( )
override

Member Function Documentation

◆ drawString()

void View2DFontQt::drawString ( float  dx,
float  dy,
float  fontSize,
const float *  color,
const char *  string,
int  length,
bool  shadow = true,
const float *  shadowColor = nullptr,
bool  flipped = false 
)
overridevirtual

draws a simple string with no line feeds, the drawing starts at the top-left corner color needs to point to a float[4] array (RGBA) shadowColor is optional and needs to point to a float[3] array (RGB), alpha is taken from color.

Implements View2DFont.

◆ getFontAscender()

int View2DFontQt::getFontAscender ( float  fontSize) const
overridevirtual

get ascender of font

Implements View2DFont.

◆ getFontDescender()

int View2DFontQt::getFontDescender ( float  fontSize) const
overridevirtual

get descender of font

Implements View2DFont.

◆ getFontHeight()

int View2DFontQt::getFontHeight ( float  fontSize) const
overridevirtual

get height of font (ascender + descender)

Implements View2DFont.

◆ getStringWidth()

int View2DFontQt::getStringWidth ( float  fontSize,
const char *  string,
int  len 
) const
overridevirtual

get width of simple string

Implements View2DFont.

◆ init()

bool View2DFontQt::init ( const char *  fontname = nullptr)
overridevirtual

init with given font (either just a font name without .ttf or an absolute path) requires a valid GL context!

Implements View2DFont.


The documentation for this class was generated from the following file: