MeVisLab Toolbox Reference
View2DFontFTGL.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2012, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13
15
16#pragma once
17
18#include "View2DFont.h"
19#include "mlGL2DFont.h"
20
23{
24public:
26 ~View2DFontFTGL() override;
27
30 bool init(const char* fontname = nullptr) override;
31
33 int getFontHeight(float fontSize) const override;
34
36 int getFontAscender(float fontSize) const override;
37
39 int getFontDescender(float fontSize) const override;
40
42 int getStringWidth(float fontSize, const char* string, int len = -1) const override;
43
47 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;
48
49private:
50 ML_OPENGL_NAMESPACE::GL2DFont *_font;
51};
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
bool init(const char *fontname=nullptr) override
int getFontHeight(float fontSize) const override
get height of font (ascender + descender)
int getStringWidth(float fontSize, const char *string, int len=-1) const override
get width of simple string
~View2DFontFTGL() override
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
int getFontAscender(float fontSize) const override
get ascender of font
int getFontDescender(float fontSize) const override
get descender of font