Added bounding box function un-virtualised some functions fixed comments
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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
diff --git a/include/FTFont.h b/include/FTFont.h
index 245b511..7acb809 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -3,11 +3,10 @@
#include <string>
-#include "FTGL.h"
-
#include <ft2build.h>
#include FT_FREETYPE_H
+#include "FTGL.h"
#include "FTFace.h"
class FTGlyphContainer;
@@ -44,7 +43,7 @@ class FTGL_EXPORT FTFont
virtual ~FTFont();
/**
- * Opens and reads a font file.
+ * Open and read a font file.
*
* @param fontname font file name.
* @param preCache A flag to indicate whether or not to build
@@ -54,70 +53,96 @@ class FTGL_EXPORT FTFont
* @return <code>true</code> if file has opened
* successfully.
*/
- virtual bool Open( const char* fontname, bool preCache = true);
+ bool Open( const char* fontname, bool preCache = true);
/**
* Disposes of the font
*/
- virtual void Close();
+ void Close();
/**
- * Sets the char size for the current face.
+ * Set the char size for the current face.
*
* @param size the face size in points (1/72 inch)
* @param res the resolution of the target device.
* @return <code>true</code> if size was set correctly
*/
- virtual bool FaceSize( const unsigned int size, const unsigned int res = 72);
+ bool FaceSize( const unsigned int size, const unsigned int res = 72);
/**
- * Sets the character map for the face.
+ * Set the character map for the face.
*
* @param encoding Freetype enumerate for char map code.
* @return <code>true</code> if charmap was valid and
* set correctly
*/
- virtual bool CharMap( FT_Encoding encoding );
+ bool CharMap( FT_Encoding encoding );
/**
- * Gets the global ascender height for the face.
+ * Get the global ascender height for the face.
*
* @return Ascender height
*/
- virtual int Ascender() const;
+ int Ascender() const;
/**
* Gets the global descender height for the face.
*
* @return Descender height
*/
- virtual int Descender() const;
-
+ int Descender() const;
+
+ /**
+ * Get the bounding box for a string.
+ *
+ * @param string a char string
+ * @param llx lower left near x coord
+ * @param lly lower left near y coord
+ * @param llz lower left near z coord
+ * @param urx upper right far x coord
+ * @param ury upper right far y coord
+ * @param urz upper right far z coord
+ */
+ void BBox( const char* text, int& llx, int& lly, int& llz, int& urx, int& ury, int& urz);
+
+ /**
+ * Get the bounding box for a string.
+ *
+ * @param string a wchar_t string
+ * @param llx lower left near x coord
+ * @param lly lower left near y coord
+ * @param llz lower left near z coord
+ * @param urx upper right far x coord
+ * @param ury upper right far y coord
+ * @param urz upper right far z coord
+ */
+ void BBox( const wchar_t* string, int& llx, int& lly, int& llz, int& urx, int& ury, int& urz);
+
/**
- * Gets the advance width for a string.
+ * Get the advance width for a string.
*
- * param string a wchar_t string
+ * @param string a wchar_t string
* @return advance width
*/
float Advance( const wchar_t* string);
/**
- * Gets the advance width for a string.
+ * Get the advance width for a string.
*
- * param string a char string
+ * @param string a char string
* @return advance width
*/
float Advance( const char* string);
/**
- * Renders a string of characters
+ * Render a string of characters
*
* @param string 'C' style string to be output.
*/
virtual void render( const char* string );
/**
- * Renders a string of characters
+ * Render a string of characters
*
* @param string wchar_t string to be output.
*/
@@ -151,7 +176,7 @@ class FTGL_EXPORT FTFont
*
* @return <code>true</code> on success.
*/
- virtual bool MakeGlyphList();
+ bool MakeGlyphList();
/**
* Current face object