reportlab/pdfbase/pdfmetrics.py
changeset 2574 d81949596070
parent 2506 aa058aaf324c
child 2575 0cba68b93555
--- a/reportlab/pdfbase/pdfmetrics.py	Wed Mar 15 12:22:10 2006 +0000
+++ b/reportlab/pdfbase/pdfmetrics.py	Wed Mar 15 16:47:27 2006 +0000
@@ -654,6 +654,19 @@
         registerFont(font)
         return font
 
+def getAscentDescent(fontName):
+    font = getFont(fontName)
+    try:
+        return font.ascent,font.descent
+    except:
+        return font.face.ascent,font.face.descent
+
+def getAscent(fontName):
+    return getAscentDescent(fontName)[0]
+
+def getDescent(fontName):
+    return getAscentDescent(fontName)[1]
+
 def getRegisteredFontNames():
     "Returns what's in there"
     reg = _fonts.keys()