Skip to content

Commit

Permalink
(hopefully) fixed monospaced #1325
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Dec 6, 2021
1 parent 16b04e0 commit 6e5ddfe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
20 changes: 11 additions & 9 deletions FiraCode.glyphs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
.appVersion = "3091";
DisplayStrings = (
".-\012.=\012:-\012:="
"/fraction",
"/uniE000/uniE001/uniE002/uniE003",
"/null"
);
classes = (
{
Expand Down Expand Up @@ -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";
Expand All @@ -62063,7 +62065,7 @@ nodes = (
);
}
);
width = 0;
width = 1200;
},
{
layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69";
Expand Down Expand Up @@ -125172,7 +125174,7 @@ nodes = (
);
}
);
width = 0;
width = 1200;
},
{
layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -125900,7 +125902,7 @@ nodes = (
);
}
);
width = 0;
width = 1200;
},
{
layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -126355,7 +126357,7 @@ nodes = (
);
}
);
width = 0;
width = 1200;
},
{
layerId = "B67F0F2D-EC95-4CB8-966E-23AE86958A69";
Expand Down Expand Up @@ -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";
Expand Down
15 changes: 6 additions & 9 deletions clojure/fira_code/checks.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

0 comments on commit 6e5ddfe

Please sign in to comment.