- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
def _elementWidth(self,v,s):
t = type(v)
if t in _SeqTypes:
w = 0
for e in v:
ew = self._elementWidth(self,v)
if ew is None: return None
w = max(w,ew)
return w
elif isinstance(v,Flowable) and v._fixedWidth:
return v.width
else:
if t is not StringType: v = v is None and '' or str(v)
v = string.split(v, "\n")
return max(map(lambda a, b=s.fontname, c=s.fontsize,d=pdfmetrics.stringWidth: d(a,b,c), v))