* Re-add FTFont::BBox() implementations with the old prototype, in case old projects use them.
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/src/FTGL/FTFont.h b/src/FTGL/FTFont.h
index b22ef48..568cc03 100644
--- a/src/FTGL/FTFont.h
+++ b/src/FTGL/FTFont.h
@@ -228,6 +228,25 @@ class FTGL_EXPORT FTFont
FTPoint spacing = FTPoint(0, 0, 0));
/**
+ * Get the bounding box for a string (deprecated).
+ *
+ * @param string A char buffer.
+ * @param llx Lower left near x coordinate.
+ * @param lly Lower left near y coordinate.
+ * @param llz Lower left near z coordinate.
+ * @param urx Upper right far x coordinate.
+ * @param ury Upper right far y coordinate.
+ * @param urz Upper right far z coordinate.
+ */
+ void BBox(const char* string, float& llx, float& lly, float& llz,
+ float& urx, float& ury, float& urz)
+ {
+ FTBBox b = BBox(string);
+ llx = b.Lower().Xf(); lly = b.Lower().Yf(); llz = b.Lower().Zf();
+ urx = b.Upper().Xf(); ury = b.Upper().Yf(); urz = b.Upper().Zf();
+ }
+
+ /**
* Get the bounding box for a string.
*
* @param string A wchar_t buffer.
@@ -239,11 +258,30 @@ class FTGL_EXPORT FTFont
* has been checked (optional).
* @return The corresponding bounding box.
*/
- virtual FTBBox BBox(const wchar_t *string, const int end = -1,
+ virtual FTBBox BBox(const wchar_t *string, const int len = -1,
FTPoint position = FTPoint(0, 0, 0),
FTPoint spacing = FTPoint(0, 0, 0));
/**
+ * Get the bounding box for a string (deprecated).
+ *
+ * @param string A wchar_t buffer.
+ * @param llx Lower left near x coordinate.
+ * @param lly Lower left near y coordinate.
+ * @param llz Lower left near z coordinate.
+ * @param urx Upper right far x coordinate.
+ * @param ury Upper right far y coordinate.
+ * @param urz Upper right far z coordinate.
+ */
+ void BBox(const wchar_t* string, float& llx, float& lly, float& llz,
+ float& urx, float& ury, float& urz)
+ {
+ FTBBox b = BBox(string);
+ llx = b.Lower().Xf(); lly = b.Lower().Yf(); llz = b.Lower().Zf();
+ urx = b.Upper().Xf(); ury = b.Upper().Yf(); urz = b.Upper().Zf();
+ }
+
+ /**
* Get the advance for a string.
*
* @param string 'C' style string to be checked.
@@ -255,7 +293,7 @@ class FTGL_EXPORT FTFont
* has been checked (optional).
* @return The new pen position after the last character.
*/
- virtual FTPoint Advance(const char* string, const int end = -1,
+ virtual FTPoint Advance(const char* string, const int len = -1,
FTPoint position = FTPoint(0, 0, 0),
FTPoint spacing = FTPoint(0, 0, 0));
@@ -271,7 +309,7 @@ class FTGL_EXPORT FTFont
* has been checked (optional).
* @return The new pen position after the last character.
*/
- virtual FTPoint Advance(const wchar_t* string, const int end = -1,
+ virtual FTPoint Advance(const wchar_t* string, const int len = -1,
FTPoint position = FTPoint(0, 0, 0),
FTPoint spacing = FTPoint(0, 0, 0));
@@ -288,7 +326,7 @@ class FTGL_EXPORT FTFont
* @param renderMode Render mode to use for display (optional).
* @return The new pen position after the last character was output.
*/
- virtual FTPoint Render(const char* string, const int end = -1,
+ virtual FTPoint Render(const char* string, const int len = -1,
FTPoint position = FTPoint(0, 0, 0),
FTPoint spacing = FTPoint(0, 0, 0),
int renderMode = FTGL::RENDER_ALL);
@@ -306,7 +344,7 @@ class FTGL_EXPORT FTFont
* @param renderMode Render mode to use for display (optional).
* @return The new pen position after the last character was output.
*/
- virtual FTPoint Render(const wchar_t *string, const int end = -1,
+ virtual FTPoint Render(const wchar_t *string, const int len = -1,
FTPoint position = FTPoint(0, 0),
FTPoint spacing = FTPoint(0, 0),
int renderMode = FTGL::RENDER_ALL);