Logic for UnderlineTerminate, Ginna Backgrounds and McGuire’s: Caution and Notes, section title print, and line spacing

Added logic for UnderlineTerminate
This commit is contained in:
2013-12-06 19:52:55 +00:00
parent a2f1fb0640
commit d46f6ec495
2 changed files with 124 additions and 13 deletions

View File

@@ -195,6 +195,9 @@ namespace Volian.Print.Library
int sep = origTab.IndexOfAny(". ".ToCharArray());
origTab = @"\ul " + origTab.Substring(0, sep-1) + @"\ulnone" + origTab.Substring(sep-1);
}
UnderlineTerminateList utl = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.UnderlineTerminateList;
// if this tab is underlined, the underlining should not underline the ':'. Check for "NOTE:"
// or "CAUTION:", i.e. only underline up to ':'
if (myparent.MyItemInfo.IsStep && ((myparent.MyItemInfo.FormatStepData.AlwaysTab || myparent.MyItemInfo.MyPrevious == null)
@@ -208,6 +211,22 @@ namespace Volian.Print.Library
int indxC = origTab.IndexOf(":");
origTab = @"\ul " + origTab.Substring(0, indxC) + @"\ulnone" + origTab.Substring(indxC);
}
else if (utl != null && ((vFont.Style & E_Style.Underline) > 0))
{
foreach (UnderlineTerminate ut in utl)
{
if (origTab.Contains(ut.Text))
{
FontStyle style = FontStyle.Regular;
if ((vFont.Style & E_Style.Bold) > 0) style |= FontStyle.Bold;
if ((vFont.Style & E_Style.Italics) > 0) style |= FontStyle.Italic;
vFont.WindowsFont = new System.Drawing.Font(vFont.Family, (float)vFont.Size, style);
int indxC = origTab.IndexOf(ut.Text);
origTab = @"\ul " + origTab.Substring(0, indxC) + @"\ulnone " + origTab.Substring(indxC);
break;
}
}
}
Rtf = GetRtf(origTab, vFont);
Rtf = Rtf.Replace("\u0394", @"\f1\u916?\f0 "); // delta 0x0394
if (ScriptCaution)