1
0
Fork 0
mirror of synced 2024-05-20 04:23:44 +12:00
FiraCode/clojure/fira_code/checks.clj

27 lines
602 B
Clojure
Raw Normal View History

(ns fira-code.checks
(:require
[clojure.string :as str]
[fira-code.coll :as coll]
[fira-code.glyphs :as glyphs]))
(defn width-ok? [w]
(#{"0" 0 1200} w))
(defn widths [font]
(doseq [g (:glyphs font)
:when (not= "0" (:export g))
l (:layers g)
:let [w (:width l)]
:when (not (width-ok? w))]
(println (str "WARN glyph '" (:glyphname g) "' layer '" (:id (glyphs/layer l)) "' has width=" (pr-str w))))
font)
(defn -main [& args]
(let [path (or (first args) "FiraCode.glyphs")
font (glyphs/load path)]
(widths font)))