1 ! Copyright (C) 2008 Matthew Willis.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: cairo.pango cairo cairo.ffi cairo.gadgets
4 alien.c-types kernel math ;
5 IN: cairo.pango.gadgets
7 : (pango-gadget) ( setup show -- gadget )
9 [ compose [ with-pango ] curry <cairo-gadget> ] 2bi ;
11 : <pango-gadget> ( quot -- gadget )
12 [ cr layout pango_cairo_show_layout ] (pango-gadget) ;
14 USING: prettyprint sequences ui.gadgets.panes
15 threads io.backend io.encodings.utf8 io.files ;
18 "Sans " swap unparse append
20 cr 0 1 0.2 0.6 cairo_set_source_rgba
21 layout-font "今日は、 Pango!" layout-text
23 <pango-gadget> gadget. yield
26 "resource:extra/cairo/pango/gadgets/gadgets.factor"
27 normalize-path utf8 file-contents layout-text
28 ] <pango-gadget> gadget. ;