MRPT
1.9.9
opengl_fonts.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| http://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6
| See: http://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See details in http://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
10
#ifndef mrpt_opengl_fonts_H
11
#define mrpt_opengl_fonts_H
12
13
#include <
mrpt/img/TColor.h
>
14
#include <
mrpt/core/common.h
>
// disable warnings
15
#include <string>
16
17
namespace
mrpt::opengl
18
{
19
/** Existing fonts for 2D texts in mrpt::opengl methods.
20
* \sa mrpt::opengl::CWxGLCanvasBase::renderTextBitmap
21
* \ingroup mrpt_opengl_grp
22
*/
23
enum
TOpenGLFont
24
{
25
MRPT_GLUT_BITMAP_NONE
= -1,
26
MRPT_GLUT_BITMAP_TIMES_ROMAN_10
= 0,
27
MRPT_GLUT_BITMAP_TIMES_ROMAN_24
= 1,
28
MRPT_GLUT_BITMAP_HELVETICA_10
= 2,
29
MRPT_GLUT_BITMAP_HELVETICA_12
= 3,
30
MRPT_GLUT_BITMAP_HELVETICA_18
= 4
31
};
32
33
/** Different style for vectorized font rendering \sa T2DTextData */
34
enum
TOpenGLFontStyle
35
{
36
FILL
= 0,
///< renders glyphs as filled polygons
37
OUTLINE
= 1,
///< renders glyphs as outlines with GL_LINES
38
NICE
= 2
///< renders glyphs filled with antialiased outlines
39
};
40
41
/** A description of a bitmapped or vectorized text font.
42
* (Vectorized fonts are recommended for new code).
43
*
44
* \sa mrpt::opengl::gl_utils::glSetFont(),
45
* mrpt::opengl::gl_utils::glDrawText()
46
*/
47
struct
TFontParams
48
{
49
TFontParams
()
50
:
draw_shadow
(false),
51
font
(
MRPT_GLUT_BITMAP_NONE
),
52
vfont_name
(
"sans"
),
53
vfont_scale
(10),
54
vfont_style
(),
55
vfont_spacing
(1.5),
56
vfont_kerning
(0.1)
57
{
58
}
59
60
mrpt::img::TColorf
color
;
61
62
bool
draw_shadow
;
63
mrpt::img::TColorf
shadow_color
;
64
65
/** @name Bitmapped font params
66
@{ */
67
mrpt::opengl::TOpenGLFont
font
;
68
/** @} */
69
70
/** @name Vectorized font params - Applicable only if
71
font==MRPT_GLUT_BITMAP_NONE
72
@{ */
73
/** Vectorized font name ("sans","mono","serif") */
74
std::string
vfont_name
;
75
/** Size of characters */
76
double
vfont_scale
;
77
/** (default: NICE) See TOpenGLFontStyle. */
78
TOpenGLFontStyle
vfont_style
;
79
/** (default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText */
80
double
vfont_spacing
;
81
/** (default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText */
82
double
vfont_kerning
;
83
/** @} */
84
};
85
86
/** An auxiliary struct for holding a list of text messages in some mrpt::opengl
87
* & mrpt::gui classes
88
* The font can be either a bitmapped or a vectorized font.
89
* \sa mrpt::opengl::CTextMessageCapable
90
* \ingroup mrpt_opengl_grp
91
*/
92
struct
T2DTextData
:
public
TFontParams
93
{
94
T2DTextData
() :
x
(0),
y
(0) {}
95
std::string
text
;
96
double
x
,
y
;
97
};
98
}
99
#endif
100
101
mrpt::opengl::TFontParams::TFontParams
TFontParams()
Definition:
opengl_fonts.h:49
mrpt::opengl::TFontParams::font
mrpt::opengl::TOpenGLFont font
Definition:
opengl_fonts.h:67
mrpt::opengl::T2DTextData::text
std::string text
Definition:
opengl_fonts.h:95
mrpt::opengl::T2DTextData::T2DTextData
T2DTextData()
Definition:
opengl_fonts.h:94
mrpt::opengl::TFontParams
A description of a bitmapped or vectorized text font.
Definition:
opengl_fonts.h:47
mrpt::opengl::T2DTextData::y
double y
Definition:
opengl_fonts.h:96
mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_10
Definition:
opengl_fonts.h:26
mrpt::opengl::OUTLINE
renders glyphs as outlines with GL_LINES
Definition:
opengl_fonts.h:37
mrpt::opengl::TFontParams::vfont_name
std::string vfont_name
Vectorized font name ("sans","mono","serif")
Definition:
opengl_fonts.h:74
mrpt::opengl::T2DTextData::x
double x
Definition:
opengl_fonts.h:96
mrpt::opengl::TOpenGLFont
TOpenGLFont
Existing fonts for 2D texts in mrpt::opengl methods.
Definition:
opengl_fonts.h:23
mrpt::opengl::TOpenGLFontStyle
TOpenGLFontStyle
Different style for vectorized font rendering.
Definition:
opengl_fonts.h:34
mrpt::opengl::TFontParams::vfont_kerning
double vfont_kerning
(default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText
Definition:
opengl_fonts.h:82
mrpt::opengl::T2DTextData
An auxiliary struct for holding a list of text messages in some mrpt::opengl & mrpt::gui classes The ...
Definition:
opengl_fonts.h:92
string
GLsizei const GLchar ** string
Definition:
glext.h:4101
mrpt::opengl::TFontParams::draw_shadow
bool draw_shadow
Definition:
opengl_fonts.h:62
mrpt::opengl::TFontParams::vfont_spacing
double vfont_spacing
(default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText
Definition:
opengl_fonts.h:80
mrpt::opengl::MRPT_GLUT_BITMAP_NONE
Definition:
opengl_fonts.h:25
mrpt::img::TColorf
A RGB color - floats in the range [0,1].
Definition:
TColor.h:77
mrpt::opengl::NICE
renders glyphs filled with antialiased outlines
Definition:
opengl_fonts.h:38
mrpt::opengl
The namespace for 3D scene representation and rendering.
Definition:
CGlCanvasBase.h:15
y
GLenum GLint GLint y
Definition:
glext.h:3538
mrpt::opengl::TFontParams::color
mrpt::img::TColorf color
Definition:
opengl_fonts.h:60
common.h
mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24
Definition:
opengl_fonts.h:27
mrpt::opengl::MRPT_GLUT_BITMAP_HELVETICA_12
Definition:
opengl_fonts.h:29
x
GLenum GLint x
Definition:
glext.h:3538
TColor.h
mrpt::opengl::FILL
renders glyphs as filled polygons
Definition:
opengl_fonts.h:36
mrpt::opengl::MRPT_GLUT_BITMAP_HELVETICA_10
Definition:
opengl_fonts.h:28
mrpt::opengl::TFontParams::shadow_color
mrpt::img::TColorf shadow_color
Definition:
opengl_fonts.h:63
mrpt::opengl::TFontParams::vfont_scale
double vfont_scale
Size of characters.
Definition:
opengl_fonts.h:76
mrpt::opengl::TFontParams::vfont_style
TOpenGLFontStyle vfont_style
(default: NICE) See TOpenGLFontStyle.
Definition:
opengl_fonts.h:78
mrpt::opengl::MRPT_GLUT_BITMAP_HELVETICA_18
Definition:
opengl_fonts.h:30
Page generated by
Doxygen 1.8.14
for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020