diff --git a/PROMS/Volian.Base.Library/VlnItextSharpFont.cs b/PROMS/Volian.Base.Library/VlnItextSharpFont.cs index 57151d0f..9efcb2cb 100644 --- a/PROMS/Volian.Base.Library/VlnItextSharpFont.cs +++ b/PROMS/Volian.Base.Library/VlnItextSharpFont.cs @@ -35,28 +35,35 @@ namespace Volian.Base.Library } } } + // B2019-174 created RegisterFontFolder so that we call at start of print() in PromsPrinter.cs + // this allows symbol characters to appear on the Auto Table Of Contents page + public static void RegisterFontFolder() + { + if (_PromsFontDir == null || _PromsFontDir =="")//B2019-099 Consistent Font Retrieve + { + _PromsFontDir = Volian.Base.Library.VlnSettings.GetCommand("PromsFonts", ""); + if (_PromsFontDir == "") + _PromsFontDir = FontFind.FontDir; + else + { + DirectoryInfo di = new DirectoryInfo(_PromsFontDir); + if (!di.Exists) + _PromsFontDir = FontFind.FontDir; + else + _MyLog.WarnFormat("PROMS Font Folder = {0}", _PromsFontDir); // C2019-028 Add info in the error log + } + } + int profileDepth1 = ProfileTimer.Push(">>>> RegisterDirectory " + _PromsFontDir); + //_MyLog.DebugFormat("Register this Font Folder = {0}", _PromsFontDir); // debug + iTextSharp.text.FontFactory.RegisterDirectory(_PromsFontDir); + ProfileTimer.Pop(profileDepth1); + } public static void RegisterFontByFontFolders(string fontName) { int profileDepth = ProfileTimer.Push(string.Format(">>>> RegisterFont {0}", fontName)); if (!iTextSharp.text.FontFactory.IsRegistered(fontName)) { - if (_PromsFontDir == null)//B2019-099 Consistent Font Retrieve - { - _PromsFontDir = Volian.Base.Library.VlnSettings.GetCommand("PromsFonts", ""); - if (_PromsFontDir == "") - _PromsFontDir = FontFind.FontDir; - else - { - DirectoryInfo di = new DirectoryInfo(_PromsFontDir); - if (!di.Exists) - _PromsFontDir = FontFind.FontDir; - else - _MyLog.WarnFormat("PROMS Font Folder = {0}", _PromsFontDir); // C2019-028 Add info in the error log - } - } - int profileDepth1 = ProfileTimer.Push(">>>> RegisterDirectory " + _PromsFontDir); - iTextSharp.text.FontFactory.RegisterDirectory(_PromsFontDir); - ProfileTimer.Pop(profileDepth1); + RegisterFontFolder(); if (!iTextSharp.text.FontFactory.IsRegistered(fontName)) { //B2019-099 Consistent Font Retrieve @@ -64,6 +71,7 @@ namespace Volian.Base.Library if (_PromsFontDir != FontFind.FontDir) { int profileDepth2 = ProfileTimer.Push(">>>> RegisterDirectory " + FontFind.FontDir); + //_MyLog.DebugFormat("Register this Font Folder = {0}", FontFind.FontDir); // debug iTextSharp.text.FontFactory.RegisterDirectory(FontFind.FontDir); ProfileTimer.Pop(profileDepth2); if (!iTextSharp.text.FontFactory.IsRegistered(fontName)) @@ -72,11 +80,16 @@ namespace Volian.Base.Library int profileDepth3 = ProfileTimer.Push(">>>> RegisterDirectories"); iTextSharp.text.FontFactory.RegisterDirectories(); ProfileTimer.Pop(profileDepth3); - } + } + //else + //{ + // _MyLog.DebugFormat("Registered Font {0} in {1}", fontName, FontFind.FontDir); // debug + //} } else { int profileDepth4 = ProfileTimer.Push(">>>> RegisterDirectories"); + //_MyLog.DebugFormat("RegistererDirectories {0}", FontFind.FontDir); // debug iTextSharp.text.FontFactory.RegisterDirectories(); ProfileTimer.Pop(profileDepth4); } diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 7674467a..c9de11c8 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -684,7 +684,7 @@ namespace Volian.Print.Library if (_MyFoldoutSection != null) _MyFoldoutSection.Clear(); else _MyFoldoutSection = new List(); - + VlnItextFont.RegisterFontFolder(); //B2019-174 register the font folder so that symbols will display on auto TOC if (myProcedure.Sections != null) { int cnt = 0;