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



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019