Jesse's Development Blog: 2009 Archive
Sept. 5th, 2009
Simple word wrapping algorithm for Python's PIL
I recently found a need to use the Python Imaging library (PIL) to generate images containing sizable amounts of text. PIL is a very basic image library and has no support for typesetting. This is how I implemented the minimum length (greedy) algorithm, as detailed on Wikipedia.