- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

# ftgl.h

Go to the documentation of this file.

    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@zoy.org>
    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 #else
    00070 #   define FTGL_RENDER_FRONT 0x0001
    00071 #   define FTGL_RENDER_BACK  0x0002
    00072 #   define FTGL_RENDER_SIDE  0x0004
    00073 #   define FTGL_RENDER_ALL   0xffff
    00074
    00075 #   define FTGL_ALIGN_LEFT    0
    00076 #   define FTGL_ALIGN_CENTER  1
    00077 #   define FTGL_ALIGN_RIGHT   2
    00078 #   define FTGL_ALIGN_JUSTIFY 3
    00079 #endif
    00080
    00081 // Compiler-specific conditional compilation
    00082 #ifdef _MSC_VER // MS Visual C++
    00083
    00084     // Disable various warning.
    00085     // 4786: template name too long
    00086     #pragma warning(disable : 4251)
    00087     #pragma warning(disable : 4275)
    00088     #pragma warning(disable : 4786)
    00089
    00090     // The following definitions control how symbols are exported.
    00091     // If the target is a static library ensure that FTGL_LIBRARY_STATIC
    00092     // is defined. If building a dynamic library (ie DLL) ensure the
    00093     // FTGL_LIBRARY macro is defined, as it will mark symbols for
    00094     // export. If compiling a project to _use_ the _dynamic_ library
    00095     // version of the library, no definition is required.
    00096     #ifdef FTGL_LIBRARY_STATIC      // static lib - no special export required
    00097     #  define FTGL_EXPORT
    00098     #elif FTGL_LIBRARY              // dynamic lib - must export/import symbols appropriately.
    00099     #  define FTGL_EXPORT   __declspec(dllexport)
    00100     #else
    00101     #  define FTGL_EXPORT   __declspec(dllimport)
    00102     #endif
    00103
    00104 #else
    00105     // Compiler that is not MS Visual C++.
    00106     // Ensure that the export symbol is defined (and blank)
    00107     #define FTGL_EXPORT
    00108 #endif
    00109
    00110 #include <FTGL/FTPoint.h>
    00111 #include <FTGL/FTBBox.h>
    00112 #include <FTGL/FTBuffer.h>
    00113
    00114 #include <FTGL/FTGlyph.h>
    00115 #include <FTGL/FTBitmapGlyph.h>
    00116 #include <FTGL/FTBufferGlyph.h>
    00117 #include <FTGL/FTExtrdGlyph.h>
    00118 #include <FTGL/FTOutlineGlyph.h>
    00119 #include <FTGL/FTPixmapGlyph.h>
    00120 #include <FTGL/FTPolyGlyph.h>
    00121 #include <FTGL/FTTextureGlyph.h>
    00122
    00123 #include <FTGL/FTFont.h>
    00124 #include <FTGL/FTGLBitmapFont.h>
    00125 #include <FTGL/FTBufferFont.h>
    00126 #include <FTGL/FTGLExtrdFont.h>
    00127 #include <FTGL/FTGLOutlineFont.h>
    00128 #include <FTGL/FTGLPixmapFont.h>
    00129 #include <FTGL/FTGLPolygonFont.h>
    00130 #include <FTGL/FTGLTextureFont.h>
    00131
    00132 #include <FTGL/FTLayout.h>
    00133 #include <FTGL/FTSimpleLayout.h>
    00134
    00135 #endif  //  __ftgl__