adjustable line spacing

This commit is contained in:
Kyle
2021-09-13 11:08:04 -07:00
parent 774caebfec
commit 4bf4643c8b
2 changed files with 3 additions and 3 deletions

View File

@@ -795,8 +795,8 @@ function writeText(textObject, targetContext) {
var drawToPrePTCanvas = false; var drawToPrePTCanvas = false;
var widestLineWidth = 0; var widestLineWidth = 0;
//variables that track various... things? //variables that track various... things?
var newLineSpacing = 0;
var textSize = startingTextSize; var textSize = startingTextSize;
var newLineSpacing = (textObject.lineSpacing || 0) * textSize;
var ptShift = [0, 0]; var ptShift = [0, 0];
var permaShift = [0, 0]; var permaShift = [0, 0];
//Finish prepping canvases //Finish prepping canvases
@@ -1083,7 +1083,7 @@ function writeText(textObject, targetContext) {
//reset //reset
currentX = startingCurrentX; currentX = startingCurrentX;
currentY += textSize + newLineSpacing; currentY += textSize + newLineSpacing;
newLineSpacing = 0; newLineSpacing = (textObject.lineSpacing || 0) * textSize;
newLine = false; newLine = false;
} }
if (wordToWrite && (currentX != 0 || wordToWrite != ' ') && !textManaCost) { if (wordToWrite && (currentX != 0 || wordToWrite != ' ') && !textManaCost) {

View File

@@ -27,7 +27,7 @@ var LoadFABVersion = async () => {
loadTextOptions({ loadTextOptions({
title: {name:'Title', text:'', x:0.19, y:0.0705, width:0.62, height:0.0405, oneLine:true, font:'amanda', size:0.0405, align:'center', manaPrefix:'fab'}, title: {name:'Title', text:'', x:0.19, y:0.0705, width:0.62, height:0.0405, oneLine:true, font:'amanda', size:0.0405, align:'center', manaPrefix:'fab'},
type: {name:'Type', text:'', x:0.24, y:0.8977, width:0.52, height:0.0281, oneLine:true, font:'amanda', size:0.0281, align:'center', manaPrefix:'fab'}, type: {name:'Type', text:'', x:0.24, y:0.8977, width:0.52, height:0.0281, oneLine:true, font:'amanda', size:0.0281, align:'center', manaPrefix:'fab'},
rules: {name:'Rules Text', text:'', x:0.12, y:0.6153, width:0.76, height:0.28, size:0.0281, font:'palatino', manaPrefix:'fab'}, rules: {name:'Rules Text', text:'', x:0.12, y:0.6153, width:0.76, height:0.28, size:0.0281, font:'palatino', manaPrefix:'fab', lineSpacing:0.2},
cost: {name:'Cost', text:'', x:0.854, y:0.0753, width:0.0534, height:0.031, size:0.031, font:'palatino', oneLine:true, align:'center', manaPrefix:'fab'}, cost: {name:'Cost', text:'', x:0.854, y:0.0753, width:0.0534, height:0.031, size:0.031, font:'palatino', oneLine:true, align:'center', manaPrefix:'fab'},
left: {name:'Left Stat', text:'', x:0.162, y:0.9124, width:0.0534, height:0.0358, size:0.0358, font:'palatino', oneLine:true, align:'center', manaPrefix:'fab'}, left: {name:'Left Stat', text:'', x:0.162, y:0.9124, width:0.0534, height:0.0358, size:0.0358, font:'palatino', oneLine:true, align:'center', manaPrefix:'fab'},
right: {name:'Right Stat', text:'', x:0.7847, y:0.9124, width:0.0534, height:0.0358, size:0.0358, font:'palatino', oneLine:true, align:'center', manaPrefix:'fab'} right: {name:'Right Stat', text:'', x:0.7847, y:0.9124, width:0.0534, height:0.0358, size:0.0358, font:'palatino', oneLine:true, align:'center', manaPrefix:'fab'}