fix usage of instanceStringWidthT1 py33
authorrobin
Mon, 18 Nov 2013 15:17:31 +0000
branchpy33
changeset 3786 5008a8b9567b
parent 3785 974819935ede
child 3787 8f9be6d6f75c
fix usage of instanceStringWidthT1
src/reportlab/pdfbase/pdfmetrics.py
src/rl_addons/rl_accel/_rl_accel.c
tests/test_platypus_wrapping.py
--- a/src/reportlab/pdfbase/pdfmetrics.py	Mon Nov 18 15:03:20 2013 +0000
+++ b/src/reportlab/pdfbase/pdfmetrics.py	Mon Nov 18 15:17:31 2013 +0000
@@ -355,7 +355,7 @@
         self._notdefFont = name=='ZapfDingbats' and self or _notdefFont
 
     def stringWidth(self, text, size, encoding='utf8'):
-        return _instanceStringWidthU(self, text, size, encoding=encoding)
+        return instanceStringWidthT1(self, text, size, encoding=encoding)
 
     def __repr__(self):
         return "<%s %s>" % (self.__class__.__name__, self.face.name)
--- a/src/rl_addons/rl_accel/_rl_accel.c	Mon Nov 18 15:03:20 2013 +0000
+++ b/src/rl_addons/rl_accel/_rl_accel.c	Mon Nov 18 15:17:31 2013 +0000
@@ -727,7 +727,7 @@
 	Py_DECREF(_o1);
 	goto L_OK;
 L_ERR:
-	ADD_TB(module,"instanceStringWidthU");
+	ADD_TB(module,"instanceStringWidthT1");
 	Py_XDECREF(_o1);
 	Py_XDECREF(_o2);
 	Py_XDECREF(_o3);
--- a/tests/test_platypus_wrapping.py	Mon Nov 18 15:03:20 2013 +0000
+++ b/tests/test_platypus_wrapping.py	Mon Nov 18 15:17:31 2013 +0000
@@ -6,9 +6,7 @@
 from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
 setOutDir(__name__)
 import sys, os, random
-from string import split, strip, join, whitespace
 from operator import truth
-from types import StringType, ListType
 import unittest
 from reportlab.pdfbase.pdfmetrics import stringWidth
 from reportlab.platypus.paraparser import ParaParser
@@ -85,7 +83,7 @@
         story.append(Paragraph('This is an attempt to break long URLs sanely.  Here is a file name: <font face="Courier">C:\\Windows\\System32\\Drivers\\etc\\hosts</font>.  ', bt))
         
 
-        story.append(Paragraph('This paragraph has a URL (basically, a word) too long to fit on one line, so it just overflows. http://some-really-long-site.somewhere-verbose.com/webthingies/framework/xc4987236hgsdlkafh/foo?format=dingbats&content=rubbish. Ideally, we would wrap it in the middle.', bt))
+        story.append(Paragraph('This paragraph has a URL (basically, a word) too long to fit on one line, so it just overflows. http://some-really-long-site.somewhere-verbose.com/webthingies/framework/xc4987236hgsdlkafh/foo?format=dingbats&amp;content=rubbish. Ideally, we would wrap it in the middle.', bt))