Added accessors for point size
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
diff --git a/include/FTFont.h b/include/FTFont.h
index 5338dfa..c2daa0c 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -88,6 +88,13 @@ class FTGL_EXPORT FTFont
bool FaceSize( const unsigned int size, const unsigned int res = 72);
/**
+ * Get the the current face.
+ *
+ * @return face size
+ */
+ unsigned int FaceSize() const;
+
+ /**
* Set the extrusion distance for the font. Only availbale for
* Extruded fonts
*
@@ -95,7 +102,6 @@ class FTGL_EXPORT FTFont
*/
virtual void Depth( float){}
-
/**
* Set the character map for the face.
*
diff --git a/include/FTSize.h b/include/FTSize.h
index 6019e8f..d3078db 100755
--- a/include/FTSize.h
+++ b/include/FTSize.h
@@ -42,6 +42,13 @@ class FTGL_EXPORT FTSize
bool CharSize( FT_Face* face, unsigned int point_size, unsigned int x_resolution, unsigned int y_resolution );
/**
+ * get the char size for the current face.
+ *
+ * @return The char size in points
+ */
+ unsigned int CharSize() const;
+
+ /**
* Gets the global ascender height for the face in pixels.
*
* @return Ascender height
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index f795ef6..377a577 100755
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -92,6 +92,12 @@ bool FTFont::FaceSize( const unsigned int size, const unsigned int res )
}
+unsigned int FTFont::FaceSize() const
+{
+ return charSize.CharSize();
+}
+
+
bool FTFont::MakeGlyphList()
{
for( unsigned int c = 0; c < numGlyphs; ++c)
diff --git a/src/FTSize.cpp b/src/FTSize.cpp
index 748251c..a9ad747 100755
--- a/src/FTSize.cpp
+++ b/src/FTSize.cpp
@@ -24,6 +24,12 @@ bool FTSize::CharSize( FT_Face* face, unsigned int point_size, unsigned int x_re
}
+unsigned int FTSize::CharSize() const
+{
+ return size;
+}
+
+
int FTSize::Ascender() const
{
return ftSize->metrics.ascender >> 6;