From 224bed982536180acd9a5f1424887a4001140ea9 Mon Sep 17 00:00:00 2001 From: lorp Date: Thu, 1 Feb 2024 23:38:15 +0000 Subject: [PATCH] Prettify --- src/fencer.html | 17 +++++++++++++++-- src/fencer.js | 17 ++++++----------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/fencer.html b/src/fencer.html index 8d16ed0..53f1693 100644 --- a/src/fencer.html +++ b/src/fencer.html @@ -1,13 +1,21 @@ + Home + - + - + + + +
FENCER 🤺 avar2 mappings creator
+

Fontinfo

diff --git a/src/fencer.js b/src/fencer.js index 145fc35..d21ea56 100644 --- a/src/fencer.js +++ b/src/fencer.js @@ -1,11 +1,6 @@ "use strict" -// import the samsa-core module -//import { SamsaFont, SamsaInstance, SamsaBuffer, SAMSAGLOBAL } from "https://lorp.github.io/samsa-core/src/samsa-core.js"; -//import { * } from "./models.js"; - -//export {SamsaFont, SamsaGlyph, SamsaInstance, SamsaBuffer, SAMSAGLOBAL} from "https://lorp.github.io/samsa-core/src/samsa-core.js"; - +// import samsa-core and fontTools.varLib models import { SamsaFont, SamsaInstance, SamsaBuffer, SAMSAGLOBAL } from "https://lorp.github.io/samsa-core/src/samsa-core.js"; import { normalizeValue, piecewiseLinearMap } from "./models.js"; @@ -21,8 +16,7 @@ function onDropFont (e) { e.preventDefault(); // open font as SamsaFont - - + // - not yet // get arrayBuffer from dropped object @@ -48,12 +42,13 @@ function onDropFont (e) { // set the font face to the arraybuffer const fontFace = new FontFace(font.names[6], arrayBuffer); fontFace.load().then(loadedFace => { + const renderEl = document.querySelector(".render-native"); document.fonts.add(loadedFace); - document.querySelector(".render-native").style.fontFamily = font.names[6]; - console.log("loaded font: " + font.names[6]) + renderEl.style.fontFamily = font.names[6]; + renderEl.style.color = "black"; + console.log("loaded font: " + font.names[6]); }); }); - } function initFencer() {