Fixes for deprecated identifiers in 2.1.5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
diff --git a/include/FTGL.h b/include/FTGL.h
index e8de9a7..e92bd52 100755
--- a/include/FTGL.h
+++ b/include/FTGL.h
@@ -5,6 +5,20 @@
typedef double FTGL_DOUBLE;
typedef float FTGL_FLOAT;
+// Fixes for deprecated identifiers in 2.1.5
+#ifndef FT_OPEN_MEMORY
+ #define FT_OPEN_MEMORY (FT_Open_Flags)1
+#endif
+
+#ifndef FT_RENDER_MODE_MONO
+ #define FT_RENDER_MODE_MONO ft_render_mode_mono
+#endif
+
+#ifndef FT_RENDER_MODE_NORMAL
+ #define FT_RENDER_MODE_NORMAL ft_render_mode_normal
+#endif
+
+
#ifdef WIN32
// Under windows avoid including <windows.h> is overrated.
diff --git a/src/FTBitmapGlyph.cpp b/src/FTBitmapGlyph.cpp
index 9f48fb7..acfaa74 100755
--- a/src/FTBitmapGlyph.cpp
+++ b/src/FTBitmapGlyph.cpp
@@ -8,7 +8,7 @@ FTBitmapGlyph::FTBitmapGlyph( FT_Glyph glyph)
destHeight(0),
data(0)
{
- err = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_mono, 0, 1);
+ err = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_MONO, 0, 1);
if( err || ft_glyph_format_bitmap != glyph->format)
{
return;
diff --git a/src/FTFace.cpp b/src/FTFace.cpp
index 874e43c..3d46a1f 100755
--- a/src/FTFace.cpp
+++ b/src/FTFace.cpp
@@ -58,10 +58,6 @@ bool FTFace::Attach( const char* filename)
}
-#ifndef FT_OPEN_MEMORY
- #define FT_OPEN_MEMORY (FT_Open_Flags)1
-#endif
-
bool FTFace::Attach( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
{
FT_Open_Args open;
diff --git a/src/FTPixmapGlyph.cpp b/src/FTPixmapGlyph.cpp
index 9a60dbe..6f447e1 100755
--- a/src/FTPixmapGlyph.cpp
+++ b/src/FTPixmapGlyph.cpp
@@ -7,7 +7,7 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph)
data(0)
{
// This function will always fail if the glyph's format isn't scalable????
- err = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_normal, 0, 1);
+ err = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, 0, 1);
if( err || ft_glyph_format_bitmap != glyph->format)
{
return;
diff --git a/src/FTTextureGlyph.cpp b/src/FTTextureGlyph.cpp
index 250249c..ac044a3 100755
--- a/src/FTTextureGlyph.cpp
+++ b/src/FTTextureGlyph.cpp
@@ -8,7 +8,7 @@ FTTextureGlyph::FTTextureGlyph( FT_Glyph glyph, int id, int xOffset, int yOffset
glTextureID(id),
activeTextureID(0)
{
- err = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_normal, 0, 1);
+ err = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, 0, 1);
if( err || glyph->format != ft_glyph_format_bitmap)
{
return;
diff --git a/test/FTVectoriser-Test.cpp b/test/FTVectoriser-Test.cpp
index f7fd404..7710d67 100755
--- a/test/FTVectoriser-Test.cpp
+++ b/test/FTVectoriser-Test.cpp
@@ -276,8 +276,8 @@ class FTVectoriserTest : public CppUnit::TestCase
void testFreetypeVersion()
{
- setUpFreetype();
-
+ setUpFreetype( NULL_CHARACTER_INDEX);
+
FT_Int amajor;
FT_Int aminor;
FT_Int apatch;
@@ -303,8 +303,7 @@ class FTVectoriserTest : public CppUnit::TestCase
void testBadGlyphProcess()
{
- setUpFreetype();
- loadGlyph( NULL_CHARACTER_INDEX);
+ setUpFreetype( NULL_CHARACTER_INDEX);
FTVectoriser vectoriser( glyph);
CPPUNIT_ASSERT( vectoriser.ContourCount() == 0);
@@ -315,8 +314,7 @@ class FTVectoriserTest : public CppUnit::TestCase
void testSimpleGlyphProcess()
{
- setUpFreetype();
- loadGlyph( SIMPLE_CHARACTER_INDEX);
+ setUpFreetype( SIMPLE_CHARACTER_INDEX);
FTVectoriser vectoriser( glyph);
@@ -329,8 +327,7 @@ class FTVectoriserTest : public CppUnit::TestCase
void testComplexGlyphProcess()
{
- setUpFreetype();
- loadGlyph( COMPLEX_CHARACTER_INDEX);
+ setUpFreetype( COMPLEX_CHARACTER_INDEX);
FTVectoriser vectoriser( glyph);
@@ -343,8 +340,7 @@ class FTVectoriserTest : public CppUnit::TestCase
void testGetContour()
{
- setUpFreetype();
- loadGlyph( SIMPLE_CHARACTER_INDEX);
+ setUpFreetype( SIMPLE_CHARACTER_INDEX);
FTVectoriser vectoriser( glyph);
@@ -357,8 +353,7 @@ class FTVectoriserTest : public CppUnit::TestCase
void testGetOutline()
{
- setUpFreetype();
- loadGlyph( COMPLEX_CHARACTER_INDEX);
+ setUpFreetype( COMPLEX_CHARACTER_INDEX);
FTVectoriser vectoriser( glyph);
@@ -381,8 +376,7 @@ class FTVectoriserTest : public CppUnit::TestCase
void testGetMesh()
{
- setUpFreetype();
- loadGlyph( SIMPLE_CHARACTER_INDEX);
+ setUpFreetype( SIMPLE_CHARACTER_INDEX);
FTVectoriser vectoriser( glyph);
CPPUNIT_ASSERT( vectoriser.GetMesh() == NULL);
@@ -395,8 +389,7 @@ class FTVectoriserTest : public CppUnit::TestCase
void testMakeMesh()
{
- setUpFreetype();
- loadGlyph( COMPLEX_CHARACTER_INDEX);
+ setUpFreetype( COMPLEX_CHARACTER_INDEX);
FTVectoriser vectoriser( glyph);
@@ -441,13 +434,14 @@ class FTVectoriserTest : public CppUnit::TestCase
FT_Face face;
FT_Glyph glyph;
- void setUpFreetype()
+ void setUpFreetype( unsigned int characterIndex)
{
FT_Error error = FT_Init_FreeType( &library);
assert(!error);
error = FT_New_Face( library, ARIAL_FONT_FILE, 0, &face);
assert(!error);
+ loadGlyph( characterIndex);
}
void loadGlyph( unsigned int characterIndex)