FTLayout.h
Go to the documentation of this file.
/*
* FTGL - OpenGL font library
*
* Copyright (c) 2001-2004 Henry Maddocks <ftgl@opengl.geek.nz>
* Copyright (c) 2008 Sam Hocevar <sam@hocevar.net>
* Copyright (c) 2008 Sean Morrison <learner@brlcad.org>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __ftgl__
# warning This header is deprecated. Please use <FTGL/ftgl.h> from now.
# include <FTGL/ftgl.h>
#endif
#ifndef __FTLayout__
#define __FTLayout__
#ifdef __cplusplus
class FTLayoutImpl;
class FTGL_EXPORT FTLayout
{
protected:
FTLayout();
private:
FTLayout(FTLayoutImpl *pImpl);
/* Allow our internal subclasses to access the private constructor */
friend class FTSimpleLayout;
public:
virtual ~FTLayout();
virtual FTBBox BBox(const char* string, const int len = -1,
FTPoint position = FTPoint()) = 0;
virtual FTBBox BBox(const wchar_t* string, const int len = -1,
FTPoint position = FTPoint()) = 0;
virtual void Render(const char *string, const int len = -1,
FTPoint position = FTPoint(),
int renderMode = FTGL::RENDER_ALL) = 0;
virtual void Render(const wchar_t *string, const int len = -1,
FTPoint position = FTPoint(),
int renderMode = FTGL::RENDER_ALL) = 0;
virtual FT_Error Error() const;
private:
FTLayoutImpl *impl;
};
#endif //__cplusplus
FTGL_BEGIN_C_DECLS
struct _FTGLlayout;
typedef struct _FTGLlayout FTGLlayout;
FTGL_EXPORT void ftglDestroyLayout(FTGLlayout* layout);
FTGL_EXPORT void ftglGetLayoutBBox(FTGLlayout *layout, const char* string,
float bounds[6]);
FTGL_EXPORT void ftglRenderLayout(FTGLlayout *layout, const char *string,
int mode);
FTGL_EXPORT FT_Error ftglGetLayoutError(FTGLlayout* layout);
FTGL_END_C_DECLS
#endif /* __FTLayout__ */
FTGLlayout
struct _FTGLlayout FTGLlayout
Definition FTLayout.h:151
ftglGetLayoutBBox
void ftglGetLayoutBBox(FTGLlayout *layout, const char *string, float bounds[6])
Get the bounding box for a string.
ftglGetLayoutError
FT_Error ftglGetLayoutError(FTGLlayout *layout)
Query a layout for errors.
ftglRenderLayout
void ftglRenderLayout(FTGLlayout *layout, const char *string, int mode)
Render a string of characters.
ftglDestroyLayout
void ftglDestroyLayout(FTGLlayout *layout)
Destroy an FTGL layout object.
FTBBox
FTBBox is a convenience class for handling bounding boxes.
Definition FTBBox.h:43
FTLayout::Error
virtual FT_Error Error() const
Queries the Layout for errors.
FTLayout::Render
virtual void Render(const char *string, const int len=-1, FTPoint position=FTPoint(), int renderMode=FTGL::RENDER_ALL)=0
Render a string of characters.
FTLayout::Render
virtual void Render(const wchar_t *string, const int len=-1, FTPoint position=FTPoint(), int renderMode=FTGL::RENDER_ALL)=0
Render a string of characters.
FTLayout::FTLayout
FTLayout()
FTLayout::BBox
virtual FTBBox BBox(const wchar_t *string, const int len=-1, FTPoint position=FTPoint())=0
Get the bounding box for a formatted string.
FTLayout::FTSimpleLayout
friend class FTSimpleLayout
Definition FTLayout.h:67
FTLayout::BBox
virtual FTBBox BBox(const char *string, const int len=-1, FTPoint position=FTPoint())=0
Get the bounding box for a formatted string.
FTLayout::~FTLayout
virtual ~FTLayout()
Destructor.
FTPoint
FTPoint class is a basic 3-dimensional point or vector.
Definition FTPoint.h:43
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::RENDER_ALL
@ RENDER_ALL
Definition ftgl.h:58