2
* FTGL - OpenGL font library
4
* Copyright (c) 2001-2004 Henry Maddocks <ftgl@opengl.geek.nz>
5
* Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
6
* Copyright (c) 2008 Sean Morrison <learner@brlcad.org>
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:
16
* The above copyright notice and this permission notice shall be
17
* included in all copies or substantial portions of the Software.
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.
29
# warning This header is deprecated. Please use <FTGL/ftgl.h> from now.
30
# include <FTGL/ftgl.h>
42
* FTLayout is the interface for layout managers that render text.
44
* Specific layout manager classes are derived from this class. This class
45
* is abstract and deriving classes must implement the protected
46
* <code>Render</code> methods to render formatted text and
47
* <code>BBox</code> methods to determine the bounding box of output text.
52
class FTGL_EXPORT FTLayout
59
* Internal FTGL FTLayout constructor. For private use only.
61
* @param pImpl Internal implementation object. Will be destroyed
62
* upon FTLayout deletion.
64
FTLayout(FTLayoutImpl *pImpl);
66
/* Allow our internal subclasses to access the private constructor */
67
friend class FTSimpleLayout;
76
* Get the bounding box for a formatted string.
78
* @param string A char string.
79
* @param len The length of the string. If < 0 then all characters
80
* will be checked until a null character is encountered
82
* @param position The pen position of the first character (optional).
83
* @return The corresponding bounding box.
85
virtual FTBBox BBox(const char* string, const int len = -1,
86
FTPoint position = FTPoint()) = 0;
89
* Get the bounding box for a formatted string.
91
* @param string A wchar_t string.
92
* @param len The length of the string. If < 0 then all characters
93
* will be checked until a null character is encountered
95
* @param position The pen position of the first character (optional).
96
* @return The corresponding bounding box.
98
virtual FTBBox BBox(const wchar_t* string, const int len = -1,
99
FTPoint position = FTPoint()) = 0;
102
* Render a string of characters.
104
* @param string 'C' style string to be output.
105
* @param len The length of the string. If < 0 then all characters
106
* will be displayed until a null character is encountered
108
* @param position The pen position of the first character (optional).
109
* @param renderMode Render mode to display (optional)
111
virtual void Render(const char *string, const int len = -1,
112
FTPoint position = FTPoint(),
113
int renderMode = FTGL::RENDER_ALL) = 0;
116
* Render a string of characters.
118
* @param string wchar_t string to be output.
119
* @param len The length of the string. If < 0 then all characters
120
* will be displayed until a null character is encountered
122
* @param position The pen position of the first character (optional).
123
* @param renderMode Render mode to display (optional)
125
virtual void Render(const wchar_t *string, const int len = -1,
126
FTPoint position = FTPoint(),
127
int renderMode = FTGL::RENDER_ALL) = 0;
130
* Queries the Layout for errors.
132
* @return The current error code.
134
virtual FT_Error Error() const;
138
* Internal FTGL FTLayout implementation object. For private use only.
148
* FTGLlayout is the interface for layout managers that render text.
151
typedef struct _FTGLlayout FTGLlayout;
154
* Destroy an FTGL layout object.
156
* @param layout An FTGLlayout* object.
158
FTGL_EXPORT void ftglDestroyLayout(FTGLlayout* layout);
161
* Get the bounding box for a string.
163
* @param layout An FTGLlayout* object.
164
* @param string A char buffer
165
* @param bounds An array of 6 float values where the bounding box's lower
166
* left near and upper right far 3D coordinates will be stored.
168
FTGL_EXPORT void ftglGetLayoutBBox(FTGLlayout *layout, const char* string,
172
* Render a string of characters.
174
* @param layout An FTGLlayout* object.
175
* @param string Char string to be output.
176
* @param mode Render mode to display.
178
FTGL_EXPORT void ftglRenderLayout(FTGLlayout *layout, const char *string,
182
* Query a layout for errors.
184
* @param layout An FTGLlayout* object.
185
* @return The current error code.
187
FTGL_EXPORT FT_Error ftglGetLayoutError(FTGLlayout* layout);
191
#endif /* __FTLayout__ */