absolute font sizes

This commit is contained in:
Kyle
2022-05-08 14:01:29 -07:00
parent d7f9736f8e
commit 61b53c516c
2 changed files with 6 additions and 1 deletions

View File

@@ -225,6 +225,7 @@ include('../globalHTML/header-1.php');
<h5>{lns}</h5><h5>Moves to the next line without an extra space (stands for line-no-space)</h5> <h5>{lns}</h5><h5>Moves to the next line without an extra space (stands for line-no-space)</h5>
<h5>{divider}</h5><h5>Moves to the next line and draws the flavor text bar</h5> <h5>{divider}</h5><h5>Moves to the next line and draws the flavor text bar</h5>
<h5>{flavor}</h5><h5>Moves to the next line, draws the flavor text bar, and italicizes</h5> <h5>{flavor}</h5><h5>Moves to the next line, draws the flavor text bar, and italicizes</h5>
<h5>{fontsize#pt}</h5><h5>Changes the font size to #pt (absolute)</h5>
<h5>{fontsize#}</h5><h5>Changes the font size by # pixels (relative - use negative integers to shrink text - ie '{fontsize-12}')</h5> <h5>{fontsize#}</h5><h5>Changes the font size by # pixels (relative - use negative integers to shrink text - ie '{fontsize-12}')</h5>
<h5>{fontcolor___}</h5><h5>Changes the font color to ___ (ie '{fontcolor#00FF00}')</h5> <h5>{fontcolor___}</h5><h5>Changes the font color to ___ (ie '{fontcolor#00FF00}')</h5>
<h5>{left}</h5><h5>Aligns text to the left</h5> <h5>{left}</h5><h5>Aligns text to the left</h5>

View File

@@ -1051,7 +1051,11 @@ function writeText(textObject, targetContext) {
textColor = possibleCode.replace('fontcolor', ''); textColor = possibleCode.replace('fontcolor', '');
lineContext.fillStyle = textColor; lineContext.fillStyle = textColor;
} else if (possibleCode.includes('fontsize')) { } else if (possibleCode.includes('fontsize')) {
textSize += parseInt(possibleCode.replace('fontsize', '')) || 0; if (possibleCode.slice(-2) === "pt") {
textSize = (parseInt(possibleCode.replace('fontsize', '').replace('pt', '')) * 600 / 72) || 0;
} else {
textSize += parseInt(possibleCode.replace('fontsize', '')) || 0;
}
lineContext.font = textFontStyle + textSize + 'px ' + textFont + textFontExtension; lineContext.font = textFontStyle + textSize + 'px ' + textFont + textFontExtension;
} else if (possibleCode.includes('font') || savedFont) { } else if (possibleCode.includes('font') || savedFont) {
textFont = word.replace('{font', '').replace('}', ''); textFont = word.replace('{font', '').replace('}', '');