all-fonts-bc.lisp (1592 bytes)
1 (defpackage :all-fonts 2 (:use :cl) 3 (:import-from :alexandria :map-combinations) 4 (:import-from :uiop :run-program)) 5 (in-package :all-fonts) 6 7 (defparameter *groups* 8 '(curve round backslash diamond dot forwardslash noslab1 flattop3 widerknife slabi slabl traditional loop nogap) 9 "Things you actually want to permute together.") 10 11 (defparameter *exclusions* 12 '((curve round) 13 (backslash diamond dot forwardslash)) 14 "Things which you don't want specified at the same time.") 15 16 (defun verify (spec) 17 "Ensure that the spec is not bogus." 18 (let ((group (not (set-difference spec *groups*))) 19 (exclusion (not (some #'identity 20 (mapcar #'(lambda (ex) 21 (<= 2 (length (intersection spec ex)))) 22 *exclusions*))))) 23 (values (and group exclusion) 24 (if group (if exclusion 'group-and-exclusion 'group) 25 (if exclusion 'exclusion 'unknown))))) 26 (defun gen-all-fonts () 27 (loop for x from 1 to (length *groups*) 28 do (map-combinations 29 (lambda (f) 30 (when (verify f) 31 (run-program (format nil "./generator-bc.ros --ttf --woff --woff2 ~(~{ ~A~}~)" f) :output t) 32 ;; KLUDGE: Weird bug where everything ends up in the ttf folder 33 (run-program (format nil "tar -vcf - Hack/build/ttf/* | xz -12 >'~(~{~A~}~).tar.xz'" f) :output t) 34 (run-program "rm -Rf Hack/build") 35 (run-program "mkdir Hack/build"))) 36 *groups* 37 :length x)))