/extra/fonts/syntax/syntax.factor

http://github.com/abeaumont/factor · Factor · 16 lines · 12 code · 4 blank · 0 comment · 3 complexity · 7d30a059fc1e1bd2615e890c104b876f MD5 · raw file

  1. USING: accessors arrays variants combinators io.styles
  2. kernel math parser sequences fry ;
  3. IN: fonts.syntax
  4. VARIANT: fontname serif monospace ;
  5. : install ( object quot -- quot/? ) over [ curry ] [ 2drop [ ] ] if ;
  6. : >>name* ( object fontname -- object ) name>> >>name ;
  7. SYNTAX: FONT: \ ; parse-until {
  8. [ [ number? ] find nip [ >>size ] install ]
  9. [ [ italic = ] find nip [ >>italic? ] install ]
  10. [ [ bold = ] find nip [ >>bold? ] install ]
  11. [ [ fontname? ] find nip [ >>name* ] install ]
  12. } cleave 4array concat '[ dup font>> @ drop ] append! ;