Commit 50552cd46259c0641675dcedabc6d59b0ecb20ed

henry 2001-08-28T05:09:26

Fixed the test for an invalid glyph format

diff --git a/src/FTBitmapGlyph.cpp b/src/FTBitmapGlyph.cpp
index 4663638..e2bc09b 100755
--- a/src/FTBitmapGlyph.cpp
+++ b/src/FTBitmapGlyph.cpp
@@ -10,12 +10,9 @@ FTBitmapGlyph::FTBitmapGlyph( FT_Glyph glyph, unsigned int gi)
 	destHeight(0),
 	data(0)
 {
-	if( !glyph->format == ft_glyph_format_bitmap)
-	{ return;}
-	
 	// This function will always fail if the glyph's format isn't scalable????
 	FT_Error err = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_mono, 0, 1);
-	if( err)
+	if( err || ft_glyph_format_bitmap != glyph->format)
 	{return;}
 
 	FT_BitmapGlyph  bitmap = (FT_BitmapGlyph)glyph;
diff --git a/src/FTPixmapGlyph.cpp b/src/FTPixmapGlyph.cpp
index 87b9750..7011e73 100755
--- a/src/FTPixmapGlyph.cpp
+++ b/src/FTPixmapGlyph.cpp
@@ -11,13 +11,10 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph, const unsigned int gi)
 	numGreys(0),
 	data(0)
 {
-	if( !glyph->format == ft_glyph_format_bitmap)
-	{ return;}
-	
 	// This function will always fail if the glyph's format isn't scalable????
 	FT_Error err = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_normal, 0, 1);
-	if( err)
-	{return;}
+	if( err || ft_glyph_format_bitmap != glyph->format)
+	{ return;}
 
 	FT_BitmapGlyph  bitmap = (FT_BitmapGlyph)glyph;
 	FT_Bitmap*      source = &bitmap->bitmap;
diff --git a/src/FTTextureGlyph.cpp b/src/FTTextureGlyph.cpp
index 965f1cf..7d81b38 100755
--- a/src/FTTextureGlyph.cpp
+++ b/src/FTTextureGlyph.cpp
@@ -13,13 +13,10 @@ FTTextureGlyph::FTTextureGlyph( FT_Glyph glyph, unsigned int gi, int id, unsigne
 	numGreys(0),
 	glTextureID(id)
 {
-	if( !glyph->format == ft_glyph_format_bitmap)
-	{ return;}
-	
 	// This function will always fail if the glyph's format isn't scalable????
 	err = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_normal, 0, 1);
-	if( err)
-	{return;}
+	if( err || glyph->format != ft_glyph_format_bitmap)
+	{ return;}
 
 	FT_BitmapGlyph  bitmap = ( FT_BitmapGlyph)glyph;
 	FT_Bitmap*      source = &bitmap->bitmap;