MNS - C2018-024 I in Arial font changed to I in TimesNewRoman for Step Tabs and Transitions

This commit is contained in:
Rich
2018-08-07 14:45:54 +00:00
parent 63932cd2c9
commit 234b6561f9
4 changed files with 40 additions and 1 deletions

View File

@@ -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(@"\\", "<dblbs>"); // 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: