Trying to add table support
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
diff --git a/include/FTFace.h b/include/FTFace.h
index 74bd703..4f91464 100755
--- a/include/FTFace.h
+++ b/include/FTFace.h
@@ -67,6 +67,10 @@ class FTGL_EXPORT FTFace
*/
void Close();
+
+ void* FontTable( unsigned int tableName) const;
+
+
/**
* Sets the char size for the current face.
*
@@ -126,6 +130,11 @@ class FTGL_EXPORT FTFace
private:
/**
+ * The Freetype face
+ */
+ FT_Face* ftFace;
+
+ /**
* The size object associated with this face
*/
FTSize charSize;
@@ -136,11 +145,6 @@ class FTGL_EXPORT FTFace
FTCharmap* charMap;
/**
- * The Freetype face
- */
- FT_Face* ftFace;
-
- /**
* Temporary variable to hold a glyph
*/
FT_Glyph ftGlyph;
diff --git a/src/FTFace.cpp b/src/FTFace.cpp
index e291eae..06dcd53 100755
--- a/src/FTFace.cpp
+++ b/src/FTFace.cpp
@@ -3,6 +3,8 @@
#include "FTCharmap.h"
+#include FT_TRUETYPE_TABLES_H
+
FTFace::FTFace( const char* filename)
: charMap(0),
numGlyphs(0),
@@ -87,6 +89,13 @@ void FTFace::Close()
}
+void* FTFace::FontTable( unsigned int tableName) const
+{
+// return FT_Get_Sfnt_Table( *ftFace, tableName);
+ return 0;
+}
+
+
const FTSize& FTFace::Size( const unsigned int size, const unsigned int res)
{
charSize.CharSize( ftFace, size, res, res);
diff --git a/test/FTFace-Test.cpp b/test/FTFace-Test.cpp
index 69159d5..6c8251e 100755
--- a/test/FTFace-Test.cpp
+++ b/test/FTFace-Test.cpp
@@ -14,6 +14,7 @@ class FTFaceTest : public CppUnit::TestCase
CPPUNIT_TEST( testOpenFaceFromMemory);
CPPUNIT_TEST( testAttachFile);
CPPUNIT_TEST( testAttachMemoryData);
+ CPPUNIT_TEST( testGetFontTable);
CPPUNIT_TEST( testGlyphCount);
CPPUNIT_TEST( testSetFontSize);
CPPUNIT_TEST( testUnitPerEMSquare);
@@ -73,6 +74,13 @@ class FTFaceTest : public CppUnit::TestCase
}
+ void testGetFontTable()
+ {
+ CPPUNIT_ASSERT( !testFace->FontTable( 'xxxx'));
+ CPPUNIT_ASSERT( testFace->FontTable( 'hmtx'));
+ }
+
+
void testGlyphCount()
{
CPPUNIT_ASSERT( testFace->GlyphCount() == 14099);