FTGL 2.1.3~rc5
ftgl.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@zoy.org>
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#define __ftgl__
30
31/* We need the Freetype headers */
32#include <ft2build.h>
33#include FT_FREETYPE_H
34#include FT_GLYPH_H
35#include FT_OUTLINE_H
36
37/* Floating point types used by the library */
38typedef double FTGL_DOUBLE;
39typedef float FTGL_FLOAT;
40
41/* Macros used to declare C-linkage types and symbols */
42#ifdef __cplusplus
43# define FTGL_BEGIN_C_DECLS extern "C" { namespace FTGL {
44# define FTGL_END_C_DECLS } }
45#else
46# define FTGL_BEGIN_C_DECLS
47# define FTGL_END_C_DECLS
48#endif
49
50#ifdef __cplusplus
51namespace FTGL
52{
53 typedef enum
54 {
55 RENDER_FRONT = 0x0001,
56 RENDER_BACK = 0x0002,
57 RENDER_SIDE = 0x0004,
58 RENDER_ALL = 0xffff
60
61 typedef enum
62 {
68}
69#else
70# define FTGL_RENDER_FRONT 0x0001
71# define FTGL_RENDER_BACK 0x0002
72# define FTGL_RENDER_SIDE 0x0004
73# define FTGL_RENDER_ALL 0xffff
74
75# define FTGL_ALIGN_LEFT 0
76# define FTGL_ALIGN_CENTER 1
77# define FTGL_ALIGN_RIGHT 2
78# define FTGL_ALIGN_JUSTIFY 3
79#endif
80
81// Compiler-specific conditional compilation
82#ifdef _MSC_VER // MS Visual C++
83
84 // Disable various warning.
85 // 4786: template name too long
86 #pragma warning(disable : 4251)
87 #pragma warning(disable : 4275)
88 #pragma warning(disable : 4786)
89
90 // The following definitions control how symbols are exported.
91 // If the target is a static library ensure that FTGL_LIBRARY_STATIC
92 // is defined. If building a dynamic library (ie DLL) ensure the
93 // FTGL_LIBRARY macro is defined, as it will mark symbols for
94 // export. If compiling a project to _use_ the _dynamic_ library
95 // version of the library, no definition is required.
96 #ifdef FTGL_LIBRARY_STATIC // static lib - no special export required
97 # define FTGL_EXPORT
98 #elif FTGL_LIBRARY // dynamic lib - must export/import symbols appropriately.
99 # define FTGL_EXPORT __declspec(dllexport)
100 #else
101 # define FTGL_EXPORT __declspec(dllimport)
102 #endif
103
104#else
105 // Compiler that is not MS Visual C++.
106 // Ensure that the export symbol is defined (and blank)
107 #define FTGL_EXPORT
108#endif
109
110#include <FTGL/FTPoint.h>
111#include <FTGL/FTBBox.h>
112#include <FTGL/FTBuffer.h>
113
114#include <FTGL/FTGlyph.h>
115#include <FTGL/FTBitmapGlyph.h>
116#include <FTGL/FTBufferGlyph.h>
117#include <FTGL/FTExtrdGlyph.h>
118#include <FTGL/FTOutlineGlyph.h>
119#include <FTGL/FTPixmapGlyph.h>
120#include <FTGL/FTPolyGlyph.h>
121#include <FTGL/FTTextureGlyph.h>
122
123#include <FTGL/FTFont.h>
124#include <FTGL/FTGLBitmapFont.h>
125#include <FTGL/FTBufferFont.h>
126#include <FTGL/FTGLExtrdFont.h>
127#include <FTGL/FTGLOutlineFont.h>
128#include <FTGL/FTGLPixmapFont.h>
129#include <FTGL/FTGLPolygonFont.h>
130#include <FTGL/FTGLTextureFont.h>
131
132#include <FTGL/FTLayout.h>
133#include <FTGL/FTSimpleLayout.h>
134
135#endif // __ftgl__
float FTGL_FLOAT
Definition: ftgl.h:39
double FTGL_DOUBLE
Definition: ftgl.h:38
Definition: ftgl.h:52
TextAlignment
Definition: ftgl.h:62
@ ALIGN_JUSTIFY
Definition: ftgl.h:66
@ ALIGN_RIGHT
Definition: ftgl.h:65
@ ALIGN_LEFT
Definition: ftgl.h:63
@ ALIGN_CENTER
Definition: ftgl.h:64
RenderMode
Definition: ftgl.h:54
@ RENDER_BACK
Definition: ftgl.h:56
@ RENDER_ALL
Definition: ftgl.h:58
@ RENDER_SIDE
Definition: ftgl.h:57
@ RENDER_FRONT
Definition: ftgl.h:55