MRPT  2.0.0
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-2020, 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 /** Different style for vectorized font rendering \sa T2DTextData */
20 {
21  FILL = 0, ///< renders glyphs as filled polygons
22  OUTLINE = 1, ///< renders glyphs as outlines with GL_LINES
23 
24  /** This was "renders glyphs filled with antialiased outlines", but since
25  antialiased is not properly implemented in mrtp2 since the port to
26  OpenGL3, NICE is for now an alias for FILL. */
27  NICE = 2
28 };
29 
30 /** A description of a bitmapped or vectorized text font.
31  * (Vectorized fonts are recommended for new code).
32  *
33  * \sa mrpt::opengl::gl_utils::glSetFont(),
34  * mrpt::opengl::gl_utils::glDrawText()
35  */
37 {
38  TFontParams() = default;
39 
40  /** Vectorized font name ("sans","mono","serif") */
41  std::string vfont_name = "mono";
42 
43  /** Size of characters [pixels] */
44  float vfont_scale = 10.0f;
45 
46  mrpt::img::TColorf color = {1.0f, 1.0f, 1.0f, 1.0f};
47 
48  bool draw_shadow = false;
49  mrpt::img::TColorf shadow_color = {0.0f, 0.0f, 0.0f, 1.0f};
50 
51  /** (default: FILL) See TOpenGLFontStyle. */
53 
54  /** (default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText */
55  double vfont_spacing = 1.5;
56 
57  /** (default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText */
58  double vfont_kerning = 0.1;
59 };
60 
61 /** An auxiliary struct for holding a list of text messages in some mrpt::opengl
62  * & mrpt::gui classes
63  * The font can be either a bitmapped or a vectorized font.
64  * \sa mrpt::opengl::CTextMessageCapable
65  * \ingroup mrpt_opengl_grp
66  */
67 struct T2DTextData : public TFontParams
68 {
69  T2DTextData() = default;
70  std::string text;
71  double x{0}, y{0};
72 };
73 } // namespace mrpt::opengl
A description of a bitmapped or vectorized text font.
Definition: opengl_fonts.h:36
renders glyphs as outlines with GL_LINES
Definition: opengl_fonts.h:22
std::string vfont_name
Vectorized font name ("sans","mono","serif")
Definition: opengl_fonts.h:41
TOpenGLFontStyle
Different style for vectorized font rendering.
Definition: opengl_fonts.h:19
double vfont_kerning
(default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText
Definition: opengl_fonts.h:58
An auxiliary struct for holding a list of text messages in some mrpt::opengl & mrpt::gui classes The ...
Definition: opengl_fonts.h:67
double vfont_spacing
(default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText
Definition: opengl_fonts.h:55
An RGBA color - floats in the range [0,1].
Definition: TColor.h:88
This was "renders glyphs filled with antialiased outlines", but since antialiased is not properly imp...
Definition: opengl_fonts.h:27
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
mrpt::img::TColorf color
Definition: opengl_fonts.h:46
renders glyphs as filled polygons
Definition: opengl_fonts.h:21
mrpt::img::TColorf shadow_color
Definition: opengl_fonts.h:49
float vfont_scale
Size of characters [pixels].
Definition: opengl_fonts.h:44
TOpenGLFontStyle vfont_style
(default: FILL) See TOpenGLFontStyle.
Definition: opengl_fonts.h:52



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020