1 ! Copyright (C) 2008 Matthew Willis.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: pango.cairo pango.gadgets
4 cairo.gadgets arrays namespaces
5 fry accessors ui.gadgets
6 sequences opengl.gadgets
9 IN: pango.cairo.gadgets
11 TUPLE: pango-cairo-gadget < pango-gadget ;
13 SINGLETON: pango-cairo-backend
14 pango-cairo-backend pango-backend set-global
16 M: pango-cairo-backend construct-pango
17 pango-cairo-gadget construct-gadget ;
19 : setup-layout ( gadget -- quot )
20 [ font>> ] [ text>> ] bi
21 '[ , layout-font , layout-text ] ; inline
23 M: pango-cairo-gadget render* ( gadget -- )
24 setup-layout [ layout-size dup ]
26 '[ [ @ show-layout ] with-pango-cairo ]
27 ] bi render-cairo render-bytes* ;