FTSimpleLayout.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 __FTSimpleLayout__
#define __FTSimpleLayout__
#ifdef __cplusplus
class FTFont;
class FTGL_EXPORT FTSimpleLayout : public FTLayout
{
public:
FTSimpleLayout();
~FTSimpleLayout();
virtual FTBBox BBox(const char* string, const int len = -1,
FTPoint position = FTPoint());
virtual FTBBox BBox(const wchar_t* string, const int len = -1,
FTPoint position = FTPoint());
virtual void Render(const char *string, const int len = -1,
FTPoint position = FTPoint(),
int renderMode = FTGL::RENDER_ALL);
virtual void Render(const wchar_t *string, const int len = -1,
FTPoint position = FTPoint(),
int renderMode = FTGL::RENDER_ALL);
void SetFont(FTFont *fontInit);
FTFont *GetFont();
void SetLineLength(const float LineLength);
float GetLineLength() const;
void SetAlignment(const FTGL::TextAlignment Alignment);
FTGL::TextAlignment GetAlignment() const;
void SetLineSpacing(const float LineSpacing);
float GetLineSpacing() const;
};
#endif //__cplusplus
FTGL_BEGIN_C_DECLS
FTGL_EXPORT FTGLlayout *ftglCreateSimpleLayout(void);
FTGL_EXPORT void ftglSetLayoutFont(FTGLlayout *, FTGLfont*);
FTGL_EXPORT FTGLfont *ftglGetLayoutFont(FTGLlayout *);
FTGL_EXPORT void ftglSetLayoutLineLength(FTGLlayout *, const float);
FTGL_EXPORT float ftglGetLayoutLineLength(FTGLlayout *);
FTGL_EXPORT void ftglSetLayoutAlignment(FTGLlayout *, const int);
FTGL_EXPORT int ftglGetLayoutAlignment(FTGLlayout *);
FTGL_EXPORT int ftglGetLayoutAlignement(FTGLlayout *); // old typo
FTGL_EXPORT void ftglSetLayoutLineSpacing(FTGLlayout *, const float);
FTGL_EXPORT float ftglGetLayoutLineSpacing(FTGLlayout *);
FTGL_END_C_DECLS
#endif /* __FTSimpleLayout__ */
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 is the interface for layout managers that render text.
Definition FTLayout.h:53
FTPoint
FTPoint class is a basic 3-dimensional point or vector.
Definition FTPoint.h:43
FTSimpleLayout
FTSimpleLayout is a specialisation of FTLayout for simple text boxes.
Definition FTSimpleLayout.h:50
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