diff --git a/example.py b/example.py index 46c8fe4..f053834 100755 --- a/example.py +++ b/example.py @@ -15,13 +15,13 @@ class MyWidget(gtk.DrawingArea): def expose(self, widget, event): cr = widget.window.cairo_create() - cr.select_font_face("Courier", - cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL) - cr.set_font_size(20) - cr.set_source_rgb(1.0, 0.3, 0.0) - cr.move_to(0, 15) - cr.text_path("Hello") - cr.stroke() + layout = cr.create_layout() + layout.set_text("Hello") + desc = pango.FontDescription("Mono Bold 27") + layout.set_font_description(desc) + cr.move_to(10, 150) + cr.update_layout(layout) + cr.show_layout(layout) def destroy(window): gtk.main_quit()