Fixed printing of backslashes in procedure numbers and titles

This commit is contained in:
John Jenko 2016-07-07 18:15:13 +00:00
parent 960e09f9fb
commit 382864aca7

View File

@ -765,6 +765,8 @@ namespace Volian.Svg.Library
text = Regex.Replace(text, @"\\[Uu][0-9]+[?]", new MatchEvaluator(ReplaceSpecialCharacter));
text = Regex.Replace(text, @"\\'[0-9a-fA-F][0-9a-fA-F]", new MatchEvaluator(ReplaceHexCharacter));
text += " ";
if (text.Contains("\\"))
text = text.Replace("\\", ((char)9586).ToString()); // B2016-155 convert backslash char to the unicode symbol - to allow processing rtf commands \ul, \up, \dn, etc.
Phrase ph = new Phrase();
while (text.Length > 0)
{
@ -778,8 +780,8 @@ namespace Volian.Svg.Library
}
else
if (text[text.Length - 1] == ' ') text = text.Substring(0, text.Length - 1);
foreach (Chunk chk in BuildPartialPhrase(text, fontSize, fontStyle, font).Chunks)
// B2016-155 convert the backslash symbol back to the backslash character since we look for specific rft commands below
foreach (Chunk chk in BuildPartialPhrase(text.Replace(((char)9586).ToString(),"\\"), fontSize, fontStyle, font).Chunks)
{
if (fontUnderline) chk.SetUnderline(font.Color, 0, 0.05F, 0, -.131F, PdfContentByte.LINE_CAP_ROUND);
if (fontTextRise != 0) chk.SetTextRise(fontTextRise * chk.Font.Size);
@ -835,7 +837,6 @@ namespace Volian.Svg.Library
VolianPdf.RegisterFont("Arial Unicode MS");
fs.AddFont(FontFactory.GetFont("Arial Unicode MS", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, fontSize, fontStyle, new Color(FillColor)));
}
Phrase ph = fs.Process(text);
return ph;
}