From eec1c7f6f991806d39b680a9f94eaaf6245609d6 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 2 Jun 2016 19:22:00 +0000 Subject: [PATCH] Added support to convert the carrot character (^) to the delta symbol in X/Y Plots Added support for hard spaces in section titles and removed the dash character that was always inserted between the section number and section title. --- PROMS/Volian.Print.Library/CompleteRORpt.cs | 12 ++++++++++-- PROMS/Volian.Print.Library/PDFChronologyReport.cs | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Print.Library/CompleteRORpt.cs b/PROMS/Volian.Print.Library/CompleteRORpt.cs index a097e6f7..ff19b9c8 100644 --- a/PROMS/Volian.Print.Library/CompleteRORpt.cs +++ b/PROMS/Volian.Print.Library/CompleteRORpt.cs @@ -164,8 +164,13 @@ namespace Volian.Print.Library Phrase p = new Phrase(); bool underlineChunk = false; instr = instr.Replace("`", "\u00B0"); //degree + //instr = instr.Replace("\xC1", "\u03C1"); // rho symbol - is being read in as a line draw character if (ConvertCaretToDelta) + { + //char[] ca = instr.ToCharArray(); // for debug instr = instr.Replace("^", "\u0394"); // delta + } + //instr = instr.Replace("\x94", "\u0394"); // delta - the delta symbol is being read in as character x94 instr = ReplaceLineDrawCharsWithUnicode(instr); // Handle super/sub scripts MatchCollection mc = Regex.Matches(instr, "[#~](.*?)[#~]"); @@ -351,8 +356,11 @@ namespace Volian.Print.Library { string pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; string rawPlotLang = plotlang; - plotlang = plotlang.Replace("`", "\xB0"); - plotlang = plotlang.Replace("\xF8", "\xB0"); + plotlang = plotlang.Replace("`", "\xB0"); //degree + plotlang = plotlang.Replace("\xF8", "\xB0"); //degree + if (ConvertCaretToDelta) + plotlang = plotlang.Replace("^", "\x394"); // delta + plotlang = plotlang.Replace("\x7F", "\x394"); //delta PdfPCell spaceCell = new PdfPCell(); spaceCell.BorderColor = Color.WHITE; datatable.AddCell(spaceCell); diff --git a/PROMS/Volian.Print.Library/PDFChronologyReport.cs b/PROMS/Volian.Print.Library/PDFChronologyReport.cs index f96afcbb..b77f2794 100644 --- a/PROMS/Volian.Print.Library/PDFChronologyReport.cs +++ b/PROMS/Volian.Print.Library/PDFChronologyReport.cs @@ -686,7 +686,9 @@ namespace Volian.Print.Library { // Remove Procedure Number and Title string sectionAndStep = Regex.Replace(path + "\x7\x7\x7", "^.+?\\u0007", ""); - sectionAndStep = sectionAndStep.Replace("\x11", sectionAndStep[0] == '\x11' ? "" : " - "); + //sectionAndStep = sectionAndStep.Replace("\x11", sectionAndStep[0] == '\x11' ? "" : " - "); + sectionAndStep = sectionAndStep.Replace("\x11", sectionAndStep[0] == '\x11' ? "" : " "); + sectionAndStep = sectionAndStep.Replace("\\u160?", " "); // replace a hardspace with a space // Split Section frrom Steps return sectionAndStep.Split("\x7".ToCharArray()); }