diff --git a/numbers/index.js b/numbers/index.js index cae553d..b31bb48 100644 --- a/numbers/index.js +++ b/numbers/index.js @@ -22,7 +22,7 @@ version="1.1">`; let options = { font : 'ems_nixish', scale : 0.005, - weight : 5 + weight : 1 }; async function loadFont (fontPath) { @@ -41,12 +41,12 @@ async function loadFont (fontPath) { } function textPos (str) { + const UNIT = 21000 / W; const len = str.length; const w = len * charW; const h = charH; - const x = (W - w) / 2.0; - const y = 1; - //console.log(w); + const x = ((W - w) / 2.0) * UNIT; + const y = 1 * UNIT; return { x, y }; }