FTGL 2.2.0
|
00001 /* 00002 * FTGL - OpenGL font library 00003 * 00004 * Copyright (c) 2001-2004 Henry Maddocks <ftgl@opengl.geek.nz> 00005 * Copyright (c) 2008 Sam Hocevar <sam@hocevar.net> 00006 * Copyright (c) 2008 Sean Morrison <learner@brlcad.org> 00007 * 00008 * Permission is hereby granted, free of charge, to any person obtaining 00009 * a copy of this software and associated documentation files (the 00010 * "Software"), to deal in the Software without restriction, including 00011 * without limitation the rights to use, copy, modify, merge, publish, 00012 * distribute, sublicense, and/or sell copies of the Software, and to 00013 * permit persons to whom the Software is furnished to do so, subject to 00014 * the following conditions: 00015 * 00016 * The above copyright notice and this permission notice shall be 00017 * included in all copies or substantial portions of the Software. 00018 * 00019 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00020 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00021 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00022 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 00023 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 00024 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 00025 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00026 */ 00027 00028 #ifndef __ftgl__ 00029 #define __ftgl__ 00030 00031 /* We need the Freetype headers */ 00032 #include <ft2build.h> 00033 #include FT_FREETYPE_H 00034 #include FT_GLYPH_H 00035 #include FT_OUTLINE_H 00036 00037 /* Floating point types used by the library */ 00038 typedef double FTGL_DOUBLE; 00039 typedef float FTGL_FLOAT; 00040 00041 /* Macros used to declare C-linkage types and symbols */ 00042 #ifdef __cplusplus 00043 # define FTGL_BEGIN_C_DECLS extern "C" { namespace FTGL { 00044 # define FTGL_END_C_DECLS } } 00045 #else 00046 # define FTGL_BEGIN_C_DECLS 00047 # define FTGL_END_C_DECLS 00048 #endif 00049 00050 #ifdef __cplusplus 00051 namespace FTGL 00052 { 00053 typedef enum 00054 { 00055 RENDER_FRONT = 0x0001, 00056 RENDER_BACK = 0x0002, 00057 RENDER_SIDE = 0x0004, 00058 RENDER_ALL = 0xffff 00059 } RenderMode; 00060 00061 typedef enum 00062 { 00063 ALIGN_LEFT = 0, 00064 ALIGN_CENTER = 1, 00065 ALIGN_RIGHT = 2, 00066 ALIGN_JUSTIFY = 3 00067 } TextAlignment; 00068 00069 typedef enum 00070 { 00071 CONFIG_VERSION = 1, 00072 } ConfigString; 00073 00082 extern char const *GetString(ConfigString config); 00083 } 00084 #else 00085 # define FTGL_RENDER_FRONT 0x0001 00086 # define FTGL_RENDER_BACK 0x0002 00087 # define FTGL_RENDER_SIDE 0x0004 00088 # define FTGL_RENDER_ALL 0xffff 00089 00090 # define FTGL_ALIGN_LEFT 0 00091 # define FTGL_ALIGN_CENTER 1 00092 # define FTGL_ALIGN_RIGHT 2 00093 # define FTGL_ALIGN_JUSTIFY 3 00094 00095 # define FTGL_CONFIG_VERSION 1 00096 00105 extern char const *ftglGetString(int config); 00106 #endif 00107 00108 // Compiler-specific conditional compilation 00109 #ifdef _MSC_VER // MS Visual C++ 00110 00111 // Disable various warning. 00112 // 4786: template name too long 00113 #pragma warning(disable : 4251) 00114 #pragma warning(disable : 4275) 00115 #pragma warning(disable : 4786) 00116 00117 // The following definitions control how symbols are exported. 00118 // If the target is a static library ensure that FTGL_LIBRARY_STATIC 00119 // is defined. If building a dynamic library (ie DLL) ensure the 00120 // FTGL_LIBRARY macro is defined, as it will mark symbols for 00121 // export. If compiling a project to _use_ the _dynamic_ library 00122 // version of the library, no definition is required. 00123 #ifdef FTGL_LIBRARY_STATIC // static lib - no special export required 00124 # define FTGL_EXPORT 00125 #elif FTGL_LIBRARY // dynamic lib - must export/import symbols appropriately. 00126 # define FTGL_EXPORT __declspec(dllexport) 00127 #else 00128 # define FTGL_EXPORT __declspec(dllimport) 00129 #endif 00130 00131 #else 00132 // Compiler that is not MS Visual C++. 00133 // Ensure that the export symbol is defined (and blank) 00134 #define FTGL_EXPORT 00135 #endif 00136 00137 #include <FTGL/FTPoint.h> 00138 #include <FTGL/FTBBox.h> 00139 #include <FTGL/FTBuffer.h> 00140 00141 #include <FTGL/FTGlyph.h> 00142 #include <FTGL/FTBitmapGlyph.h> 00143 #include <FTGL/FTBufferGlyph.h> 00144 #include <FTGL/FTExtrdGlyph.h> 00145 #include <FTGL/FTOutlineGlyph.h> 00146 #include <FTGL/FTPixmapGlyph.h> 00147 #include <FTGL/FTPolyGlyph.h> 00148 #include <FTGL/FTTextureGlyph.h> 00149 00150 #include <FTGL/FTFont.h> 00151 #include <FTGL/FTGLBitmapFont.h> 00152 #include <FTGL/FTBufferFont.h> 00153 #include <FTGL/FTGLExtrdFont.h> 00154 #include <FTGL/FTGLOutlineFont.h> 00155 #include <FTGL/FTGLPixmapFont.h> 00156 #include <FTGL/FTGLPolygonFont.h> 00157 #include <FTGL/FTGLTextureFont.h> 00158 00159 #include <FTGL/FTLayout.h> 00160 #include <FTGL/FTSimpleLayout.h> 00161 00162 #endif // __ftgl__