From: Marc Foley Date: Fri, 18 Jul 2025 10:07:55 +0000 (+0100) Subject: closer to working vf tags in batch X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d643125e40843e660bea56cd3d100110267bd239;p=thirdparty%2Fgoogle%2Ffonts.git closer to working vf tags in batch --- diff --git a/tagger2/index.html b/tagger2/index.html index 5c278011f..ad1413710 100644 --- a/tagger2/index.html +++ b/tagger2/index.html @@ -102,9 +102,8 @@ } 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); } diff --git a/tagger2/models.js b/tagger2/models.js index 9e41fdaec..a50e9e8bc 100644 --- a/tagger2/models.js +++ b/tagger2/models.js @@ -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 } }