Main MRPT website > C++ reference for 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
18 {
19 namespace opengl
20 {
21 /** Existing fonts for 2D texts in mrpt::opengl methods.
22  * \sa mrpt::opengl::CWxGLCanvasBase::renderTextBitmap
23  * \ingroup mrpt_opengl_grp
24  */
26 {
33 };
34 
35 /** Different style for vectorized font rendering \sa T2DTextData */
37 {
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(),
47  * mrpt::opengl::gl_utils::glDrawText()
48  */
50 {
52  : draw_shadow(false),
54  vfont_name("sans"),
55  vfont_scale(10),
56  vfont_style(),
57  vfont_spacing(1.5),
58  vfont_kerning(0.1)
59  {
60  }
61 
63 
66 
67  /** @name Bitmapped font params
68  @{ */
70  /** @} */
71 
72  /** @name Vectorized font params - Applicable only if
73  font==MRPT_GLUT_BITMAP_NONE
74  @{ */
75  /** Vectorized font name ("sans","mono","serif") */
77  /** Size of characters */
78  double vfont_scale;
79  /** (default: NICE) See TOpenGLFontStyle. */
81  /** (default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText */
82  double vfont_spacing;
83  /** (default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText */
84  double vfont_kerning;
85  /** @} */
86 };
87 
88 /** An auxiliary struct for holding a list of text messages in some mrpt::opengl
89  * & mrpt::gui classes
90  * The font can be either a bitmapped or a vectorized font.
91  * \sa mrpt::opengl::CTextMessageCapable
92  * \ingroup mrpt_opengl_grp
93  */
94 struct T2DTextData : public TFontParams
95 {
96  T2DTextData() : x(0), y(0) {}
98  double x, y;
99 };
100 }
101 }
102 
103 #endif
mrpt::opengl::TOpenGLFont
TOpenGLFont
Existing fonts for 2D texts in mrpt::opengl methods.
Definition: opengl_fonts.h:25
mrpt::opengl::TFontParams
A description of a bitmapped or vectorized text font.
Definition: opengl_fonts.h:49
mrpt::opengl::T2DTextData::x
double x
Definition: opengl_fonts.h:98
mrpt::opengl::T2DTextData::T2DTextData
T2DTextData()
Definition: opengl_fonts.h:96
mrpt::opengl::TOpenGLFontStyle
TOpenGLFontStyle
Different style for vectorized font rendering.
Definition: opengl_fonts.h:36
mrpt::opengl::NICE
@ NICE
renders glyphs filled with antialiased outlines
Definition: opengl_fonts.h:40
mrpt::opengl::OUTLINE
@ OUTLINE
renders glyphs as outlines with GL_LINES
Definition: opengl_fonts.h:39
mrpt::opengl::MRPT_GLUT_BITMAP_HELVETICA_10
@ MRPT_GLUT_BITMAP_HELVETICA_10
Definition: opengl_fonts.h:30
mrpt::opengl::MRPT_GLUT_BITMAP_NONE
@ MRPT_GLUT_BITMAP_NONE
Definition: opengl_fonts.h:27
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::opengl::TFontParams::color
mrpt::img::TColorf color
Definition: opengl_fonts.h:62
mrpt::opengl::TFontParams::vfont_style
TOpenGLFontStyle vfont_style
(default: NICE) See TOpenGLFontStyle.
Definition: opengl_fonts.h:80
mrpt::opengl::MRPT_GLUT_BITMAP_HELVETICA_12
@ MRPT_GLUT_BITMAP_HELVETICA_12
Definition: opengl_fonts.h:31
mrpt::opengl::T2DTextData::text
std::string text
Definition: opengl_fonts.h:97
mrpt::opengl::MRPT_GLUT_BITMAP_HELVETICA_18
@ MRPT_GLUT_BITMAP_HELVETICA_18
Definition: opengl_fonts.h:32
mrpt::opengl::TFontParams::shadow_color
mrpt::img::TColorf shadow_color
Definition: opengl_fonts.h:65
mrpt::opengl::TFontParams::vfont_scale
double vfont_scale
Size of characters.
Definition: opengl_fonts.h:78
mrpt::opengl::TFontParams::TFontParams
TFontParams()
Definition: opengl_fonts.h:51
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:94
mrpt::img::TColorf
A RGB color - floats in the range [0,1].
Definition: TColor.h:79
mrpt::opengl::TFontParams::vfont_spacing
double vfont_spacing
(default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText
Definition: opengl_fonts.h:82
mrpt::opengl::TFontParams::vfont_kerning
double vfont_kerning
(default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText
Definition: opengl_fonts.h:84
mrpt::opengl::FILL
@ FILL
renders glyphs as filled polygons
Definition: opengl_fonts.h:38
common.h
mrpt::opengl::T2DTextData::y
double y
Definition: opengl_fonts.h:98
mrpt::opengl::TFontParams::font
mrpt::opengl::TOpenGLFont font
Definition: opengl_fonts.h:69
mrpt::opengl::TFontParams::draw_shadow
bool draw_shadow
Definition: opengl_fonts.h:64
mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_10
@ MRPT_GLUT_BITMAP_TIMES_ROMAN_10
Definition: opengl_fonts.h:28
mrpt::opengl::TFontParams::vfont_name
std::string vfont_name
Vectorized font name ("sans","mono","serif")
Definition: opengl_fonts.h:76
string
GLsizei const GLchar ** string
Definition: glext.h:4101
y
GLenum GLint GLint y
Definition: glext.h:3538
mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24
@ MRPT_GLUT_BITMAP_TIMES_ROMAN_24
Definition: opengl_fonts.h:29
TColor.h
x
GLenum GLint x
Definition: glext.h:3538



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST