Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Features/GTK3/Porting
(view source)
Revision as of 13:51, 11 November 2011
80 bytes added
,
13:51, 11 November 2011
→Going from Cairo in GTK-2 to Cairo in GTK-3
Line 278:
Line 278:
The Cairo/Pango interaction is a little different:
The Cairo/Pango interaction is a little different:
<pre>
<pre>
+
from gi.repository import Pango, PangoCairo
+
cairo_context = ...
cairo_context = ...
pango_layout = PangoCairo.create_layout(cairo_context)
pango_layout = PangoCairo.create_layout(cairo_context)
+
fd = Pango.FontDescription('Sans')
pango_layout.set_font_description(fd)
pango_layout.set_font_description(fd)
pango_layout.set_text('Hello World', -1)
pango_layout.set_text('Hello World', -1)
Walter
Bureaucrats
,
Administrators
10,579
edits