FTGL 2.4.0

FTSimpleLayout.h
Go to the documentation of this file.
1/*
2 * FTGL - OpenGL font library
3 *
4 * Copyright (c) 2001-2004 Henry Maddocks <ftgl@opengl.geek.nz>
5 * Copyright (c) 2008 Sam Hocevar <sam@hocevar.net>
6 * Copyright (c) 2008 Sean Morrison <learner@brlcad.org>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining
9 * a copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sublicense, and/or sell copies of the Software, and to
13 * permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be
17 * included in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
23 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 */
27
28#ifndef __ftgl__
29# warning This header is deprecated. Please use <FTGL/ftgl.h> from now.
30# include <FTGL/ftgl.h>
31#endif
32
33#ifndef __FTSimpleLayout__
34#define __FTSimpleLayout__
35
36#ifdef __cplusplus
37
38
39 class FTFont;
40
49 class FTGL_EXPORT FTSimpleLayout : public FTLayout
50{
51 public:
56 FTSimpleLayout();
57
61 ~FTSimpleLayout();
62
73 virtual FTBBox BBox(const char* string, const int len = -1,
74 FTPoint position = FTPoint());
75
86 virtual FTBBox BBox(const wchar_t* string, const int len = -1,
87 FTPoint position = FTPoint());
88
99 virtual void Render(const char *string, const int len = -1,
100 FTPoint position = FTPoint(),
101 int renderMode = FTGL::RENDER_ALL);
102
113 virtual void Render(const wchar_t *string, const int len = -1,
114 FTPoint position = FTPoint(),
115 int renderMode = FTGL::RENDER_ALL);
116
124 void SetFont(FTFont *fontInit);
125
129 FTFont *GetFont();
130
136 void SetLineLength(const float LineLength);
137
141 float GetLineLength() const;
142
149 void SetAlignment(const FTGL::TextAlignment Alignment);
150
154 FTGL::TextAlignment GetAlignment() const;
155
162 void SetLineSpacing(const float LineSpacing);
163
167 float GetLineSpacing() const;
168};
169
170#endif //__cplusplus
171
172 FTGL_BEGIN_C_DECLS
173
174 FTGL_EXPORT FTGLlayout *ftglCreateSimpleLayout(void);
175
176 FTGL_EXPORT void ftglSetLayoutFont(FTGLlayout *, FTGLfont*);
177 FTGL_EXPORT FTGLfont *ftglGetLayoutFont(FTGLlayout *);
178
179 FTGL_EXPORT void ftglSetLayoutLineLength(FTGLlayout *, const float);
180 FTGL_EXPORT float ftglGetLayoutLineLength(FTGLlayout *);
181
182 FTGL_EXPORT void ftglSetLayoutAlignment(FTGLlayout *, const int);
183 FTGL_EXPORT int ftglGetLayoutAlignment(FTGLlayout *);
184 FTGL_EXPORT int ftglGetLayoutAlignement(FTGLlayout *); // old typo
185
186 FTGL_EXPORT void ftglSetLayoutLineSpacing(FTGLlayout *, const float);
187 FTGL_EXPORT float ftglGetLayoutLineSpacing(FTGLlayout *);
188
189 FTGL_END_C_DECLS
190
191#endif /* __FTSimpleLayout__ */
192
FTGLfont
struct _FTGLfont FTGLfont
Definition FTFont.h:414
FTGLlayout
struct _FTGLlayout FTGLlayout
Definition FTLayout.h:151
ftglSetLayoutAlignment
void ftglSetLayoutAlignment(FTGLlayout *, const int)
ftglGetLayoutAlignement
int ftglGetLayoutAlignement(FTGLlayout *)
ftglSetLayoutLineLength
void ftglSetLayoutLineLength(FTGLlayout *, const float)
ftglSetLayoutLineSpacing
void ftglSetLayoutLineSpacing(FTGLlayout *, const float)
ftglGetLayoutLineSpacing
float ftglGetLayoutLineSpacing(FTGLlayout *)
ftglGetLayoutFont
FTGLfont * ftglGetLayoutFont(FTGLlayout *)
ftglGetLayoutAlignment
int ftglGetLayoutAlignment(FTGLlayout *)
ftglGetLayoutLineLength
float ftglGetLayoutLineLength(FTGLlayout *)
ftglCreateSimpleLayout
FTGLlayout * ftglCreateSimpleLayout(void)
ftglSetLayoutFont
void ftglSetLayoutFont(FTGLlayout *, FTGLfont *)
FTBBox
FTBBox is a convenience class for handling bounding boxes.
Definition FTBBox.h:43
FTFont
FTFont is the public interface for the FTGL library.
Definition FTFont.h:57
FTLayout::FTLayout
FTLayout()
FTPoint
FTPoint class is a basic 3-dimensional point or vector.
Definition FTPoint.h:43
FTPoint::FTPoint
FTPoint()
Default constructor.
Definition FTPoint.h:48
FTSimpleLayout::BBox
virtual FTBBox BBox(const char *string, const int len=-1, FTPoint position=FTPoint())
Get the bounding box for a formatted string.
FTSimpleLayout::GetLineSpacing
float GetLineSpacing() const
FTSimpleLayout::SetAlignment
void SetAlignment(const FTGL::TextAlignment Alignment)
The text alignment mode used to distribute space within a line or rendered text.
FTSimpleLayout::GetLineLength
float GetLineLength() const
FTSimpleLayout::FTSimpleLayout
FTSimpleLayout()
Initializes line spacing to 1.0, alignment to ALIGN_LEFT and wrap to 100.0.
FTSimpleLayout::SetLineSpacing
void SetLineSpacing(const float LineSpacing)
Sets the line height.
FTSimpleLayout::SetFont
void SetFont(FTFont *fontInit)
Set the font to use for rendering the text.
FTSimpleLayout::GetAlignment
FTGL::TextAlignment GetAlignment() const
FTSimpleLayout::GetFont
FTFont * GetFont()
FTSimpleLayout::Render
virtual void Render(const wchar_t *string, const int len=-1, FTPoint position=FTPoint(), int renderMode=FTGL::RENDER_ALL)
Render a string of characters.
FTSimpleLayout::~FTSimpleLayout
~FTSimpleLayout()
Destructor.
FTSimpleLayout::SetLineLength
void SetLineLength(const float LineLength)
The maximum line length for formatting text.
FTSimpleLayout::Render
virtual void Render(const char *string, const int len=-1, FTPoint position=FTPoint(), int renderMode=FTGL::RENDER_ALL)
Render a string of characters.
FTSimpleLayout::BBox
virtual FTBBox BBox(const wchar_t *string, const int len=-1, FTPoint position=FTPoint())
Get the bounding box for a formatted string.
ftgl.h
FTGL_BEGIN_C_DECLS
#define FTGL_BEGIN_C_DECLS
Definition ftgl.h:43
FTGL_END_C_DECLS
#define FTGL_END_C_DECLS
Definition ftgl.h:44
FTGL_EXPORT
#define FTGL_EXPORT
Definition ftgl.h:134
FTGL::TextAlignment
TextAlignment
Definition ftgl.h:62
FTGL::RENDER_ALL
@ RENDER_ALL
Definition ftgl.h:58