textBaselineShift

This commit is contained in:
Kyle
2018-12-15 12:46:11 -08:00
parent 932fa3be52
commit 090e35125b
5 changed files with 17 additions and 17 deletions

View File

@@ -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)
}

View File

@@ -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
}

View File

@@ -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]
}

View File

@@ -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]
}

View File

@@ -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)
}