This commit is contained in:
parent
432f5abab9
commit
be2d538f99
@ -335,36 +335,6 @@ namespace Volian.Svg.Library
|
||||
}
|
||||
return unicodeFont;
|
||||
}
|
||||
private string RemoveRtfStyles(string rtf)
|
||||
{
|
||||
string retval = rtf;
|
||||
// remove rtf commands for any styles that were added. Note that if
|
||||
// the entire item has a style, and also contains 'pieces' of text with
|
||||
// the same style, the underlying rtf box removes the embedded rtf commands,
|
||||
// for example, if the entire step is bolded, and 'THEN' has bold on/off
|
||||
// surrounding it, the rtf box removes the bold around the 'THEN'
|
||||
// These remove the command with a following space or the command alone,
|
||||
// either case may exist, because if there are rtf commands following the
|
||||
// style command, there will be no space character following the style command.
|
||||
if ((TextFont.Style & FontStyle.Bold) > 0)
|
||||
{
|
||||
retval = Regex.Replace(retval, @"\\ulnone\\b0 ?", "\\ulnone");
|
||||
retval = Regex.Replace(retval, @"\\b0 ?", "");
|
||||
retval = Regex.Replace(retval, @"\\ul\\b ?", "\\ul");
|
||||
retval = Regex.Replace(retval, @"\\b ?", "");
|
||||
}
|
||||
if ((TextFont.Style & FontStyle.Underline) > 0)
|
||||
{
|
||||
retval = Regex.Replace(retval, @"\\ul0 ?", "");
|
||||
retval = Regex.Replace(retval, @"\\ul ?", "");
|
||||
}
|
||||
if ((TextFont.Style & FontStyle.Italic) > 0)
|
||||
{
|
||||
retval = Regex.Replace(retval, @"\\i0 ?", "");
|
||||
retval = Regex.Replace(retval, @"\\i ?", "");
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
public static string ReplaceRTFClause(Match m)
|
||||
{
|
||||
switch (m.Value[1])
|
||||
@ -415,7 +385,6 @@ namespace Volian.Svg.Library
|
||||
if (retval[0] == ' ') retval = retval.Remove(0, 1);
|
||||
// remove \r\n at end of string - this was added with the \par at the end of string by the rtf box
|
||||
if (retval.Substring(retval.Length - 2, 2) == "\r\n") retval = retval.Remove(retval.Length - 2, 2);
|
||||
// TODO: retval = RemoveRtfStyles(retval);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user