Commit 5b379896a25f993eacb6ac837a8494dafd4aef65

henry 2002-02-06T02:40:51

inlined the ascender and descender functions

diff --git a/include/FTFont.h b/include/FTFont.h
index d8fb20c..d87de19 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -1,16 +1,16 @@
 #ifndef		__FTFont__
 #define		__FTFont__
 
-#include <string>
+#include    <string>
 
-#include <ft2build.h>
-#include FT_FREETYPE_H
+#include    <ft2build.h>
+#include    FT_FREETYPE_H
 
-#include "FTGL.h"
-#include "FTFace.h"
+#include    "FTGL.h"
+#include    "FTFace.h"
 
-class FTGlyphContainer;
 class FTGlyph;
+class FTGlyphContainer;
 
 using namespace std;
 
@@ -92,14 +92,14 @@ class FTGL_EXPORT FTFont
 		 *
 		 * @return	Ascender height
 		 */
-		int	Ascender() const;
+		inline int	Ascender() const { return charSize.Ascender(); }
 		
 		/**
 		 * Gets the global descender height for the face.
 		 *
 		 * @return	Descender height
 		 */
-		int	Descender() const;
+		inline int	Descender() const { return charSize.Descender(); }
 
 		/**
 		 * Get the bounding box for a string.
@@ -186,7 +186,7 @@ class FTGL_EXPORT FTFont
 		 * @return	<code>true</code> on success.
 		 */
 		virtual bool MakeGlyphList();
-		
+
 		/**
 		 * Get the advance width for a character.
 		 *
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index d0319ed..86283bd 100755
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -1,6 +1,5 @@
 #include	"FTFace.h"
 #include	"FTFont.h"
-#include	"FTGlyphContainer.h"
 #include	"FTGlyph.h" // for FTBbox
 #ifdef FTGL_DEBUG
 	#include "mmgr.h"
@@ -70,24 +69,6 @@ bool FTFont::FaceSize( const unsigned int size, const unsigned int res )
 }
 
 
-bool FTFont::MakeGlyphList()
-{
-	for( unsigned int c = 0; c < numGlyphs; ++c)
-	{
-		if( preCache)
-		{
-			glyphList->Add( MakeGlyph( c), c);
-		}
-		else
-		{
-			glyphList->Add( NULL, c);
-		}
-	}
-	
-	return !err; // FIXME what err?
-}
-
-
 bool FTFont::CharMap( FT_Encoding encoding)
 {
 	err = face.CharMap( encoding);
@@ -95,15 +76,21 @@ bool FTFont::CharMap( FT_Encoding encoding)
 }
 
 
-int	FTFont::Ascender() const
-{
-	return charSize.Ascender();
-}
-
-
-int	FTFont::Descender() const
+bool FTFont::MakeGlyphList()
 {
-	return charSize.Descender();
+    for( unsigned int c = 0; c < numGlyphs; ++c)
+    {
+        if( preCache)
+        {
+            glyphList->Add( MakeGlyph( c), c);
+        }
+        else
+        {
+            glyphList->Add( NULL, c);
+        }
+    }
+    
+    return !err; // From derived class MakeGlyph()
 }