From ac1ba1941a386e73389fb573c39949a818439c71 Mon Sep 17 00:00:00 2001 From: Josh birnholz Date: Sun, 22 Oct 2023 01:49:26 -0400 Subject: [PATCH] Fix kerning support --- js/creator-23.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/creator-23.js b/js/creator-23.js index 4520a3cb..d85a6749 100644 --- a/js/creator-23.js +++ b/js/creator-23.js @@ -143,7 +143,7 @@ async function setBottomInfoStyle() { if (document.querySelector('#enableNewCollectorStyle').checked) { await loadBottomInfo({ midLeft: {text:'{elemidinfo-set} \u2022 {elemidinfo-language} {savex}{fontbelerenbsc}{fontsize' + scaleHeight(0.001) + '}{upinline' + scaleHeight(0.0005) + '}\uFFEE{savex2}{elemidinfo-artist}', x:0.0647, y:0.9548, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, - topLeft: {text:'{elemidinfo-rarity} {elemidinfo-number}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, + topLeft: {text:'{elemidinfo-rarity} {kerning3}{elemidinfo-number}{kerning0}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, note: {text:'{loadx}{elemidinfo-note}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, bottomLeft: {text:'NOT FOR SALE', x:0.0647, y:0.9719, width:0.8707, height:0.0143, oneLine:true, font:'gothammedium', size:0.0143, color:'white', outlineWidth:0.003}, wizards: {name:'wizards', text:'{ptshift0,0.0172}\u2122 & \u00a9 {elemidinfo-year} Wizards of the Coast', x:0.0647, y:0.9377, width:0.8707, height:0.0167, oneLine:true, font:'mplantin', size:0.0162, color:'white', align:'right', outlineWidth:0.003}, @@ -3488,7 +3488,7 @@ function writeText(textObject, targetContext) { //Finish prepping canvases paragraphContext.clearRect(0, 0, paragraphCanvas.width, paragraphCanvas.height); lineContext.clearRect(0, 0, lineCanvas.width, lineCanvas.height); - lineCanvas.style.letterSpacing = (scaleWidth(textObject.kerning) || 0) + 'px'; + lineContext.letterSpacing = (scaleWidth(textObject.kerning) || 0) + 'px'; // if (textFont == 'goudymedieval') { // lineCanvas.style.letterSpacing = '3.5px'; // } @@ -3706,7 +3706,7 @@ function writeText(textObject, targetContext) { } else if (possibleCode.includes('fixtextalign')) { textAlign = realTextAlign; } else if (possibleCode.includes('kerning')) { - lineCanvas.style.letterSpacing = possibleCode.replace('kerning', '') + 'px'; + lineContext.letterSpacing = possibleCode.replace('kerning', '') + 'px'; lineContext.font = lineContext.font; //necessary for the letterspacing update to be recognized } else if (getManaSymbol(possibleCode.replaceAll('/', '')) != undefined || getManaSymbol(possibleCode.replaceAll('/', '').split('').reverse().join('')) != undefined) { possibleCode = possibleCode.replaceAll('/', '')