diff --git a/CHANGELOG.md b/CHANGELOG.md index 50b9a3f..f8595e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +#### 3.1 (April 15, 2020) + +- Fixed width of Germandbls, cornerbracketleft, cornerbracketleft, negativeAcknowledge-control, cornerbracketleft.half, cornerbracketright.half [#1000] + #### 3.0 (April 9, 2020) - Disabled ligatures in progress bars `[-> [--> [---> [=> [==> [===>` [#968] diff --git a/FiraCode.glyphs b/FiraCode.glyphs index 95bb422..43f325c 100644 --- a/FiraCode.glyphs +++ b/FiraCode.glyphs @@ -129,7 +129,7 @@ value = ( ); } ); -date = "2020-04-09 13:10:08 +0000"; +date = "2020-04-15 16:43:56 +0000"; designer = "Carrois Corporate, Edenspiekermann AG, Nikita Prokopov"; designerURL = "https://tonsky.me"; familyName = "Fira Code"; @@ -5220,7 +5220,7 @@ unicode = 0218; { color = 3; glyphname = Germandbls; -lastChange = "2020-04-05 21:57:02 +0000"; +lastChange = "2020-04-15 15:10:21 +0000"; layers = ( { layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69"; @@ -5269,7 +5269,7 @@ nodes = ( ); } ); -width = 1198; +width = 1200; }, { layerId = "4B7A3BAF-EAD8-4024-9BEA-BB1DE86CFCFA"; @@ -60670,7 +60670,7 @@ unicode = 005D; { color = 6; glyphname = cornerbracketleft; -lastChange = "2020-04-08 18:25:56 +0000"; +lastChange = "2020-04-15 15:13:23 +0000"; layers = ( { layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69"; @@ -60687,7 +60687,7 @@ nodes = ( ); } ); -width = 1100; +width = 1200; }, { layerId = "4B7A3BAF-EAD8-4024-9BEA-BB1DE86CFCFA"; @@ -60704,7 +60704,7 @@ nodes = ( ); } ); -width = 1100; +width = 1200; } ); unicode = 300C; @@ -60976,27 +60976,25 @@ width = 1200; { color = 6; glyphname = cornerbracketleft.half; -lastChange = "2020-04-08 18:26:42 +0000"; +lastChange = "2020-04-15 16:42:32 +0000"; layers = ( { components = ( { name = cornerbracketleft; -transform = "{1, 0, 0, 1, -500, 0}"; } ); layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69"; -width = 600; +width = 1200; }, { components = ( { name = cornerbracketleft; -transform = "{1, 0, 0, 1, -500, 0}"; } ); layerId = "4B7A3BAF-EAD8-4024-9BEA-BB1DE86CFCFA"; -width = 600; +width = 1200; } ); unicode = FF62; @@ -61004,27 +61002,25 @@ unicode = FF62; { color = 6; glyphname = cornerbracketright.half; -lastChange = "2020-04-08 18:26:35 +0000"; +lastChange = "2020-04-15 16:42:52 +0000"; layers = ( { components = ( { name = cornerbracketright; -transform = "{1, 0, 0, 1, -100, 0}"; } ); layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69"; -width = 600; +width = 1200; }, { components = ( { name = cornerbracketright; -transform = "{1, 0, 0, 1, -100, 0}"; } ); layerId = "4B7A3BAF-EAD8-4024-9BEA-BB1DE86CFCFA"; -width = 600; +width = 1200; } ); unicode = FF63; @@ -100960,7 +100956,7 @@ unicode = 240A; { color = 3; glyphname = "negativeAcknowledge-control"; -lastChange = "2020-04-05 21:57:02 +0000"; +lastChange = "2020-04-15 15:13:59 +0000"; layers = ( { components = ( @@ -100981,7 +100977,7 @@ transform = "{0.33, 0, 0, 0.33, 800, 458}"; } ); layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69"; -width = 1188; +width = 1200; }, { components = ( @@ -118541,6 +118537,6 @@ oV = 98; }; }; }; -versionMajor = 3; +versionMajor = 4; versionMinor = 0; } diff --git a/clojure/fira_code/checks.clj b/clojure/fira_code/checks.clj new file mode 100644 index 0000000..001b9d9 --- /dev/null +++ b/clojure/fira_code/checks.clj @@ -0,0 +1,26 @@ +(ns fira-code.checks + (:require + [clojure.string :as str] + [fira-code.coll :as coll] + [fira-code.glyphs :as glyphs])) + + +(defn width-ok? [w] + (#{"0" 0 1200 2400} w)) + + +(defn widths [font] + (doseq [g (:glyphs font) + :when (not= "0" (:export g)) + l (:layers g) + :let [w (:width l)] + :when (not (width-ok? w))] + (println (str "WARN glyph '" (:glyphname g) "' layer '" (:id (glyphs/layer l)) "' has width=" (pr-str w)))) + font) + + +(defn -main [& args] + (let [path (or (first args) "FiraCode.glyphs") + font (glyphs/load path)] + (widths font))) + diff --git a/clojure/fira_code/glyphs.clj b/clojure/fira_code/glyphs.clj index 27ec8fb..fbfa90d 100755 --- a/clojure/fira_code/glyphs.clj +++ b/clojure/fira_code/glyphs.clj @@ -162,10 +162,12 @@ :Regular "UUID0" :Bold "4B7A3BAF-EAD8-4024-9BEA-BB1DE86CFCFA"}) + (defn layer [l] - { :id (case (:layerId l) - ((:Regular weights)) "Regular" - ((:Bold weights)) "Bold" + { :id (condp = (:layerId l) + (:Light weights) "Light" + (:Regular weights) "Regular" + (:Bold weights) "Bold" (:layerId l)) :width (:width l) }) diff --git a/clojure/fira_code/main.clj b/clojure/fira_code/main.clj index c077053..978d232 100644 --- a/clojure/fira_code/main.clj +++ b/clojure/fira_code/main.clj @@ -3,6 +3,7 @@ [clojure.string :as str] [fira-code.calt :as calt] [fira-code.coll :as coll] + [fira-code.checks :as checks] [fira-code.glyphs :as glyphs] [fira-code.not-space :as not-space] [fira-code.spacers :as spacers] @@ -22,6 +23,7 @@ font' (-> font (calt/replace-calt ligas) (spacers/add-spacers ligas) - (not-space/regen-not-space))] + (not-space/regen-not-space) + (checks/widths))] (glyphs/save! path font') (println))) \ No newline at end of file diff --git a/script/check_widths b/script/check_widths new file mode 100755 index 0000000..9253fe9 --- /dev/null +++ b/script/check_widths @@ -0,0 +1,3 @@ +#!/bin/zsh -euo pipefail + +clojure -m fira-code.checks \ No newline at end of file