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  */
24 {
31 };
32 
33 /** Different style for vectorized font rendering \sa T2DTextData */
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  */
48 {
50  : draw_shadow(false),
52  vfont_name("sans"),
53  vfont_scale(10),
54  vfont_style(),
55  vfont_spacing(1.5),
56  vfont_kerning(0.1)
57  {
58  }
59 
61 
64 
65  /** @name Bitmapped font params
66  @{ */
68  /** @} */
69 
70  /** @name Vectorized font params - Applicable only if
71  font==MRPT_GLUT_BITMAP_NONE
72  @{ */
73  /** Vectorized font name ("sans","mono","serif") */
75  /** Size of characters */
76  double vfont_scale;
77  /** (default: NICE) See TOpenGLFontStyle. */
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) {}
96  double x, y;
97 };
98 }
99 #endif
100 
101 
mrpt::opengl::TOpenGLFont font
Definition: opengl_fonts.h:67
A description of a bitmapped or vectorized text font.
Definition: opengl_fonts.h:47
renders glyphs as outlines with GL_LINES
Definition: opengl_fonts.h:37
std::string vfont_name
Vectorized font name ("sans","mono","serif")
Definition: opengl_fonts.h:74
TOpenGLFont
Existing fonts for 2D texts in mrpt::opengl methods.
Definition: opengl_fonts.h:23
TOpenGLFontStyle
Different style for vectorized font rendering.
Definition: opengl_fonts.h:34
double vfont_kerning
(default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText
Definition: opengl_fonts.h:82
An auxiliary struct for holding a list of text messages in some mrpt::opengl & mrpt::gui classes The ...
Definition: opengl_fonts.h:92
GLsizei const GLchar ** string
Definition: glext.h:4101
double vfont_spacing
(default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText
Definition: opengl_fonts.h:80
A RGB color - floats in the range [0,1].
Definition: TColor.h:77
renders glyphs filled with antialiased outlines
Definition: opengl_fonts.h:38
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
GLenum GLint GLint y
Definition: glext.h:3538
mrpt::img::TColorf color
Definition: opengl_fonts.h:60
GLenum GLint x
Definition: glext.h:3538
renders glyphs as filled polygons
Definition: opengl_fonts.h:36
mrpt::img::TColorf shadow_color
Definition: opengl_fonts.h:63
double vfont_scale
Size of characters.
Definition: opengl_fonts.h:76
TOpenGLFontStyle vfont_style
(default: NICE) See TOpenGLFontStyle.
Definition: opengl_fonts.h:78



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