Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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
16#include <string>
17
18namespace 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 */
35
36 /** Different style for vectorized font rendering \sa T2DTextData */
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 */
49 {
51 draw_shadow(false),
53 vfont_name("sans"),
54 vfont_scale(10),
55 vfont_style(),
56 vfont_spacing(1.5),
57 vfont_kerning(0.1)
58 {
59 }
60
62
65
66 /** @name Bitmapped font params
67 @{ */
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 */
87 {
88 T2DTextData() : x(0),y(0) { }
89
90 std::string text;
91 double x,y;
92 };
93
94 }
95}
96
97#endif
TOpenGLFont
Existing fonts for 2D texts in mrpt::opengl methods.
@ MRPT_GLUT_BITMAP_TIMES_ROMAN_24
@ MRPT_GLUT_BITMAP_HELVETICA_18
@ MRPT_GLUT_BITMAP_HELVETICA_12
@ MRPT_GLUT_BITMAP_HELVETICA_10
@ MRPT_GLUT_BITMAP_TIMES_ROMAN_10
TOpenGLFontStyle
Different style for vectorized font rendering.
@ NICE
renders glyphs filled with antialiased outlines
@ FILL
renders glyphs as filled polygons
@ OUTLINE
renders glyphs as outlines with GL_LINES
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
An auxiliary struct for holding a list of text messages in some mrpt::opengl & mrpt::gui classes The ...
A description of a bitmapped or vectorized text font.
mrpt::opengl::TOpenGLFont font
TOpenGLFontStyle vfont_style
(default: NICE) See TOpenGLFontStyle.
std::string vfont_name
Vectorized font name ("sans","mono","serif")
double vfont_scale
Size of characters.
double vfont_kerning
(default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText
double vfont_spacing
(default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText
mrpt::utils::TColorf color
mrpt::utils::TColorf shadow_color
A RGB color - floats in the range [0,1].
Definition TColor.h:53



Page generated by Doxygen 1.9.8 for MRPT 1.4.0 SVN: at Wed Dec 6 15:06:50 UTC 2023