C2019-022 Removed the use of the Arial Unicode font (was in for backward compatibility) when using symbols with a proportional font. We now use FreeSerif (supplied by Volian)

C2019-022 When pre-processing table cells before we print a table, we now replace any Arial Unicode font reference with FreeSerif.
This commit is contained in:
John Jenko 2019-05-16 16:48:55 +00:00
parent 70fbe75672
commit 0ba08ae64d
2 changed files with 20 additions and 8 deletions

View File

@ -20,9 +20,13 @@ namespace Volian.Base.Library
get {
if (_ProportionalSymbolFont == null)
{
if (FindFontFamily("Arial Unicode MS"))
_ProportionalSymbolFont = "Arial Unicode MS"; // microsoft no longer supplies this font as of Word16
else if (FindFontFamily("FreeSerif"))
// C2019-022 Microsoft no longer supplies the Arial Unicode font. New computers more than likely do not have this font
// Since this font is no longer supported, we will now use FreeSerif or FreeMono for symbol characters
// when using a proportional font.
// We removed even checking if Arial Unicode was installed because we had a case (at Volian) where the font
// existed (was installed on a Windows 10 computer) but so some reason (unknown at time of writing) Windows say it was bad.
// PROMS would will try to use it when printing resulting in very slow print speed and often an un-readable PDF file.
if (FindFontFamily("FreeSerif"))
_ProportionalSymbolFont = "FreeSerif"; // volian supplied font but regular chars look like Times Roman
else if (FindFontFamily("FreeMono"))
_ProportionalSymbolFont = "FreeMono"; // volian suppllied font but regular chars are fixed spaced and look like Courier
@ -49,11 +53,11 @@ namespace Volian.Base.Library
get {
if (_ReportsFont == null)
{
if (FindFontFamily("Arial Unicode MS")) // microsoft no longer supplies this font as of Word16
_ReportsFont = "Arial Unicode MS";
else if (FindFontFamily("Meiryo")) // is a Japanise font (standard windows font) but cannot be used along with the Arial font - will shift text up half a character when mixing the two fonts.
_ReportsFont = "Meiryo";
else if (FindFontFamily("FreeSerif")) // volian supplied font but regular chars look like Times Roman
// C2019-022 Microsoft no longer supplies the Arial Unicode font. New computers more than likely do not have this font
// Since this font is no longer supported, we will now use FreeSerif or FreeMono for symbol characters
// when using a proportional font.
// Also the Meiryo font will not be used as it cannot be used along with the Arial font.
if (FindFontFamily("FreeSerif")) // volian supplied font but regular chars look like Times Roman
_ReportsFont = "FreeSerif";
else if (FindFontFamily("FreeMono")) // volian suppllied font but regular chars are fixed spaced and look like Courier
_ReportsFont = "FreeMono";

View File

@ -825,6 +825,14 @@ namespace Volian.Print.Library
// space before the 'ulnone' the following won't work. Also, this change was not
// made in the non-table code. If the problem occurs there, it should be added.
_StatRTB.Rtf = Regex.Replace(str.Replace(@"\~", @"\u160?"), @"(?<!\\[a-z0-9]+) \\ulnone", @"\u160?\ulnone");
string s = _StatRTB.Rtf;
// C2019-022 Microsoft no longer supplies the Arial Unicode font. New computers more than likely do not have this font
// This logic will replace the Arial Unicode font reference in each table cell with FreeSerif (supplied by Volian)
// this will avoid slow printing, font errors, and un-readable PDF files
// We had a case (at Volian) where the font existed (was installed on a Windows 10 computer)
// but so some reason (unknown at time of writing) Windows say it was bad.
s = s.Replace("Arial Unicode MS", "FreeSerif");
_StatRTB.Rtf = s;
}
else
_StatRTB.Text = str;