textBaseline

This commit is contained in:
Kyle
2018-12-22 12:17:12 -08:00
parent 3d2c0a85a2
commit 600c371975
6 changed files with 54 additions and 41 deletions

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 + textBaselineShift)
card.fillText("Illus. " + document.getElementById("inputArtist").value, cardWidth / 2, infoY + textBaselineShift[0] * card.font.split("px")[0])
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 + textBaselineShift)
card.fillText(vanguardInfo, cardWidth / 2, infoY + 22 + textBaselineShift[0] * card.font.split("px")[0])
//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 + textBaselineShift)
card.fillText(document.getElementById("inputVanguardLifeMod").value, 631, 886 + textBaselineShift)
card.fillText(document.getElementById("inputVanguardHandMod").value, 111, 886 + textBaselineShift[0] * card.font.split("px")[0])
card.fillText(document.getElementById("inputVanguardLifeMod").value, 631, 886 + textBaselineShift[0] * card.font.split("px")[0])
}