On this page:
animate
animate-fonts
slider-application

7 Graphical interfaces

 (require sfont/windows) package: sfont

procedure

(animate font-proc    
  width    
  height    
  [start    
  end    
  inc-proc])  font?
  font-proc : (-> real? font?)
  width : natural-number/c
  height : natural-number/c
  start : real? = 0
  end : real? = 100
  inc-proc : (-> real? real?) = (curry + 10)
Creates an animation window, the font-proc procedure takes a number produced by the inc-proc procedure and produces a font; inc-proc updates the ’counter’ value (starting from start) and end when the end value is reached, returning the last font produced by font-proc.

syntax

(animate-fonts f ...)

Given some interpolabel fonts produces a new animation that interpolates between the fonts.

syntax

(slider-application
 [font-proc final-proc]
 [(slider-name slider-min slider-max init-value) ...]
 [txt size])
Produces a ’thunk’ that, when called, creates a new application with sliders that control the font procedure. The number of arguments that font-proc accepts is equal to the number of sliders, with the same order. The text form specifies a string to initialize the text field, and a size. The final-proc is a procedure that will be called before saving the font.

An example that uses the font sq in the sfont-examples directory.

(define (sq-proc weight width)
  (sq #:weight (/ weight 1000) #:width (/ width 1000)))
 
(define main
  (slider-application
   [sq-proc identity]
   [(weight 0 1000 500)
    (width 0 1000 500)]
   ["ciao ciao" 100]))
 
(main)