File: main.clj

package info (click to toggle)
fonts-firacode 6.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,796 kB
  • sloc: sh: 287; python: 146; makefile: 19
file content (33 lines) | stat: -rw-r--r-- 1,176 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(ns fira-code.main
  (:require
   [clojure.string :as str]
   [fira-code.calt :as calt]
   [fira-code.coll :as coll]
   [fira-code.checks :as checks]
   [fira-code.classes :as classes]
   [fira-code.features :as features]
   [fira-code.glyphs :as glyphs]
   [fira-code.not-space :as not-space]
   [fira-code.spacers :as spacers]
   [fira-code.time :as time]
   [flatland.ordered.map :refer [ordered-map]]))


(defn -main [& args]
  (let [path   (or (first args) "FiraCode.glyphs")
        font   (glyphs/load path)
        ligas  (for [g (:glyphs font)
                     :let [name (:glyphname g)]
                     :when (str/ends-with? name ".liga")
                     :when (not= "0" (:export g))
                     :let [[_ liga] (re-matches #"([A-Za-z_]+)\.liga" name)]]
                 (str/split liga #"_")) ;; [ ["dash" "greater" "greater"] ... ]
        font'  (-> font
                 (calt/replace-calt ligas)
                 (classes/fill-all)
                 (features/fill-all)
                 (spacers/add-spacers ligas)
                 (not-space/regen-not-space)
                 (checks/widths))]
    (glyphs/save! path font')
    (println)))