Main MRPT website
>
C++ reference for MRPT 1.5.9
mrpt
opengl
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-2017, 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/utils/TColor.h
>
14
#include <
mrpt/utils/compiler_fixes.h
>
// disable warnings
15
#include <
mrpt/opengl/link_pragmas.h
>
16
#include <string>
17
18
namespace
mrpt
19
{
20
namespace
opengl
21
{
22
/** Existing fonts for 2D texts in mrpt::opengl methods.
23
* \sa mrpt::opengl::CMyGLCanvasBase::renderTextBitmap
24
* \ingroup mrpt_opengl_grp
25
*/
26
enum
TOpenGLFont
27
{
28
MRPT_GLUT_BITMAP_NONE
= -1,
29
MRPT_GLUT_BITMAP_TIMES_ROMAN_10
= 0,
30
MRPT_GLUT_BITMAP_TIMES_ROMAN_24
= 1,
31
MRPT_GLUT_BITMAP_HELVETICA_10
= 2,
32
MRPT_GLUT_BITMAP_HELVETICA_12
= 3,
33
MRPT_GLUT_BITMAP_HELVETICA_18
= 4
34
};
35
36
/** Different style for vectorized font rendering \sa T2DTextData */
37
enum
TOpenGLFontStyle
{
38
FILL
= 0,
///< renders glyphs as filled polygons
39
OUTLINE
= 1,
///< renders glyphs as outlines with GL_LINES
40
NICE
= 2
///< renders glyphs filled with antialiased outlines
41
};
42
43
/** A description of a bitmapped or vectorized text font.
44
* (Vectorized fonts are recommended for new code).
45
*
46
* \sa mrpt::opengl::gl_utils::glSetFont(), mrpt::opengl::gl_utils::glDrawText()
47
*/
48
struct
OPENGL_IMPEXP
TFontParams
49
{
50
TFontParams
() :
51
draw_shadow(false),
52
font(
MRPT_GLUT_BITMAP_NONE
),
53
vfont_name(
"sans"
),
54
vfont_scale(10),
55
vfont_style(),
56
vfont_spacing(1.5),
57
vfont_kerning(0.1)
58
{
59
}
60
61
mrpt::utils::TColorf
color
;
62
63
bool
draw_shadow
;
64
mrpt::utils::TColorf
shadow_color
;
65
66
/** @name Bitmapped font params
67
@{ */
68
mrpt::opengl::TOpenGLFont
font
;
69
/** @} */
70
71
/** @name Vectorized font params - Applicable only if font==MRPT_GLUT_BITMAP_NONE
72
@{ */
73
std::string
vfont_name
;
//!< Vectorized font name ("sans","mono","serif")
74
double
vfont_scale
;
//!< Size of characters
75
TOpenGLFontStyle
vfont_style
;
//!< (default: NICE) See TOpenGLFontStyle.
76
double
vfont_spacing
;
//!< (default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText
77
double
vfont_kerning
;
//!< (default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText
78
/** @} */
79
};
80
81
/** An auxiliary struct for holding a list of text messages in some mrpt::opengl & mrpt::gui classes
82
* The font can be either a bitmapped or a vectorized font.
83
* \sa mrpt::opengl::CTextMessageCapable
84
* \ingroup mrpt_opengl_grp
85
*/
86
struct
OPENGL_IMPEXP
T2DTextData
:
public
TFontParams
87
{
88
T2DTextData
() :
x
(0),
y
(0) { }
89
90
std::string
text
;
91
double
x
,
y
;
92
};
93
94
}
95
}
96
97
#endif
mrpt::opengl::TFontParams::TFontParams
TFontParams()
Definition:
opengl_fonts.h:50
mrpt::opengl::TFontParams::font
mrpt::opengl::TOpenGLFont font
Definition:
opengl_fonts.h:68
mrpt::opengl::TFontParams::shadow_color
mrpt::utils::TColorf shadow_color
Definition:
opengl_fonts.h:64
compiler_fixes.h
mrpt::opengl::T2DTextData::text
std::string text
Definition:
opengl_fonts.h:90
mrpt::opengl::T2DTextData::T2DTextData
T2DTextData()
Definition:
opengl_fonts.h:88
mrpt::opengl::TFontParams
A description of a bitmapped or vectorized text font.
Definition:
opengl_fonts.h:48
mrpt::opengl::T2DTextData::y
double y
Definition:
opengl_fonts.h:91
mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_10
Definition:
opengl_fonts.h:29
mrpt::opengl::OUTLINE
renders glyphs as outlines with GL_LINES
Definition:
opengl_fonts.h:39
mrpt::opengl::TFontParams::vfont_name
std::string vfont_name
Vectorized font name ("sans","mono","serif")
Definition:
opengl_fonts.h:73
mrpt::opengl::TOpenGLFont
TOpenGLFont
Existing fonts for 2D texts in mrpt::opengl methods.
Definition:
opengl_fonts.h:26
mrpt::opengl::TOpenGLFontStyle
TOpenGLFontStyle
Different style for vectorized font rendering.
Definition:
opengl_fonts.h:37
mrpt::opengl::TFontParams::vfont_kerning
double vfont_kerning
(default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText
Definition:
opengl_fonts.h:77
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:86
string
GLsizei const GLchar ** string
Definition:
glext.h:3919
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition:
CParticleFilter.h:16
mrpt::opengl::TFontParams::color
mrpt::utils::TColorf color
Definition:
opengl_fonts.h:61
mrpt::opengl::TFontParams::draw_shadow
bool draw_shadow
Definition:
opengl_fonts.h:63
mrpt::opengl::TFontParams::vfont_spacing
double vfont_spacing
(default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText
Definition:
opengl_fonts.h:76
mrpt::opengl::MRPT_GLUT_BITMAP_NONE
Definition:
opengl_fonts.h:28
mrpt::opengl::NICE
renders glyphs filled with antialiased outlines
Definition:
opengl_fonts.h:40
mrpt::utils::TColorf
A RGB color - floats in the range [0,1].
Definition:
TColor.h:80
y
GLenum GLint GLint y
Definition:
glext.h:3516
mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24
Definition:
opengl_fonts.h:30
link_pragmas.h
mrpt::opengl::MRPT_GLUT_BITMAP_HELVETICA_12
Definition:
opengl_fonts.h:32
x
GLenum GLint x
Definition:
glext.h:3516
OPENGL_IMPEXP
#define OPENGL_IMPEXP
Definition:
opengl/include/mrpt/opengl/link_pragmas.h:42
TColor.h
mrpt::opengl::FILL
renders glyphs as filled polygons
Definition:
opengl_fonts.h:38
mrpt::opengl::MRPT_GLUT_BITMAP_HELVETICA_10
Definition:
opengl_fonts.h:31
mrpt::opengl::TFontParams::vfont_scale
double vfont_scale
Size of characters.
Definition:
opengl_fonts.h:74
mrpt::opengl::TFontParams::vfont_style
TOpenGLFontStyle vfont_style
(default: NICE) See TOpenGLFontStyle.
Definition:
opengl_fonts.h:75
mrpt::opengl::MRPT_GLUT_BITMAP_HELVETICA_18
Definition:
opengl_fonts.h:33
Page generated by
Doxygen 1.8.14
for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020