Nikita Prokopov 3 лет назад
Родитель
Сommit
6e5ddfe4fc
2 измененных файлов с 17 добавлено и 18 удалено
  1. 11 9
      FiraCode.glyphs
  2. 6 9
      clojure/fira_code/checks.clj

+ 11 - 9
FiraCode.glyphs

@@ -1,7 +1,9 @@
 {
 .appVersion = "3091";
 DisplayStrings = (
-".-\012.=\012:-\012:="
+"/fraction",
+"/uniE000/uniE001/uniE002/uniE003",
+"/null"
 );
 classes = (
 {
@@ -62048,7 +62050,7 @@ unicode = 2079;
 {
 color = 3;
 glyphname = fraction;
-lastChange = "2021-08-08 18:27:52 +0000";
+lastChange = "2021-12-06 20:35:57 +0000";
 layers = (
 {
 layerId = "4B7A3BAF-EAD8-4024-9BEA-BB1DE86CFCFA";
@@ -62063,7 +62065,7 @@ nodes = (
 );
 }
 );
-width = 0;
+width = 1200;
 },
 {
 layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69";
@@ -125172,7 +125174,7 @@ nodes = (
 );
 }
 );
-width = 0;
+width = 1200;
 },
 {
 layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69";
@@ -125597,7 +125599,7 @@ unicode = E000;
 },
 {
 glyphname = uniE001;
-lastChange = "2021-08-08 18:27:53 +0000";
+lastChange = "2021-12-06 20:36:30 +0000";
 layers = (
 {
 layerId = "4B7A3BAF-EAD8-4024-9BEA-BB1DE86CFCFA";
@@ -125900,7 +125902,7 @@ nodes = (
 );
 }
 );
-width = 0;
+width = 1200;
 },
 {
 layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69";
@@ -126210,7 +126212,7 @@ unicode = E001;
 },
 {
 glyphname = uniE002;
-lastChange = "2021-08-08 18:27:53 +0000";
+lastChange = "2021-12-06 20:36:30 +0000";
 layers = (
 {
 layerId = "4B7A3BAF-EAD8-4024-9BEA-BB1DE86CFCFA";
@@ -126355,7 +126357,7 @@ nodes = (
 );
 }
 );
-width = 0;
+width = 1200;
 },
 {
 layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69";
@@ -128831,7 +128833,7 @@ lastChange = "2021-08-08 18:27:53 +0000";
 layers = (
 {
 layerId = "4B7A3BAF-EAD8-4024-9BEA-BB1DE86CFCFA";
-width = 0;
+width = 1200;
 },
 {
 layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69";

+ 6 - 9
clojure/fira_code/checks.clj

@@ -4,23 +4,20 @@
    [fira-code.coll :as coll]
    [fira-code.glyphs :as glyphs]))
 
-
 (defn width-ok? [w]
   (#{"0" 0 1200} 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))))
+          :let  [[w & _ :as ws] (mapv :width (:layers g))]]
+    (when-not (apply = ws) 
+      (println (str "WARN glyph '" (:glyphname g) "' has different widths=" (pr-str ws))))
+    (when-not (width-ok? w)
+      (println (str "WARN glyph '" (:glyphname g) "' has unexpected width=" (pr-str w)))))
   font)
 
-
 (defn -main [& args]
   (let [path (or (first args) "FiraCode.glyphs")
         font (glyphs/load path)]
-    (widths font)))
-
+    (widths font)))