Set the bounding box
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
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 );