Added rise attribute
authorrgbecker
Tue, 11 Apr 2000 15:03:41 +0000
changeset 112 1d4892961fdb
parent 111 52f6b8586dbf
child 113 2c20ecb9015e
Added rise attribute
reportlab/platypus/paraparser.py
--- a/reportlab/platypus/paraparser.py	Tue Apr 11 14:43:43 2000 +0000
+++ b/reportlab/platypus/paraparser.py	Tue Apr 11 15:03:41 2000 +0000
@@ -233,6 +233,7 @@
 		frag = ParaFrag()
 		frag.sub = 0
 		frag.super = 0
+		frag.rise = 0
 		frag.fontName, frag.bold, frag.italic = ps2tt(style.fontName)
 		frag.fontSize = style.fontSize
 		frag.underline = 0
@@ -257,6 +258,13 @@
 			frag.sub = 0
 			frag.super = 0
 
+		if frag.sub:
+			frag.rise = -frag.fontSize*subFraction
+			frag.fontSize = max(frag.fontSize-sizeDelta,3)
+		elif frag.sub:
+			frag.rise = frag.fontSize*superFraction
+			frag.fontSize = min(frag.fontSize-sizeDelta,3)
+
 		if frag.greek: frag.fontName = 'symbol'
 		# bold, italic, and underline
 		frag.fontName = tt2ps(frag.fontName,frag.bold,frag.italic)