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