reportlab/platypus/paragraph.py
changeset 2938 5115bf2e8eeb
parent 2936 97860052e0fc
child 2940 a0e54b5117ce
equal deleted inserted replaced
2937:697916a51ad7 2938:5115bf2e8eeb
   495     textlen = tx._canvas.stringWidth(join(tx.XtraState.lines[i][1]), tx._fontname, tx._fontsize)
   495     textlen = tx._canvas.stringWidth(join(tx.XtraState.lines[i][1]), tx._fontname, tx._fontsize)
   496     tx._canvas.line(t_off, y, t_off+textlen+ws, y)
   496     tx._canvas.line(t_off, y, t_off+textlen+ws, y)
   497 
   497 
   498 _scheme_re = re.compile('^[a-zA-Z][-+a-zA-Z0-9]+$')
   498 _scheme_re = re.compile('^[a-zA-Z][-+a-zA-Z0-9]+$')
   499 def _doLink(tx,link,rect):
   499 def _doLink(tx,link,rect):
   500     if type(link) is unicode:
   500     if isinstance(link,unicode):
   501         link = unicode.encode('utf8')
   501         link = link.encode('utf8')
   502     parts = link.split(':',1)
   502     parts = link.split(':',1)
   503     scheme = len(parts)==2 and parts[0].lower() or ''
   503     scheme = len(parts)==2 and parts[0].lower() or ''
   504     if _scheme_re.match(scheme) and scheme!='document':
   504     if _scheme_re.match(scheme) and scheme!='document':
   505         kind=scheme.lower()=='pdf' and 'GoToR' or 'URI'
   505         kind=scheme.lower()=='pdf' and 'GoToR' or 'URI'
   506         if kind=='GoToR': link = parts[1]
   506         if kind=='GoToR': link = parts[1]