Disable ligatures in |--| (closes #713)

This commit is contained in:
Nikita Prokopov 2019-09-02 16:47:00 +03:00
parent 375a449b4c
commit 707ba48fc3
3 changed files with 23 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -92,6 +92,13 @@
(str " ignore sub less' less less asterisk;\n"
" ignore sub less' less less plus;\n"
" ignore sub less' less less dollar;\n")
;; 713 |-|
["bar" "hyphen"]
" ignore sub bar' hyphen bar;\n"
["hyphen" "bar"]
" ignore sub bar hyphen' bar;\n"
})
(def skip-ignores? #{
@ -160,6 +167,12 @@
(str "### start of generated calt\n" calt "\n### end of generated calt\n"))]
(assoc-in font [:features idx :code] code')))
(defn compare-ligas [l1 l2]
(cond
(> (count l1) (count l2)) -1
(< (count l1) (count l2)) 1
:else (compare l1 l2)))
(defn -main [& args]
(let [file (or (first args) "FiraCode.glyphs")
_ (println "Parsing" file "...")
@ -169,7 +182,7 @@
:when (str/ends-with? name ".liga")
:let [[_ liga] (re-matches #"([a-z_]+)\.liga" name)]]
(str/split liga #"_")) ;; [ ["dash" "greater" "greater"] ... ]
calt (->> ligas (remove manual?) (sort-by count) (reverse) (map liga->rule) (str/join "\n\n"))
calt (->> ligas (remove manual?) (sort compare-ligas) (map liga->rule) (str/join "\n\n"))
font' (replace-calt font calt)]
(println "Saving" file "...")
@ -183,4 +196,5 @@
(str/join ", ")))
(println)))
;; (-main)
(-main)

View File

@ -1,4 +1,4 @@
{:paths ["clojure"]
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.flatland/ordered {:mvn/version "1.5.6"}
fipp/fipp {:mvn/version "0.6.12"}}}
org.flatland/ordered {:mvn/version "1.5.7"}
fipp/fipp {:mvn/version "0.6.18"}}}