Commit bc7fea717839b6f589f4d3f152654265ad77d25c

henry 2003-10-19T21:16:41

Moved charmap list function out of FTCharmap into FTFont

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));