! TrueType font rendering demo. ! ! To run this code, bootstrap Factor like so: ! ! ./f boot.image.le32 ! -libraries:sdl:name=libSDL.so ! -libraries:sdl-gfx:name=libSDL_gfx.so ! -libraries:sdl-ttf:name=libSDL_ttf.so ! ! (But all on one line) ! ! Then, start Factor as usual (./f factor.image) and enter this ! at the listener: ! ! "examples/text-demo.factor" run-file IN: text-demo USE: streams USE: sdl USE: sdl-event USE: sdl-gfx USE: sdl-video USE: sdl-ttf USE: namespaces USE: math USE: kernel USE: test USE: compiler USE: strings USE: alien USE: prettyprint USE: lists USE: gadgets USE: generic USE: stdio USE: prettyprint USE: words : moving-actions {{ [[ [ button-down 1 ] [ 0 0 pick move-gadget my-hand add-gadget ] ]] [[ [ button-up 1 ] [ my-hand shape-x my-hand shape-y pick move-gadget world get add-gadget ] ]] }} swap set-gadget-gestures ; : dup moving-actions ; : dup moving-actions ; : dup moving-actions ; : check-box ( label -- checkbox ) 0 0 0 0 [ >r