Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I do text wrapping in pyCairo + Pango?

What I need pyCairo to do is :

  • generate an image of size 100x100 containing some text and an image from filesystem as background
  • the text should be within a box which has text wrapping of size 20x20 with bottom left corner at (40,40).
  • save this image
like image 705
Nullpoet Avatar asked Dec 29 '09 10:12

Nullpoet


1 Answers

You need to find a way to get the Pango context and set pango.Layout.set_wrap() and pango.Layout.set_width().

like image 180
joeforker Avatar answered Oct 27 '22 07:10

joeforker