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.
This commit is contained in:
John Jenko 2016-06-02 19:22:00 +00:00
parent 6ed306e8b9
commit eec1c7f6f9
2 changed files with 13 additions and 3 deletions

View File

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

View File

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