Moved charmap list function out of FTCharmap into FTFont
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
diff --git a/include/FTCharmap.h b/include/FTCharmap.h
index dd9288a..69bb047 100644
--- a/include/FTCharmap.h
+++ b/include/FTCharmap.h
@@ -70,10 +70,6 @@ class FTGL_EXPORT FTCharmap
*/
bool CharMap( FT_Encoding encoding);
-
- unsigned int CharMapCount();
- FT_Encoding* CharMapList();
-
/**
* Get the FTGlyphContainer index of the input character.
*
@@ -116,8 +112,6 @@ class FTGL_EXPORT FTCharmap
*/
FT_Encoding ftEncoding;
- FT_Encoding* fontEncodingList;
-
/**
* The current Freetype face.
*/
diff --git a/include/FTFace.h b/include/FTFace.h
index e80963f..c87666a 100755
--- a/include/FTFace.h
+++ b/include/FTFace.h
@@ -81,6 +81,9 @@ class FTGL_EXPORT FTFace
unsigned int UnitsPerEM() const;
+ unsigned int CharMapCount();
+ FT_Encoding* CharMapList();
+
/**
* Gets the kerning vector between two glyphs
*/
@@ -118,6 +121,8 @@ class FTGL_EXPORT FTFace
* The number of glyphs in this face
*/
int numGlyphs;
+
+ FT_Encoding* fontEncodingList;
/**
* Current error code. Zero means no error.
diff --git a/include/FTFont.h b/include/FTFont.h
index c042ef7..767ce37 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -83,6 +83,9 @@ class FTGL_EXPORT FTFont
*/
bool CharMap( FT_Encoding encoding );
+ unsigned int CharMapCount();
+ FT_Encoding* CharMapList();
+
/**
* Set the char size for the current face.
*
diff --git a/test/FTCharmap-Test.cpp b/test/FTCharmap-Test.cpp
index df37a20..aec04a3 100755
--- a/test/FTCharmap-Test.cpp
+++ b/test/FTCharmap-Test.cpp
@@ -22,7 +22,6 @@ class FTCharmapTest : public CppUnit::TestCase
CPPUNIT_TEST( testGetCharacterIndex);
CPPUNIT_TEST( testGetGlyphIndex);
CPPUNIT_TEST( testInsertCharacterIndex);
- CPPUNIT_TEST( testGetCharmapList);
CPPUNIT_TEST_SUITE_END();
public:
@@ -99,17 +98,7 @@ class FTCharmapTest : public CppUnit::TestCase
charmap->InsertIndex( CHARACTER_CODE_A, 999);
CPPUNIT_ASSERT( charmap->CharIndex( CHARACTER_CODE_A) == 999);
}
-
- void testGetCharmapList()
- {
- CPPUNIT_ASSERT( charmap->CharMapCount() == 2);
-
- FT_Encoding* charmapList = charmap->CharMapList();
-
- CPPUNIT_ASSERT( charmapList[0] == ft_encoding_unicode);
- CPPUNIT_ASSERT( charmapList[1] == ft_encoding_adobe_standard);
- }
-
+
void setUp()
{
diff --git a/test/FTFace-Test.cpp b/test/FTFace-Test.cpp
index dabe4ed..31821b4 100755
--- a/test/FTFace-Test.cpp
+++ b/test/FTFace-Test.cpp
@@ -16,6 +16,7 @@ class FTFaceTest : public CppUnit::TestCase
CPPUNIT_TEST( testAttachMemoryData);
CPPUNIT_TEST( testGlyphCount);
CPPUNIT_TEST( testSetFontSize);
+ CPPUNIT_TEST( testGetCharmapList);
CPPUNIT_TEST( testUnitPerEMSquare);
CPPUNIT_TEST( testKerning);
CPPUNIT_TEST_SUITE_END();
@@ -84,6 +85,17 @@ class FTFaceTest : public CppUnit::TestCase
}
+ void testGetCharmapList()
+ {
+ CPPUNIT_ASSERT( testFace->CharMapCount() == 2);
+
+ FT_Encoding* charmapList = testFace->CharMapList();
+
+ CPPUNIT_ASSERT( charmapList[0] == ft_encoding_unicode);
+ CPPUNIT_ASSERT( charmapList[1] == ft_encoding_adobe_standard);
+ }
+
+
void testUnitPerEMSquare()
{
CPPUNIT_ASSERT_DOUBLES_EQUAL( 1000, testFace->UnitsPerEM(), 0);
diff --git a/test/FTFont-Test.cpp b/test/FTFont-Test.cpp
index 18eaf22..1ebd4d2 100755
--- a/test/FTFont-Test.cpp
+++ b/test/FTFont-Test.cpp
@@ -57,6 +57,7 @@ class FTFontTest : public CppUnit::TestCase
CPPUNIT_TEST( testAttachData);
CPPUNIT_TEST( testSetFontSize);
CPPUNIT_TEST( testSetCharMap);
+ CPPUNIT_TEST( testGetCharmapList);
CPPUNIT_TEST( testBoundingBox);
CPPUNIT_TEST( testAdvance);
CPPUNIT_TEST_SUITE_END();
@@ -135,6 +136,17 @@ class FTFontTest : public CppUnit::TestCase
}
+ void testGetCharmapList()
+ {
+ CPPUNIT_ASSERT( testFont->CharMapCount() == 2);
+
+ FT_Encoding* charmapList = testFont->CharMapList();
+
+ CPPUNIT_ASSERT( charmapList[0] == ft_encoding_unicode);
+ CPPUNIT_ASSERT( charmapList[1] == ft_encoding_adobe_standard);
+ }
+
+
void testBoundingBox()
{
CPPUNIT_ASSERT( testFont->FaceSize( FONT_POINT_SIZE));