diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs index 05a8913d..6f4b866d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs @@ -1294,8 +1294,8 @@ namespace VEPROMS.CSLA.Library string token = m.Groups[1].Value; switch (token[1]) { - case '_': - return token.Trim() ; // B2020-104 with .NET 4.8, a hard dash is represented as "\_" in the RTF + case '_': // B2020-100 New Non-Breaking Hyphen + return token.Trim(); case '\\': return token; case 'u': diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 80b55408..323baa86 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -319,12 +319,14 @@ namespace Volian.Controls.Library { get { - if (_RtfPrefix == null) - { + //B2020-100 RHM Use SelectionFont rather than the font from the format file. + //if (_RtfPrefix == null) + //{ StringBuilder selectedRtfSB = new StringBuilder(); - AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont)); + //AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont)); + AddFontTable(selectedRtfSB, SelectionFont, FontIsFixed(FormatFont)); _RtfPrefix = selectedRtfSB.ToString(); - } + //} return _RtfPrefix + @"\f1\fs" + FormatFont.SizeInPoints * 2 + " "; } } @@ -1317,10 +1319,12 @@ namespace Volian.Controls.Library int position = SelectionStart; SelectedRtf = RtfPrefixForSymbols + str + @"}"; Select(position, 1); - RTBAPI.SetFontStyle(this, fs); Select(position + 1, 0); if (FieldToEdit == E_FieldToEdit.StepText) + { SelectionFont = MyItemInfo.GetItemFont().WindowsFont; + RTBAPI.SetFontStyle(this, fs);// B2020-100 Keep the font style + } else // if doing properties for folder, docversion, proc or sect, don't get item's font. SelectionFont = locfont; diff --git a/PROMS/Volian.Print.Library/Grid2Pdf.cs b/PROMS/Volian.Print.Library/Grid2Pdf.cs index ce60a887..cdadd0ad 100644 --- a/PROMS/Volian.Print.Library/Grid2Pdf.cs +++ b/PROMS/Volian.Print.Library/Grid2Pdf.cs @@ -904,7 +904,7 @@ public string Path } private iTextSharp.text.Paragraph RtfToParagraph(string rtf, iTextSharp.text.Font mySymFont,int r, int c) { - rtf=FixRTFToPrint(rtf,r,c); + rtf = FixRTFToPrint(rtf, r, c).Replace(@"\_", "-");//B2020-100 RHM Convert new form of non-breaking hyphen to hyphen IRtfDocument rtfDoc = RtfInterpreterTool.BuildDoc(rtf); Rtf2iTextSharp rtf2IText = new Rtf2iTextSharp(rtfDoc); rtf2IText.DefaultFont = mySymFont;