GNOME Bugzilla – Bug 680680
PangoLayout.set_font_description doesn't accept Pango.FontDescription as attribute
Last modified: 2012-07-27 13:08:28 UTC
Hello, I'm using Python with Gtk3, Cairo and Pango on my application and I found this issue (the activity[1] was written in gtk2, cairo and pango). I'm getting this error when I try to set the "PangoFontDescription" and I don't know why. (Epdb) fd <PangoFontDescription at 0x2bbb8f0> (Epdb) pango_layout.set_font_description() *** TypeError: Required argument 'desc' (pos 1) not found (Epdb) pango_layout <pango.Layout object at 0x2b5dc30 (PangoLayout at 0x2ab2430)> (Epdb) Hope this bug report helps. See you and thanks, [1] http://git.sugarlabs.org/typing-turtle
Sorry, I pasted the wrong chunk of code. Here is the correct one: (Epdb) fd = Pango.FontDescription('Monospace') (Epdb) fd.set_size(10 * Pango.SCALE) (Epdb) pango_layout.set_font_description(fd) *** TypeError: desc should be a PangoFontDescription or None (Epdb) fd <PangoFontDescription at 0x2a67060> (Epdb) pango_layout <pango.Layout object at 0x2a13a00 (PangoLayout at 0x2964b70)> (Epdb)
My apologies. It was my fault. I found that there was an "import pangocairo" in one of the files and it seems it was generating a conflict with the "from gi.repository import PangoCairo"