From 090e35125b158c26b7f029e1acdc223ed332ff16 Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Sat, 15 Dec 2018 12:46:11 -0800 Subject: [PATCH] textBaselineShift --- data/borders/8th/border.js | 4 ++-- data/borders/plane/border.js | 6 +++--- data/borders/planeswalker/border.js | 8 ++++---- data/borders/planeswalkerTall/border.js | 8 ++++---- data/borders/vanguard/border.js | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/data/borders/8th/border.js b/data/borders/8th/border.js index dc0db7e9..aa2b0ef5 100644 --- a/data/borders/8th/border.js +++ b/data/borders/8th/border.js @@ -52,8 +52,8 @@ function bottomInfo8th() { card.fillStyle = document.getElementById("inputInfoColor").value canvas.style.letterSpacing = "1px" card.font = "25px matrixb" - card.fillText(document.getElementById("inputArtist").value, 116, infoY) + card.fillText(document.getElementById("inputArtist").value, 116, infoY + textBaselineShift) canvas.style.letterSpacing = "0.5px" card.font = "16px mplantin" - card.fillText("CC \u2014 " + document.getElementById("inputInfo").value + " " + document.getElementById("inputNumber").value, 62, infoY + 31) + card.fillText("CC \u2014 " + document.getElementById("inputInfo").value + " " + document.getElementById("inputNumber").value, 62, infoY + 31 + textBaselineShift) } \ No newline at end of file diff --git a/data/borders/plane/border.js b/data/borders/plane/border.js index 25142c04..0695031c 100644 --- a/data/borders/plane/border.js +++ b/data/borders/plane/border.js @@ -76,7 +76,7 @@ function bottomInfoPlanechase() { var artistLineWidth = (card.measureText(artist).width + cardWidth * 0.01724) / 2 //18 imgArtistBrush.imgValues(cardWidth / 2 - artistLineWidth, cardHeight * 0.9426, cardWidth * 0.0144, cardHeight * 0.0134) card.mask("imgArtMask,source-over", imgArtistBrush, card.fillStyle) - card.fillText(artist, cardWidth / 2 - artistLineWidth + cardWidth * 0.01724, cardHeight * 0.9479) //18, 710 + card.fillText(artist, cardWidth / 2 - artistLineWidth + cardWidth * 0.01724, cardHeight * 0.9479 + textBaselineShift) //18, 710 //Left and Right side canvas.style.letterSpacing = "0px" card.font = cardHeight * 0.0187 + "px relaymedium" //14 @@ -87,9 +87,9 @@ function bottomInfoPlanechase() { canvas.style.letterSpacing = "0px" card.font = cardHeight * 0.0187 + "px relaymedium" //14 - card.fillText(bottomLineFirst, cardWidth / 2 - ((secondWidth + firstWidth) / 2) - cardWidth * 0.0077, cardHeight * 0.9666) //8, 724 + card.fillText(bottomLineFirst, cardWidth / 2 - ((secondWidth + firstWidth) / 2) - cardWidth * 0.0077, cardHeight * 0.9666 + textBaselineShift) //8, 724 canvas.style.letterSpacing = cardWidth * -0.0007 + "px" //-0.7 card.font = cardHeight * 0.0187 + "px mplantin" //14 - card.fillText(bottomLineSecond, cardWidth / 2 - ((secondWidth + firstWidth) / 2) + firstWidth - cardWidth * 0.0077, cardHeight * 0.9666) //8, 724 + card.fillText(bottomLineSecond, cardWidth / 2 - ((secondWidth + firstWidth) / 2) + firstWidth - cardWidth * 0.0077, cardHeight * 0.9666 + textBaselineShift) //8, 724 } \ No newline at end of file diff --git a/data/borders/planeswalker/border.js b/data/borders/planeswalker/border.js index 70a7fb49..3f19b6ae 100644 --- a/data/borders/planeswalker/border.js +++ b/data/borders/planeswalker/border.js @@ -76,17 +76,17 @@ function planeswalkerCustomFunction() { card.font = "31px belerenbsc" if (loyaltyValue.charAt(0) == "-") { card.drawImage(manaSymbolImages[58], 34, abilityLineY + abilityLines[i] / 2 - 28, 84, 64) - card.fillText(loyaltyValue, 76, abilityLineY + abilityLines[i] / 2 - 17) + card.fillText(loyaltyValue, 76, abilityLineY + abilityLines[i] / 2 - 17 + textBaselineShift) } else if (loyaltyValue.charAt(0) == "+") { card.drawImage(manaSymbolImages[59], 34, abilityLineY + abilityLines[i] / 2 - 38, 82, 62) - card.fillText(loyaltyValue, 74, abilityLineY + abilityLines[i] / 2 - 19) + card.fillText(loyaltyValue, 74, abilityLineY + abilityLines[i] / 2 - 19 + textBaselineShift) } else { card.drawImage(manaSymbolImages[60], 34, abilityLineY + abilityLines[i] / 2 - 28, 82, 56) - card.fillText(loyaltyValue, 74, abilityLineY + abilityLines[i] / 2 - 16) + card.fillText(loyaltyValue, 74, abilityLineY + abilityLines[i] / 2 - 16 + textBaselineShift) } card.font = "37px mplantin" card.fillStyle = "black" - card.fillText(":", 124, abilityLineY + abilityLines[i] / 2 - 23) + card.fillText(":", 124, abilityLineY + abilityLines[i] / 2 - 23 + textBaselineShift) } abilityLineY += abilityLines[i] } diff --git a/data/borders/planeswalkerTall/border.js b/data/borders/planeswalkerTall/border.js index 3680dc54..d568d4ff 100644 --- a/data/borders/planeswalkerTall/border.js +++ b/data/borders/planeswalkerTall/border.js @@ -76,17 +76,17 @@ function planeswalkerTallCustomFunction() { card.font = "31px belerenbsc" if (loyaltyValue.charAt(0) == "-") { card.drawImage(manaSymbolImages[58], 34, abilityLineY + abilityLines[i] / 2 - 28, 84, 64) - card.fillText(loyaltyValue, 76, abilityLineY + abilityLines[i] / 2 - 17) + card.fillText(loyaltyValue, 76, abilityLineY + abilityLines[i] / 2 - 17 + textBaselineShift) } else if (loyaltyValue.charAt(0) == "+") { card.drawImage(manaSymbolImages[59], 34, abilityLineY + abilityLines[i] / 2 - 38, 82, 62) - card.fillText(loyaltyValue, 74, abilityLineY + abilityLines[i] / 2 - 19) + card.fillText(loyaltyValue, 74, abilityLineY + abilityLines[i] / 2 - 19 + textBaselineShift) } else { card.drawImage(manaSymbolImages[60], 34, abilityLineY + abilityLines[i] / 2 - 28, 82, 56) - card.fillText(loyaltyValue, 74, abilityLineY + abilityLines[i] / 2 - 16) + card.fillText(loyaltyValue, 74, abilityLineY + abilityLines[i] / 2 - 16 + textBaselineShift) } card.font = "37px mplantin" card.fillStyle = "black" - card.fillText(":", 124, abilityLineY + abilityLines[i] / 2 - 23) + card.fillText(":", 124, abilityLineY + abilityLines[i] / 2 - 23 + textBaselineShift) } abilityLineY += abilityLines[i] } diff --git a/data/borders/vanguard/border.js b/data/borders/vanguard/border.js index 46ce590d..7c1ed1fc 100644 --- a/data/borders/vanguard/border.js +++ b/data/borders/vanguard/border.js @@ -66,7 +66,7 @@ function bottomInfoVanguard() { // card.fillStyle = document.getElementById("inputInfoColor").value canvas.style.letterSpacing = "1px" card.font = "20px matrix" - card.fillText("Illus. " + document.getElementById("inputArtist").value, cardWidth / 2, infoY) + card.fillText("Illus. " + document.getElementById("inputArtist").value, cardWidth / 2, infoY + textBaselineShift) canvas.style.letterSpacing = "0.5px" card.font = "12px mplantin" var vanguardInfo = "CC \u2014 " + document.getElementById("inputInfo").value @@ -75,10 +75,10 @@ function bottomInfoVanguard() { var year = date.getFullYear() vanguardInfo = "\u2122 & \u00a9 1993-" + year + " Wizards of the Coast, Inc." } - card.fillText(vanguardInfo, cardWidth / 2, infoY + 22) + card.fillText(vanguardInfo, cardWidth / 2, infoY + 22 + textBaselineShift) //Now for the hand/life modifiers, not quite at the bottom but might as well go in this same function canvas.style.letterSpacing = "0px" card.font = "25px mplantin" - card.fillText(document.getElementById("inputVanguardHandMod").value, 111, 886) - card.fillText(document.getElementById("inputVanguardLifeMod").value, 631, 886) + card.fillText(document.getElementById("inputVanguardHandMod").value, 111, 886 + textBaselineShift) + card.fillText(document.getElementById("inputVanguardLifeMod").value, 631, 886 + textBaselineShift) } \ No newline at end of file