Changed from FT_Glyph to FT_GlyphSlot
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
diff --git a/include/FTBBox.h b/include/FTBBox.h
index 5e68f14..70f7fa4 100755
--- a/include/FTBBox.h
+++ b/include/FTBBox.h
@@ -46,10 +46,20 @@ class FTGL_EXPORT FTBBox
* @param glyph A freetype glyph
*/
FTBBox( FT_GlyphSlot glyph)
+ : lowerX(0.0f),
+ lowerY(0.0f),
+ lowerZ(0.0f),
+ upperX(0.0f),
+ upperY(0.0f),
+ upperZ(0.0f)
{
FT_BBox bbox;
FT_Glyph glyphImage;
- FT_Get_Glyph( glyph, &glyphImage ); // FIXME err
+ if( FT_Get_Glyph( glyph, &glyphImage ))
+ {
+ return;
+ }
+
FT_Glyph_Get_CBox( glyphImage, ft_glyph_bbox_subpixels, &bbox );
lowerX = static_cast<float>( bbox.xMin) / 64.0f;
@@ -57,7 +67,9 @@ class FTGL_EXPORT FTBBox
lowerZ = 0.0f;
upperX = static_cast<float>( bbox.xMax) / 64.0f;
upperY = static_cast<float>( bbox.yMax) / 64.0f;
- upperZ = 0.0f;
+ upperZ = 0.0f;
+
+ FT_Done_Glyph( glyphImage);
}
/**