[reportlab-users] WordCount in reportlab paragraph

Andy Robinson andy at reportlab.com
Fri Feb 27 10:37:43 EST 2009


2009/2/27 Robin Becker <robin at reportlab.com>:

>> This kind of problem is eminently suited to unit tests, when

>

> when the unit test framework can look at our pdfs and see that a word is not

> properly aligned then I'll give in. We could try saving images of these

> problems (say using ghost script) and then compare images.


Surely we can assume a built-in font (Courier, always 0.6em wide),
construct a paragraph, call wrap(), and then assert that certain
text appears in line 1, line 2 and so on, and that the amount of
extra space on each line is 'as expected'?

- Andy


More information about the reportlab-users mailing list