Qt based implementation of View2DFont.
More...
#include <View2DFontQt.h>
|
| | View2DFontQt () |
| | ~View2DFontQt () override |
| bool | init (const char *fontname=nullptr) override |
| int | getFontHeight (float fontSize) const override |
| | get height of font (ascender + descender)
|
| int | getFontAscender (float fontSize) const override |
| | get ascender of font
|
| int | getFontDescender (float fontSize) const override |
| | get descender of font
|
| int | getStringWidth (float fontSize, const char *string, int len=-1) const override |
| | get width of simple string
|
| 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 |
| | 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
|
| 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
|
| 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) |
Qt based implementation of View2DFont.
Definition at line 25 of file View2DFontQt.h.
◆ View2DFontQt()
| View2DFontQt::View2DFontQt |
( |
| ) |
|
◆ ~View2DFontQt()
| View2DFontQt::~View2DFontQt |
( |
| ) |
|
|
override |
◆ 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 |
◆ getFontDescender()
| int View2DFontQt::getFontDescender |
( |
float | fontSize | ) |
const |
|
overridevirtual |
◆ 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 = -1 ) const |
|
overridevirtual |
◆ 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: