if PageItem font CPI is null, then default to 12 CPI

Commented out script caution logic (used in NSP for 16-bit VE-PROMS)
This commit is contained in:
2012-06-18 20:24:45 +00:00
parent b7270782e6
commit fc34e050ef
2 changed files with 22 additions and 19 deletions

View File

@@ -997,7 +997,9 @@ namespace Volian.Print.Library
// Take the difference between the width in Points of a character at 12CPI and a character
// at the defined font's CPI. Multiply that times the length of title and divide by two
// to find the half-way point.
colAdj16bit = (1 + text.Length) * ((72 / (float)pageItem.Font.CPI) - (72 / 12)) / 2;
// if the PageItem's font CPI is null, then default to 12 CPI
colAdj16bit = (1 + text.Length) * ((72 / (float)(pageItem.Font.CPI ?? 12)) - (72 / 12)) / 2;
}
}
svgText.Font = pageItem.Font.WindowsFont;