FTGlyph.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 __FTGlyph__
#define __FTGlyph__
#ifdef __cplusplus
class FTGlyphImpl;
class FTGL_EXPORT FTGlyph
{
protected:
FTGlyph(FT_GlyphSlot glyph);
private:
FTGlyph(FTGlyphImpl *pImpl);
/* Allow our internal subclasses to access the private constructor */
friend class FTBitmapGlyph;
friend class FTBufferGlyph;
friend class FTExtrudeGlyph;
friend class FTOutlineGlyph;
friend class FTPixmapGlyph;
friend class FTPolygonGlyph;
friend class FTTextureGlyph;
friend class FTTriangleExtractorGlyph;
public:
virtual ~FTGlyph();
virtual const FTPoint& Render(const FTPoint& pen, int renderMode) = 0;
virtual float Advance() const;
virtual const FTBBox& BBox() const;
virtual FT_Error Error() const;
private:
FTGlyphImpl *impl;
};
#endif //__cplusplus
FTGL_BEGIN_C_DECLS
struct _FTGLGlyph;
typedef struct _FTGLglyph FTGLglyph;
FTGL_EXPORT FTGLglyph *ftglCreateCustomGlyph(FTGLglyph *base, void *data,
void (*renderCallback) (FTGLglyph *, void *, FTGL_DOUBLE, FTGL_DOUBLE,
int, FTGL_DOUBLE *, FTGL_DOUBLE *),
void (*destroyCallback) (FTGLglyph *, void *));
FTGL_EXPORT void ftglDestroyGlyph(FTGLglyph *glyph);
FTGL_EXPORT void ftglRenderGlyph(FTGLglyph *glyph, FTGL_DOUBLE penx,
FTGL_DOUBLE peny, int renderMode,
FTGL_DOUBLE *advancex, FTGL_DOUBLE *advancey);
FTGL_EXPORT float ftglGetGlyphAdvance(FTGLglyph *glyph);
FTGL_EXPORT void ftglGetGlyphBBox(FTGLglyph *glyph, float bounds[6]);
FTGL_EXPORT FT_Error ftglGetGlyphError(FTGLglyph* glyph);
FTGL_END_C_DECLS
#endif // __FTGlyph__
ftglGetGlyphBBox
void ftglGetGlyphBBox(FTGLglyph *glyph, float bounds[6])
Return the bounding box for a glyph.
ftglRenderGlyph
void ftglRenderGlyph(FTGLglyph *glyph, FTGL_DOUBLE penx, FTGL_DOUBLE peny, int renderMode, FTGL_DOUBLE *advancex, FTGL_DOUBLE *advancey)
Render a glyph at the current pen position and compute the corresponding advance.
FTGLglyph
struct _FTGLglyph FTGLglyph
Definition: FTGlyph.h:134
ftglGetGlyphAdvance
float ftglGetGlyphAdvance(FTGLglyph *glyph)
Return the advance for a glyph.
ftglGetGlyphError
FT_Error ftglGetGlyphError(FTGLglyph *glyph)
Query a glyph for errors.
ftglCreateCustomGlyph
FTGLglyph * ftglCreateCustomGlyph(FTGLglyph *base, void *data, void(*renderCallback)(FTGLglyph *, void *, FTGL_DOUBLE, FTGL_DOUBLE, int, FTGL_DOUBLE *, FTGL_DOUBLE *), void(*destroyCallback)(FTGLglyph *, void *))
Create a custom FTGL glyph object.
ftglDestroyGlyph
void ftglDestroyGlyph(FTGLglyph *glyph)
Destroy an FTGL glyph object.
FTBBox
FTBBox is a convenience class for handling bounding boxes.
Definition: FTBBox.h:43
FTBitmapGlyph
FTBitmapGlyph is a specialisation of FTGlyph for creating bitmaps.
Definition: FTBitmapGlyph.h:43
FTBufferGlyph
FTBufferGlyph is a specialisation of FTGlyph for memory buffer rendering.
Definition: FTBufferGlyph.h:41
FTExtrudeGlyph
FTExtrudeGlyph is a specialisation of FTGlyph for creating tessellated extruded polygon glyphs.
Definition: FTExtrdGlyph.h:44
FTGlyph
FTGlyph is the base class for FTGL glyphs.
Definition: FTGlyph.h:51
FTGlyph::Advance
virtual float Advance() const
Return the advance width for this glyph.
FTGlyph::FTGlyph
FTGlyph(FT_GlyphSlot glyph)
Create a glyph.
FTGlyph::BBox
virtual const FTBBox & BBox() const
Return the bounding box for this glyph.
FTGlyph::Render
virtual const FTPoint & Render(const FTPoint &pen, int renderMode)=0
Renders this glyph at the current pen position.
FTGlyph::Error
virtual FT_Error Error() const
Queries for errors.
FTGlyph::~FTGlyph
virtual ~FTGlyph()
Destructor.
FTOutlineGlyph
FTOutlineGlyph is a specialisation of FTGlyph for creating outlines.
Definition: FTOutlineGlyph.h:43
FTPixmapGlyph
FTPixmapGlyph is a specialisation of FTGlyph for creating pixmaps.
Definition: FTPixmapGlyph.h:43
FTPoint
FTPoint class is a basic 3-dimensional point or vector.
Definition: FTPoint.h:43
FTPolygonGlyph
FTPolygonGlyph is a specialisation of FTGlyph for creating tessellated polygon glyphs.
Definition: FTPolyGlyph.h:44
FTTextureGlyph
FTTextureGlyph is a specialisation of FTGlyph for creating texture glyphs.
Definition: FTTextureGlyph.h:44
FTTriangleExtractorGlyph
FTPolygonGlyph is a specialisation of FTGlyph for creating tessellated polygon glyphs.
Definition: FTTriangleExtractorGlyph.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_DOUBLE
double FTGL_DOUBLE
Definition: ftgl.h:38