classes.clj 488 B

123456789101112131415161718
  1. (ns fira-code.classes
  2. (:require
  3. [clojure.java.io :as io]
  4. [clojure.string :as str]
  5. [fira-code.glyphs :as glyphs]
  6. [fira-code.files :as files]))
  7. (defn fill-class [font file]
  8. (let [[_ name] (re-matches #"([^.]+)\.fea" (.getName file))
  9. code (slurp file)
  10. class {:code (str/trim code)
  11. :name name}]
  12. (glyphs/set-class font name class)))
  13. (defn fill-all [font]
  14. (reduce fill-class font (files/find "classes" #"classes/[^/]+\.fea")))