Changes for FTPoint & FTBBox
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
diff --git a/include/FTFont.h b/include/FTFont.h
index 8867e6c..285d71f 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -243,7 +243,7 @@ class FTGL_EXPORT FTFont
/**
* Current pen or cursor position;
*/
- FT_Vector pen;
+ FTPoint pen;
/**
* Current error code. Zero means no error.
@@ -269,6 +269,8 @@ class FTGL_EXPORT FTFont
* @param nextChr next character
*/
inline void doRender( const unsigned int chr, const unsigned int nextChr);
+
+
};
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index 7ff67c9..9f53253 100755
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -1,7 +1,7 @@
#include "FTFace.h"
#include "FTFont.h"
#include "FTGlyphContainer.h"
-#include "FTGlyph.h" // for FTBbox
+#include "FTBBox.h"
FTFont::FTFont()
@@ -153,11 +153,11 @@ void FTFont::BBox( const char* string,
bbox = glyphList->BBox( *c);
// Lower extent
- lly = lly < bbox.y1 ? lly: bbox.y1;
+ lly = lly < bbox.lowerY ? lly: bbox.lowerY;
// Upper extent
- ury = ury > bbox.y2 ? ury: bbox.y2;
+ ury = ury > bbox.upperY ? ury: bbox.upperY;
// Depth
- urz = urz < bbox.z2 ? urz: bbox.z2;
+ urz = urz < bbox.upperZ ? urz: bbox.upperZ;
// Width
urx += glyphList->Advance( *c, *(c + 1));
@@ -165,9 +165,9 @@ void FTFont::BBox( const char* string,
}
//Final adjustments
- llx = glyphList->BBox( *string).x1;
+ llx = glyphList->BBox( *string).lowerX;
urx -= glyphList->Advance( *(c - 1), 0);
- urx += bbox.x2;
+ urx += bbox.upperX;
}
@@ -189,11 +189,11 @@ void FTFont::BBox( const wchar_t* string,
bbox = glyphList->BBox( *c);
// Lower extent
- lly = lly < bbox.y1 ? lly: bbox.y1;
+ lly = lly < bbox.lowerY ? lly: bbox.lowerY;
// Upper extent
- ury = ury > bbox.y2 ? ury: bbox.y2;
+ ury = ury > bbox.upperY ? ury: bbox.upperY;
// Depth
- urz = urz < bbox.z2 ? urz: bbox.z2;
+ urz = urz < bbox.upperZ ? urz: bbox.upperZ;
// Width
urx += glyphList->Advance( *c, *(c + 1));
@@ -201,9 +201,9 @@ void FTFont::BBox( const wchar_t* string,
}
//Final adjustments
- llx = glyphList->BBox( *string).x1;
+ llx = glyphList->BBox( *string).lowerX;
urx -= glyphList->Advance( *(c - 1), 0);
- urx += bbox.x2;
+ urx += bbox.upperX;
}
@@ -284,7 +284,7 @@ void FTFont::doRender( const unsigned int chr, const unsigned int nextChr)
glyphList->Add( MakeGlyph( g), g);
}
- FT_Vector kernAdvance = glyphList->render( chr, nextChr, pen);
+ FTPoint kernAdvance = glyphList->render( chr, nextChr, pen);
pen.x += kernAdvance.x;
pen.y += kernAdvance.y;