Remove <map> replaced with FTCharToGlyphIndexMap
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
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;
}
-
}