]> git.ipfire.org Git - thirdparty/google/fonts.git/commitdiff
closer to working vf tags in batch
authorMarc Foley <m.foley.88@gmail.com>
Fri, 18 Jul 2025 10:07:55 +0000 (11:07 +0100)
committerMarc Foley <m.foley.88@gmail.com>
Fri, 18 Jul 2025 12:46:42 +0000 (13:46 +0100)
tagger2/index.html
tagger2/models.js

index 5c278011f256925a8c18344877b2d5f532050be0..ad1413710d7d99d20ce7383535d4f98f8c14e8a4 100644 (file)
             }
             if (addFamily) {
               for (let category of filterSet.categories) {
-                const lowTag = new FontTag(category, family, filterSet.lowTag.filters, filterSet.lowTag.score);
-                const highTag = new FontTag(category, family, filterSet.highTag.filters, filterSet.highTag.score);
-                console.log(lowTag, highTag, "tt");
+                const lowTag = new FontTag(category, family, [{tag: "wght", value: 100}], filterSet.lowTag.score);
+                const highTag = new FontTag(category, family, [{tag: "wght", value: 900}], filterSet.highTag.score);
                 this.tags.items.push(lowTag);
                 this.tags.items.push(highTag);
               }
index 9e41fdaec04e588ebb9406265d8f14fc2cd7ee84..a50e9e8bcdab320c8c82bf7247443d58f07fc376 100644 (file)
@@ -35,17 +35,11 @@ export class FontTag {
       if (this.axes.length === 0) {
         return `font-family: ${this.family.name}; font-size: 32pt;`;
       }
-      // TODO after lunch
-      let cleaned = this.family.name.replaceAll('"', '')
-      let [name, axes] = cleaned.split(":");
-      let [axisTag, axisCoords] = this.family.axes.split("@");
-      let axisTags = axisTag.split(",");
-      let axisCoordinates = axisCoords.split(",");
-      let style = `font-family: "${name}", "Adobe NotDef"; font-size: 32pt; font-variation-settings:`;
-      for (let i = 0; i < axisTags.length; i++) {
-        style += ` '${axisTags[i]}' ${axisCoordinates[i]};`;
+      let style = `font-family: "${this.family.name}", "Adobe NotDef"; font-size: 32pt; font-variation-settings:`;
+      for (let axis of this.axes) {
+        style += ` '${axis.tag}' ${axis.value},`;
       }
-      return style
+      return style.slice(0, -1) + ';'; // Remove trailing comma and add semicolon
     }
 
 }