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

Binary file not shown.

View File

@ -2681,6 +2681,15 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _DontResetIndentOnNewline, "@DontResetIndentOnNewline");
}
}
// C2018-024 I in Arial font changed to I in TimesNewRoman
private LazyLoad<bool> _ChangeFontUpperCaseIinArial;
public bool ChangeFontUpperCaseIinArial
{
get
{
return LazyLoad(ref _ChangeFontUpperCaseIinArial, "@ChangeFontUpperCaseIinArial");
}
}
}
#endregion
#region TextTypeValue

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:

View File

@ -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);