Commit e4142e5a7cb4a08ce0fdc9fadef065c119af908a

henry 2002-12-08T08:56:59

Fixes for broken glyphs. Uses numberOfContours as a flag that the glyph is valid.

diff --git a/include/FTVectoriser.h b/include/FTVectoriser.h
index 0ee24db..5672d96 100644
--- a/include/FTVectoriser.h
+++ b/include/FTVectoriser.h
@@ -220,9 +220,14 @@ class FTGL_EXPORT FTVectoriser
          * A Mesh for tesselations
          */
         FTMesh* mesh;
+        
+        /**
+         *
+         */
+        short ftContourCount;
 
         /**
-        * A flag indicating the tesselation rule for the glyph
+         * A flag indicating the tesselation rule for the glyph
          */
         int contourFlag;
 
diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp
index 58b9c91..c237bc5 100644
--- a/src/FTVectoriser.cpp
+++ b/src/FTVectoriser.cpp
@@ -111,8 +111,9 @@ FTVectoriser::FTVectoriser( const FT_Glyph glyph)
     {
         FT_OutlineGlyph outline = (FT_OutlineGlyph)glyph;
         ftOutline = outline->outline;
-    
-        contourList.reserve( ftOutline.n_contours);
+        
+        ftContourCount = ftOutline.n_contours;;
+        contourList.reserve( ftContourCount);
         contourFlag = ftOutline.flags;
     }
 }
@@ -134,12 +135,11 @@ FTVectoriser::~FTVectoriser()
 
 void FTVectoriser::ProcessContours()
 {
-    const short contourCount = ftOutline.n_contours;
     short contourLength = 0;
     short startIndex = 0;
     short endIndex = 0;
     
-    for( short contourIndex = 0; contourIndex < contourCount; ++contourIndex)
+    for( short contourIndex = 0; contourIndex < ftContourCount; ++contourIndex)
     {
         FT_Vector* pointList = &ftOutline.points[startIndex];
         char* tagList = &ftOutline.tags[startIndex];