1 ! Copyright (C) 2008 Matthew Willis.
2 ! Copyright (C) 2009 Slava Pestov.
3 ! See http://factorcode.org/license.txt for BSD license
4 USING: arrays system alien.destructors alien.c-types alien.syntax alien
5 combinators math.rectangles kernel math alien.libraries classes.struct
9 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10 ! Helpful functions from other parts of pango
11 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14 { [ os winnt? ] [ "pango" "libpango-1.0-0.dll" "cdecl" add-library ] }
15 { [ os macosx? ] [ "pango" "/opt/local/lib/libpango-1.0.0.dylib" "cdecl" add-library ] }
21 CONSTANT: PANGO_SCALE 1024
23 : pango>float ( n -- x ) PANGO_SCALE /f ; inline
24 : float>pango ( x -- n ) PANGO_SCALE * >integer ; inline
26 TYPEDEF: void* PangoContext*
28 FUNCTION: PangoContext* pango_context_new ( ) ;
30 STRUCT: PangoRectangle
36 : PangoRectangle>rect ( PangoRectangle -- rect )
37 [ [ x>> pango>float ] [ y>> pango>float ] bi 2array ]
38 [ [ width>> pango>float ] [ height>> pango>float ] bi 2array ] bi