Enhance conciseness

pull/1518/head
Kenneth, Cho Kai Hung 2023-04-02 14:41:23 +01:00 zatwierdzone przez GitHub
rodzic c94f7aeb70
commit 8488f41f0b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 9 dodań i 14 usunięć

Wyświetl plik

@ -2,22 +2,17 @@
(:require (:require
[clojure.string :as str] [clojure.string :as str]
[fira-code.glyphs :as glyphs] [fira-code.glyphs :as glyphs]
[fira-code.time :as time] [fira-code.time :as time]))
[flatland.ordered.map :refer [ordered-map]]))
(defn spacer [name] (defn spacer [name]
(ordered-map {:color 3
:color 3, :glyphname name
:glyphname name, :lastChange (time/now-str)
:lastChange (time/now-str), :layers [{:layerId (:Light glyphs/weights) :width 1200}
:layers {:layerId (:Bold glyphs/weights) :width 1200}]})
[(ordered-map :layerId (:Light glyphs/weights), :width 1200)
(ordered-map :layerId (:Bold glyphs/weights), :width 1200)]))
(defn add-spacers [font ligature-names]
(defn add-spacers [font ligas] (let [needed (->> (into #{} cat ligature-names)
(let [needed (->> (into #{} cat ligas)
(map #(str % ".spacer"))) (map #(str % ".spacer")))
existing (->> (:glyphs font) existing (->> (:glyphs font)
(map :glyphname) (map :glyphname)
@ -28,4 +23,4 @@
(do (do
(println " added glyphs: " (str/join " " new)) (println " added glyphs: " (str/join " " new))
(update font :glyphs #(into % (map spacer new)))) (update font :glyphs #(into % (map spacer new))))
font))) font)))