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