]> git.ipfire.org Git - thirdparty/google/fonts.git/commitdiff
validate vf tag before including it
authorMarc Foley <m.foley.88@gmail.com>
Tue, 18 Feb 2025 14:46:59 +0000 (14:46 +0000)
committerMarc Foley <m.foley.88@gmail.com>
Tue, 4 Mar 2025 10:24:41 +0000 (10:24 +0000)
.ci/tags.html

index 7d9a468d6df78c215989363c3003c844a4d492e5..d3736d74f06792b50f351a99513f131031576caa 100644 (file)
@@ -386,7 +386,6 @@ function axesCombos(axes) {
         });
         this.fontUrls = dat
       },
-
       addAxis() {
         this.newAxes.push(
           {
@@ -480,6 +479,19 @@ function axesCombos(axes) {
         const fonts = document.getElementById("fonts")
         if (this.newAxes.length > 0) {
           const solved = axesCombos(this.newAxes);
+          for(let i=0; i<solved.length; i++) {
+            let vfTag = solved[i]
+            if (vfTag.score === 0) {
+              alert("Please fill in all axis scores");
+              return;
+            }
+            for (let j=0; j<vfTag.axes.length; j++) {
+              if (vfTag.axes[j].tag === "" || vfTag.axes[j].coords === "") {
+                alert("Please fill in all axis tags and coordinates");
+                return;
+              }
+            }
+          }
           solved.forEach((ax) => {
             let name = `${this.newFamily}:"${ax.axes.map((a) => a.tag).join(",")}@${ax.axes.map((a) => a.coords).join(",")}"`;
             let newFamily = new FontTag(name, this.currentCategory, ax.score)