}
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);
}
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
}
}