[reportlab-users] Experimenting with new paragraphs

Dinu Gherman gherman at darwin.in-berlin.de
Sun Dec 16 09:31:55 EST 2007


I wrote:


> 1. http://python.net/~gherman/tmp/Macaulay-IconizedParagraph.pdf

> 2. http://python.net/~gherman/tmp/Macaulay-ColouredParagraph.pdf



I should have also posted a hyphenation sample, so here it is:

3. http://python.net/~gherman/tmp/Macaulay-HyphenatedParagraph.pdf
4. http://python.net/~gherman/tmp/Macaulay-Paragraph.pdf

(4) is generated using the standard RL paragraph class and (3) is
generated with a hyphenation paragraph (using simply PyHnj). When
run on the full sample file as hosted by a text from Macaulay as
hosted by the Gutenberg project (including meta info) under:

http://www.gutenberg.org/etext/2332

I get a reduction from 523 to 511.5 (or 2.2 %) pages due to hyphen-
ation, plus much less ragged text. This is not perfect and I think
the reduction could be closer to 3 %, but this is due to the quality
of the standard hyphenation dictionary. For a similar case with Ger-
man text I suspect this to be closer to 5 %, but I still have to
fiddle a bit with encodings...

In any case it's much better than nothing, especially since it takes
only about 50 lines of code for adding this kind hypenation to a
minimal paragraph and it can be further tweaked to handle special
cases, if needed.

Regards,

Dinu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20071216/dda27fbc/attachment.htm>


More information about the reportlab-users mailing list