Changes for FTPoint
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
diff --git a/include/FTFace.h b/include/FTFace.h
index 8eed493..c5f330f 100755
--- a/include/FTFace.h
+++ b/include/FTFace.h
@@ -7,6 +7,7 @@
#include FT_FREETYPE_H
#include FT_GLYPH_H
+#include "FTPoint.h"
#include "FTSize.h"
class FTCharmap;
@@ -100,7 +101,7 @@ class FTGL_EXPORT FTFace
/**
* Gets the kerning vector between two glyphs
*/
- FT_Vector& KernAdvance( unsigned int index1, unsigned int index2);
+ FTPoint KernAdvance( unsigned int index1, unsigned int index2);
/**
* Loads and creates a Freetype glyph.
@@ -151,11 +152,6 @@ class FTGL_EXPORT FTFace
int numGlyphs;
/**
- * Temporary variable to holding a kerning vector.
- */
- FT_Vector kernAdvance;
-
- /**
* Current error code. Zero means no error.
*/
FT_Error err;
diff --git a/src/FTFace.cpp b/src/FTFace.cpp
index 0f33b38..dda176e 100755
--- a/src/FTFace.cpp
+++ b/src/FTFace.cpp
@@ -104,20 +104,21 @@ unsigned int FTFace::CharIndex( unsigned int index) const
}
-FT_Vector& FTFace::KernAdvance( unsigned int index1, unsigned int index2)
+FTPoint FTFace::KernAdvance( unsigned int index1, unsigned int index2)
{
- kernAdvance.x = 0; kernAdvance.y = 0;
+ FT_Vector kernAdvance;
if( FT_HAS_KERNING((*ftFace)) && index1 && index2)
{
err = FT_Get_Kerning( *ftFace, index1, index2, ft_kerning_unfitted, &kernAdvance);
if( !err)
{
- kernAdvance.x /= 64; kernAdvance.y /= 64;
+ kernAdvance.x /= 64;
+ kernAdvance.y /= 64;
}
}
- return kernAdvance;
+ return FTPoint( kernAdvance);
}