Now takes an FTGL face not a Freetype fac Fixed docs Added glyphIndex function
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
diff --git a/include/FTCharmap.h b/include/FTCharmap.h
index 7b511a6..1b1f568 100644
--- a/include/FTCharmap.h
+++ b/include/FTCharmap.h
@@ -23,13 +23,16 @@
* @see "Freetype 2 Documentation"
*
*/
+
+class FTFace;
+
class FTGL_EXPORT FTCharmap
{
public:
/**
* Constructor
*/
- FTCharmap( FT_Face ftFace);
+ FTCharmap( FTFace* face);
/**
* Destructor
@@ -74,12 +77,13 @@ class FTGL_EXPORT FTCharmap
* current encoding eg apple roman.
* @return The glyph index for the character.
*/
- unsigned int CharIndex( unsigned int index );
+ unsigned int CharIndex( unsigned int characterCode);
+ unsigned int GlyphIndex( unsigned int characterCode, unsigned int glyphIndex);
/**
* Queries for errors.
*
- * @return The current error code.
+ * @return The current error code. Zero means no error.
*/
FT_Error Error() const { return err;}
@@ -103,7 +107,7 @@ class FTGL_EXPORT FTCharmap
CharacterMap charMap;
/**
- * Current error code. Zero means no error.
+ * Current error code.
*/
FT_Error err;
diff --git a/src/FTCharmap.cpp b/src/FTCharmap.cpp
index 04caddf..0530933 100644
--- a/src/FTCharmap.cpp
+++ b/src/FTCharmap.cpp
@@ -1,11 +1,12 @@
-#include "FTCharmap.h"
+#include "FTFace.h"
+#include "FTCharmap.h"
-FTCharmap::FTCharmap( FT_Face face)
-: ftFace( face),
+FTCharmap::FTCharmap( FTFace* face)
+: ftFace( *(face->Face())),
err(0)
{
- if( !face->charmap)
+ if( !ftFace->charmap)
{
err = FT_Set_Charmap( ftFace, ftFace->charmaps[0]);
}