Commit b2b7f0b515067ed8f9ca3b18d2e233efbe6a58cb

henry 2001-11-12T02:33:04

Added bounding box function un-virtualised some functions fixed comments

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