reportlab/platypus/paraparser.py
changeset 112 1d4892961fdb
parent 102 1818e7fa3738
child 113 2c20ecb9015e
equal deleted inserted replaced
111:52f6b8586dbf 112:1d4892961fdb
   231 
   231 
   232 		# initialize frag values
   232 		# initialize frag values
   233 		frag = ParaFrag()
   233 		frag = ParaFrag()
   234 		frag.sub = 0
   234 		frag.sub = 0
   235 		frag.super = 0
   235 		frag.super = 0
       
   236 		frag.rise = 0
   236 		frag.fontName, frag.bold, frag.italic = ps2tt(style.fontName)
   237 		frag.fontName, frag.bold, frag.italic = ps2tt(style.fontName)
   237 		frag.fontSize = style.fontSize
   238 		frag.fontSize = style.fontSize
   238 		frag.underline = 0
   239 		frag.underline = 0
   239 		frag.greek = 0
   240 		frag.greek = 0
   240 		frag.textColor = style.textColor
   241 		frag.textColor = style.textColor
   254 
   255 
   255 		# if sub and super are both one they will cancel each other out
   256 		# if sub and super are both one they will cancel each other out
   256 		if frag.sub == 1 and frag.super == 1:
   257 		if frag.sub == 1 and frag.super == 1:
   257 			frag.sub = 0
   258 			frag.sub = 0
   258 			frag.super = 0
   259 			frag.super = 0
       
   260 
       
   261 		if frag.sub:
       
   262 			frag.rise = -frag.fontSize*subFraction
       
   263 			frag.fontSize = max(frag.fontSize-sizeDelta,3)
       
   264 		elif frag.sub:
       
   265 			frag.rise = frag.fontSize*superFraction
       
   266 			frag.fontSize = min(frag.fontSize-sizeDelta,3)
   259 
   267 
   260 		if frag.greek: frag.fontName = 'symbol'
   268 		if frag.greek: frag.fontName = 'symbol'
   261 		# bold, italic, and underline
   269 		# bold, italic, and underline
   262 		frag.fontName = tt2ps(frag.fontName,frag.bold,frag.italic)
   270 		frag.fontName = tt2ps(frag.fontName,frag.bold,frag.italic)
   263 
   271