From: Marc Foley Date: Wed, 16 Jul 2025 14:27:03 +0000 (+0100) Subject: add font view X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b32e52eaf800ba61b95ab24399efd22c3e49d32;p=thirdparty%2Fgoogle%2Ffonts.git add font view --- diff --git a/tagger2/Panel.js b/tagger2/Panel.js index 620ca20cb..a582884b1 100644 --- a/tagger2/Panel.js +++ b/tagger2/Panel.js @@ -10,6 +10,7 @@ export default { + ` }; diff --git a/tagger2/TagsByFont.js b/tagger2/TagsByFont.js index 179a39126..924d72bf4 100644 --- a/tagger2/TagsByFont.js +++ b/tagger2/TagsByFont.js @@ -13,7 +13,7 @@ export default { }, template: `
-

Tags for fonter

+

Tags for:

+ + +
+ Font size: + {{ fontSize }}pt +
+ Hello world +
+
+ + +
+
+
+ + ` +} \ No newline at end of file diff --git a/tagger2/index.html b/tagger2/index.html index 1871ae7ed..7b25f1829 100644 --- a/tagger2/index.html +++ b/tagger2/index.html @@ -8,13 +8,18 @@
- - + + +
- +
@@ -26,6 +31,7 @@ import TagView from "./TagView.js"; import AddTag from "./AddTag.js"; import AddCategory from "./AddCategory.js"; + import VFView from "./VFView.js"; Vue.component('tags-by-font', TagsByFont); Vue.component('tags-by-categories', TagsByCategories); @@ -33,6 +39,7 @@ Vue.component('tag-view', TagView); Vue.component('add-tag', AddTag); Vue.component('add-category', AddCategory); + Vue.component('vf-view', VFView); var app = new Vue({ el: '#app', @@ -51,6 +58,9 @@ addCategoriesPanel(categories) { this.panels.push({ type: 'categories', categories }); }, + addVFViewPanel() { + this.panels.push({ type: 'vf-view', families: this.gf.families }); + }, removePanel(idx) { this.panels.splice(idx, 1); }, diff --git a/tagger2/models.js b/tagger2/models.js index 4746e97c4..d9817d0db 100644 --- a/tagger2/models.js +++ b/tagger2/models.js @@ -53,7 +53,14 @@ export class Font { return this.axes.length > 0; } get cssStyle() { - return `font-family: '${this.name}';`; + if (!this.isVF) { + return `font-family: '${this.name}'; font-size: 32pt;`; + } + let res = `font-family: '${this.name}'; font-size: 32pt; font-variation-settings:`; + this.axes.forEach(axis => { + res += ` '${axis.tag}' ${axis.min}..${axis.max},`; + }); + return res.slice(0, -1) + ';'; // Remove trailing comma and add semicolon } get url() { let path = `https://fonts.googleapis.com/css2?family=${this.name.replaceAll(" ", "+")}`