From 234b6561f935c651d8a113ed7560f59bef41761a Mon Sep 17 00:00:00 2001 From: Rich Date: Tue, 7 Aug 2018 14:45:54 +0000 Subject: [PATCH] MNS - C2018-024 I in Arial font changed to I in TimesNewRoman for Step Tabs and Transitions --- PROMS/Formats/fmtall/MCGall.xml | Bin 66950 -> 67020 bytes .../Format/PlantFormat.cs | 9 ++++++ PROMS/Volian.Print.Library/vlnParagraph.cs | 29 +++++++++++++++++- PROMS/Volian.Print.Library/vlnTab.cs | 3 ++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/PROMS/Formats/fmtall/MCGall.xml b/PROMS/Formats/fmtall/MCGall.xml index ef5656abf53369135409d4e0c5e0c67bc3cc7a4a..102f9698f3c847746e3f4817a8623e340dc3c0e8 100644 GIT binary patch delta 72 zcmZqcW;xT%vf&H&WQ9x?!3>5(hCGIJhExVOhI}BaWb(%pVSZ1BOd#8lp$JGPGUQBN ZXe>XuL5F3sf*{xAe*%1)6?oEq0ss%o6@mZ& delta 22 ecmX@p&C=G*vf&H& _ChangeFontUpperCaseIinArial; + public bool ChangeFontUpperCaseIinArial + { + get + { + return LazyLoad(ref _ChangeFontUpperCaseIinArial, "@ChangeFontUpperCaseIinArial"); + } + } } #endregion #region TextTypeValue diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 61fb0286..38402b5d 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -4556,7 +4556,9 @@ namespace Volian.Print.Library Rtf = FixRTFToPrint(MyItemInfo, Rtf); ProfileTimer.Pop(profileDepth); } - // F2018-013 Changed to static and public so that it can be used with step identifiers for bullets + // C2018-024 I in Arial font changed to I in TimesNewRoman + private static System.Drawing.Font _TNR; + // F2018-013 Changed to static and public so that it can be used with step identifiers for bullets public static string FixRTFToPrint(ItemInfo myItemInfo, string rtf) { // Only do this if the text contains symbols. @@ -4569,6 +4571,31 @@ namespace Volian.Print.Library rtb.Rtf = rtf.Replace(@"\\", ""); // rename backslash character to avoid RTF confusion //string showRTF = rtf; bool changed = false; + // C2018-024 I in Arial font changed to I in TimesNewRoman + if (myItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ChangeFontUpperCaseIinArial) + { + bool lastWasNumber = false; + for (int i = 0; i < rtb.TextLength - 1; i++) + { + rtb.Select(i, 2); + if (rtb.SelectionLength == 2) + { + if ((rtb.SelectedText == ".I") && rtb.SelectionFont.FontFamily.Name == "Arial") + { + if (_TNR == null) + _TNR = new System.Drawing.Font("Times New Roman", rtb.SelectionFont.Size, rtb.SelectionFont.Style); + if (lastWasNumber) + { + rtb.SelectionFont = _TNR; + changed = true; + lastWasNumber = false; + } + } + else + lastWasNumber = Regex.IsMatch(rtb.SelectedText, @"[0-9]\."); + } + } + } // C2017-008 - WCN wants the box symbol to look like their checkoff/signoff box // Check for a list of replacement character for symbols in the format file // ReplaceSymbolChars lets you do one or more of the following with a symbol character: diff --git a/PROMS/Volian.Print.Library/vlnTab.cs b/PROMS/Volian.Print.Library/vlnTab.cs index d3b1cd09..893530d6 100644 --- a/PROMS/Volian.Print.Library/vlnTab.cs +++ b/PROMS/Volian.Print.Library/vlnTab.cs @@ -134,6 +134,9 @@ namespace Volian.Print.Library YOffset = yoffset; Text = cleanTab; MyFont = vFont; + // C2018-024 I in Arial font changed to I in TimesNewRoman + if (myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ChangeFontUpperCaseIinArial && cleanTab.StartsWith("I.")) + vFont = new VE_Font("Times New Roman", (int)vFont.Size, (E_Style)vFont.Style, (float)vFont.CPI); // BGE has a format flag to increase size of font, if top level: if (doSectTab && myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Level0Big && myparent.MyItemInfo.MyParent.IsProcedure) vFont = new VE_Font(vFont.Family, 14, (E_Style)vFont.Style | E_Style.Bold, 8);