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

@@ -1051,7 +1051,11 @@ function writeText(textObject, targetContext) {
textColor = possibleCode.replace('fontcolor', '');
lineContext.fillStyle = textColor;
} 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;
} else if (possibleCode.includes('font') || savedFont) {
textFont = word.replace('{font', '').replace('}', '');