Changes to the charmap handling and fixed TextureSize()
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
diff --git a/include/FTGLTextureFont.h b/include/FTGLTextureFont.h
index a623cad..2cf0f1b 100755
--- a/include/FTGLTextureFont.h
+++ b/include/FTGLTextureFont.h
@@ -1,5 +1,5 @@
-#ifndef __FTGLTextureFont__
-#define __FTGLTextureFont__
+#ifndef __FTGLTextureFont
+#define __FTGLTextureFont
#include "FTFont.h"
#include "FTGL.h"
@@ -13,7 +13,7 @@ class FTGLTextureFont : public FTFont
FTGLTextureFont();
~FTGLTextureFont();
- bool TextureSize() const { return textureSize;}
+ int TextureSize() const { return textureSize;}
void render( const char* string);
@@ -22,12 +22,10 @@ class FTGLTextureFont : public FTFont
// attributes
FTTextureGlyph* tempGlyph;
-// long maxTextSize;
- int maxTextSize; // For IRIX
+ long maxTextSize;
int textureSize;
-// unsigned long glTextureID;
- unsigned int glTextureID; // For IRIX
+ unsigned long glTextureID;
unsigned char* textMem;
int glyphHeight;
@@ -44,4 +42,4 @@ class FTGLTextureFont : public FTFont
};
-#endif // __FTGLTextureFont__
+#endif
diff --git a/src/FTGLTextureFont.cpp b/src/FTGLTextureFont.cpp
index cd1dffe..1bb994e 100755
--- a/src/FTGLTextureFont.cpp
+++ b/src/FTGLTextureFont.cpp
@@ -57,16 +57,11 @@ bool FTGLTextureFont::MakeGlyphList()
float currTextU = (float)padding / (float)textureSize;
float currTextV = (float)padding / (float)textureSize;
- int glyphIndex;
-
- numGlyphs = 256; // FIXME hack
+// numGlyphs = 256; // FIXME hack
for( int n = 0; n <= numGlyphs; ++n)
{
- glyphIndex = FT_Get_Char_Index( *ftFace, n);
-
- err = FT_Load_Glyph( *ftFace, glyphIndex, FT_LOAD_DEFAULT);
-
+ err = FT_Load_Glyph( *ftFace, n, FT_LOAD_DEFAULT);
FT_Glyph ftGlyph;
err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
@@ -75,7 +70,7 @@ bool FTGLTextureFont::MakeGlyphList()
currTextU = (float)currentTextX / (float)textureSize;
- tempGlyph = new FTTextureGlyph( ftGlyph, glyphIndex, data, textureSize, currTextU, currTextV);
+ tempGlyph = new FTTextureGlyph( ftGlyph, n, data, textureSize, currTextU, currTextV);
glyphList->Add( tempGlyph);
currentTextX += glyphWidth;