Main MRPT website
>
C++ reference
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
mrpt
opengl
opengl_fonts.h
Go to the documentation of this file.
1
/* +---------------------------------------------------------------------------+
2
| The Mobile Robot Programming Toolkit (MRPT) C++ library |
3
| |
4
| http://www.mrpt.org/ |
5
| |
6
| Copyright (C) 2005-2012 University of Malaga |
7
| |
8
| This software was written by the Machine Perception and Intelligent |
9
| Robotics Lab, University of Malaga (Spain). |
10
| Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11
| |
12
| This file is part of the MRPT project. |
13
| |
14
| MRPT is free software: you can redistribute it and/or modify |
15
| it under the terms of the GNU General Public License as published by |
16
| the Free Software Foundation, either version 3 of the License, or |
17
| (at your option) any later version. |
18
| |
19
| MRPT is distributed in the hope that it will be useful, |
20
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
21
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22
| GNU General Public License for more details. |
23
| |
24
| You should have received a copy of the GNU General Public License |
25
| along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26
| |
27
+---------------------------------------------------------------------------+ */
28
29
#ifndef mrpt_opengl_fonts_H
30
#define mrpt_opengl_fonts_H
31
32
#include <
mrpt/utils/TColor.h
>
33
#include <
mrpt/utils/types.h
>
34
#include <
mrpt/opengl/link_pragmas.h
>
35
36
namespace
mrpt
37
{
38
namespace
opengl
39
{
40
/** Existing fonts for 2D texts in mrpt::opengl methods.
41
* \sa mrpt::opengl::CMyGLCanvasBase::renderTextBitmap
42
* \ingroup mrpt_opengl_grp
43
*/
44
enum
TOpenGLFont
45
{
46
MRPT_GLUT_BITMAP_NONE
= -1,
47
MRPT_GLUT_BITMAP_TIMES_ROMAN_10
= 0,
48
MRPT_GLUT_BITMAP_TIMES_ROMAN_24
= 1,
49
MRPT_GLUT_BITMAP_HELVETICA_10
= 2,
50
MRPT_GLUT_BITMAP_HELVETICA_12
= 3,
51
MRPT_GLUT_BITMAP_HELVETICA_18
= 4
52
};
53
54
/** Different style for vectorized font rendering \sa T2DTextData */
55
enum
TOpenGLFontStyle
{
56
FILL
= 0,
///< renders glyphs as filled polygons
57
OUTLINE
= 1,
///< renders glyphs as outlines with GL_LINES
58
NICE
= 2
///< renders glyphs filled with antialiased outlines
59
};
60
61
/** A description of a bitmapped or vectorized text font.
62
* (Vectorized fonts are recommended for new code).
63
*
64
* \sa mrpt::opengl::gl_utils::glSetFont(), mrpt::opengl::gl_utils::glDrawText()
65
*/
66
struct
OPENGL_IMPEXP
TFontParams
67
{
68
TFontParams
() :
69
font(
MRPT_GLUT_BITMAP_NONE
),
70
vfont_name(
"sans"
),
71
vfont_scale(10),
72
vfont_style(),
73
vfont_spacing(1.5),
74
vfont_kerning(0.1)
75
{
76
}
77
78
mrpt::utils::TColorf
color
;
79
80
/** @name Bitmapped font params
81
@{ */
82
mrpt::opengl::TOpenGLFont
font
;
83
/** @} */
84
85
/** @name Vectorized font params - Applicable only if font==MRPT_GLUT_BITMAP_NONE
86
@{ */
87
std::string
vfont_name
;
//!< Vectorized font name ("sans","mono","serif")
88
double
vfont_scale
;
//!< Size of characters
89
TOpenGLFontStyle
vfont_style
;
//!< (default: NICE) See TOpenGLFontStyle.
90
double
vfont_spacing
;
//!< (default: 1.5) Refer to mrpt::opengl::gl_utils::glDrawText
91
double
vfont_kerning
;
//!< (default: 0.1) Refer to mrpt::opengl::gl_utils::glDrawText
92
/** @} */
93
};
94
95
/** An auxiliary struct for holding a list of text messages in some mrpt::opengl & mrpt::gui classes
96
* The font can be either a bitmapped or a vectorized font.
97
* \sa mrpt::opengl::CTextMessageCapable
98
* \ingroup mrpt_opengl_grp
99
*/
100
struct
OPENGL_IMPEXP
T2DTextData
:
public
TFontParams
101
{
102
T2DTextData
() { }
103
104
std::string
text
;
105
double
x,
y
;
106
};
107
108
}
109
}
110
111
#endif
Page generated by
Doxygen 1.8.3
for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013