Commit b37ad01a715e588f06332c742be4a16cd50ccf7a

henry 2002-11-27T07:38:52

Changes for FTPoint

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);
 }