Category Archives: Code

limitations of python text wrapper – a modest workaround

Writting text on image using TextWrap and PIL seems easy at first sight…but some users are suffering to know exactly what will be the dimensions of the wrap. There are  2 problems : 


This takes carlim in parameters and not the desired dimension of the box.


This may give a bad estimation when you use a custom font.
I describe in this post my solution to tackle these two problems. Continue reading