1 USING: alien alien.c-types
3 destructors accessors namespaces
7 : pango-layout-get-pixel-size ( layout -- width height )
8 0 <int> 0 <int> [ pango_layout_get_pixel_size ] 2keep
11 TUPLE: pango-layout alien ;
12 C: <pango-layout> pango-layout
13 M: pango-layout dispose ( alien -- ) alien>> g_object_unref ;
15 : layout ( -- pango-layout ) pango-layout get ;
17 : (with-layout) ( pango-layout quot -- )
18 >r alien>> pango-layout r> with-variable ; inline
20 : with-layout ( layout quot -- )
21 >r <pango-layout> r> [ (with-layout) ] curry with-disposal ; inline
23 : layout-font ( str -- )
24 pango_font_description_from_string
25 dup zero? [ "pango: not a valid font." throw ] when
26 layout over pango_layout_set_font_description
27 pango_font_description_free ;
29 : layout-text ( str -- )
30 layout swap -1 pango_layout_set_text ;