Commit 157770a9088abea1395b9165dbe57da167d90f32

henry 2002-06-21T08:20:08

Remove <map> replaced with FTCharToGlyphIndexMap

diff --git a/include/FTCharmap.h b/include/FTCharmap.h
index 7372a51..1658f8d 100644
--- a/include/FTCharmap.h
+++ b/include/FTCharmap.h
@@ -1,12 +1,14 @@
 #ifndef     __FTCharmap__
 #define     __FTCharmap__
 
-#include <map>
 
 #include <ft2build.h>
 #include FT_FREETYPE_H
 #include FT_GLYPH_H
 
+//#include <map>
+#include "FTCharToGlyphIndexMap.h"
+
 #include "FTGL.h"
 
 
@@ -104,7 +106,7 @@ class FTGL_EXPORT FTCharmap
          *
          * < character code, face glyph index>
          */
-        typedef std::map< unsigned long, unsigned long> CharacterMap;
+        typedef FTCharToGlyphIndexMap CharacterMap;
         CharacterMap charMap;
         
         /**
diff --git a/src/FTCharmap.cpp b/src/FTCharmap.cpp
index f1738fd..6965033 100644
--- a/src/FTCharmap.cpp
+++ b/src/FTCharmap.cpp
@@ -81,17 +81,16 @@ bool FTCharmap::CharMap( FT_UShort platform, FT_UShort encoding)
 
 unsigned int FTCharmap::CharIndex( unsigned int index )
 {
-    CharacterMap::const_iterator result = charMap.find( index);
-        
-    if( result == charMap.end())
+    const CharacterMap::GlyphIndex *result = charMap.find(index);
+    
+    if( !result)
     {
         unsigned int glyph = FT_Get_Char_Index( ftFace, index);
-        charMap.insert( CharacterMap::value_type( index, glyph));
+        charMap.insert( index, glyph);
         return glyph;
     }
     else
     {
-        return result->second;
+        return *result;
     }
-
 }