checks.clj 607 B

1234567891011121314151617181920212223242526
  1. (ns fira-code.checks
  2. (:require
  3. [clojure.string :as str]
  4. [fira-code.coll :as coll]
  5. [fira-code.glyphs :as glyphs]))
  6. (defn width-ok? [w]
  7. (#{"0" 0 1200 2400} w))
  8. (defn widths [font]
  9. (doseq [g (:glyphs font)
  10. :when (not= "0" (:export g))
  11. l (:layers g)
  12. :let [w (:width l)]
  13. :when (not (width-ok? w))]
  14. (println (str "WARN glyph '" (:glyphname g) "' layer '" (:id (glyphs/layer l)) "' has width=" (pr-str w))))
  15. font)
  16. (defn -main [& args]
  17. (let [path (or (first args) "FiraCode.glyphs")
  18. font (glyphs/load path)]
  19. (widths font)))