Commit 1ce1050a9bdd2aad115d924709fb30e07ef3e5de

henry 2001-11-12T02:39:05

Set the bounding box

diff --git a/src/FTBitmapGlyph.cpp b/src/FTBitmapGlyph.cpp
index 124249d..6429171 100755
--- a/src/FTBitmapGlyph.cpp
+++ b/src/FTBitmapGlyph.cpp
@@ -22,11 +22,6 @@ FTBitmapGlyph::FTBitmapGlyph( FT_Glyph glyph)
 	int srcHeight = source->rows;
 	int srcPitch = source->pitch;
     
-	advance = static_cast<float>(glyph->advance.x >> 16);
-
- 	pos.x = bitmap->left;
-	pos.y = srcHeight - bitmap->top;
-	
    // FIXME What about dest alignment?
     destWidth = srcWidth;
     destHeight = srcHeight;
@@ -44,6 +39,11 @@ FTBitmapGlyph::FTBitmapGlyph( FT_Glyph glyph)
 
     destHeight = srcHeight;
 
+	bBox = FTBBox( glyph);
+	advance = static_cast<float>(glyph->advance.x >> 16);
+ 	pos.x = bitmap->left;
+	pos.y = srcHeight - bitmap->top;
+	
 	// discard glyph image (bitmap or not)
 	// Is this the right place to do this?
 	FT_Done_Glyph( glyph );
diff --git a/src/FTPixmapGlyph.cpp b/src/FTPixmapGlyph.cpp
index 8dd5873..465d95b 100755
--- a/src/FTPixmapGlyph.cpp
+++ b/src/FTPixmapGlyph.cpp
@@ -26,12 +26,6 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph)
 	int srcHeight = source->rows;
 	int srcPitch = source->pitch;
     
-	numGreys = source->num_grays;
-	advance = glyph->advance.x >> 16;
-
- 	pos.x = bitmap->left;
-	pos.y = srcHeight - bitmap->top;
-	
    // FIXME What about dest alignment?
     destWidth = srcWidth;
     destHeight = srcHeight;
@@ -56,6 +50,12 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph)
 
     destHeight = srcHeight;
 
+	bBox = FTBBox( glyph);
+	numGreys = source->num_grays;
+	advance = glyph->advance.x >> 16;
+ 	pos.x = bitmap->left;
+	pos.y = srcHeight - bitmap->top;
+	
 	// discard glyph image (bitmap or not)
 	// Is this the right place to do this?
 	FT_Done_Glyph( glyph );