GUI icons

master
Matthew Butterick 4 years ago
parent 1ef848c4ca
commit cc996b14fd

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

@ -2,6 +2,7 @@
(define post-install-collection "index.rkt")
(define raco-commands '(("words" (submod words/command raco) "issue words command" #f)))
(define compile-omit-paths '("make-icons.rkt"))
(define gracket-launcher-names '("Words"))
(define gracket-launcher-libraries '("app.rkt"))

@ -0,0 +1,21 @@
#lang br
(require pict pict/convert racket/draw icns file/ico)
(define (make-icon-pict size)
(unsafe-dc (λ (dc dx dy)
(send dc set-text-foreground "slategray")
(send dc set-text-background "darkslategray")
(send dc set-font (make-font #:size size
#:face "Equity Text A"))
(send dc draw-text "W" (/ size 40) (- (/ size 10))))
size size))
(send (pict->bitmap (make-icon-pict 96)) save-file "app.png" 'png)
(with-output-to-file "app.icns"
(λ () (void (write-bytes (pict->icns-bytes (make-icon-pict 1024)))))
#:exists 'replace)
(write-icos (for/list ([size '(16 32 48 256)])
(argb->ico size size (pict->argb-pixels (make-icon-pict size)))) "app.ico"
#:exists 'replace)
Loading…
Cancel
Save