From 24daff0fcae362916e507361e93bcc504cc45765 Mon Sep 17 00:00:00 2001 From: Nikita Prokopov Date: Fri, 28 Sep 2018 01:00:23 +0300 Subject: [PATCH] Fixed width of `[` `**` (closes #607) --- .gitignore | 3 ++- CHANGELOG.md | 1 + FiraCode.glyphs | 25 ++++++++++++++----------- clojure/parse_glyphs.clj | 32 ++++++++++++++++++++++++++++++-- 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 07e1489..3cc058f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ FiraCode_liga.glyphs FiraCode_mess.glyphs target -clojure/FiraCode.edn \ No newline at end of file +clojure/*.edn +FiraCode\ (Autosaved).glyphs \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b997c9..b1b50f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. #### WIP - Added `<==>` ([#392]) +- Fixed width of `[` `**` ([#607]) #### 1.205 (February 27, 2018) diff --git a/FiraCode.glyphs b/FiraCode.glyphs index 92ec846..ef44992 100644 --- a/FiraCode.glyphs +++ b/FiraCode.glyphs @@ -1,5 +1,8 @@ { .appVersion = "939"; +DisplayStrings = ( +/asterisk_asterisk.liga +); classes = ( { automatic = 1; @@ -62903,9 +62906,9 @@ width = 600; unicode = 037A; }, { -color = 6; +color = 4; glyphname = zero; -lastChange = "2018-02-27 09:51:08 +0000"; +lastChange = "2018-09-27 17:28:30 +0000"; layers = ( { background = { @@ -64101,9 +64104,9 @@ width = 600; unicode = 0039; }, { -color = 6; +color = 4; glyphname = zero.tosf; -lastChange = "2018-02-27 09:51:13 +0000"; +lastChange = "2018-09-27 17:28:30 +0000"; layers = ( { background = { @@ -70540,9 +70543,9 @@ width = 600; unicode = 007D; }, { -color = 4; +color = 6; glyphname = bracketleft; -lastChange = "2018-02-27 11:13:44 +0000"; +lastChange = "2018-09-27 17:28:22 +0000"; layers = ( { layerId = UUID0; @@ -70561,7 +70564,7 @@ nodes = ( ); } ); -width = 610; +width = 600; }, { layerId = "BF448B58-7A35-489E-A1C9-12628F60690C"; @@ -71584,7 +71587,7 @@ width = 600; color = 3; export = 0; glyphname = hyphen.rem; -lastChange = "2016-08-30 09:37:14 +0000"; +lastChange = "2018-09-27 17:40:22 +0000"; layers = ( { layerId = UUID0; @@ -71599,7 +71602,7 @@ nodes = ( ); } ); -width = 601; +width = 600; }, { layerId = "BF448B58-7A35-489E-A1C9-12628F60690C"; @@ -72433,7 +72436,7 @@ width = 600; { color = 3; glyphname = asterisk_asterisk.liga; -lastChange = "2018-09-17 17:26:08 +0000"; +lastChange = "2018-09-27 17:41:06 +0000"; layers = ( { components = ( @@ -72447,7 +72450,7 @@ transform = "{1, 0, 0, 1, -25, 0}"; } ); layerId = UUID0; -width = 651; +width = 600; }, { components = ( diff --git a/clojure/parse_glyphs.clj b/clojure/parse_glyphs.clj index 87bac14..0789be7 100755 --- a/clojure/parse_glyphs.clj +++ b/clojure/parse_glyphs.clj @@ -93,7 +93,35 @@ (parse-anything!))) (defn -main [& args] - (let [f (-> (slurp "FiraCode.glyphs") parse)] + (let [font (-> (slurp "FiraCode.glyphs") parse)] (with-open [os (io/writer "clojure/FiraCode.edn")] (binding [*out* os] - (fipp/pprint f {:width 200}))))) \ No newline at end of file + (fipp/pprint font {:width 200}))))) + +(def weights {:Regular "UUID0" + :Bold "BF448B58-7A35-489E-A1C9-12628F60690C"}) + +(defn layer [l] + { :id (case (:layerId l) + (:Regular weights) "Regular" + (:Bold weights) "Bold" + (:layerId l)) + :width (:width l) }) + +(defn save-not600 [] + (let [font (-> (slurp "FiraCode.glyphs") parse)] + (with-open [os (io/writer "clojure/FiraCode_not600.edn")] + (binding [*out* os] + (let [glyphs (for [glyph (:glyphs font) + :when (->> (:layers glyph) + (filter #(contains? (set (vals weights)) (:layerId %))) + (every? #(= 600 (:width %))) + (not))] + {:glyphname (:glyphname glyph) + :layers (mapv layer (:layers glyph))})] + (doseq [glyph glyphs] + (fipp/pprint glyph {:width 200})) + (count glyphs)))))) + +;; (-main) +;; (save-not600) \ No newline at end of file