Fixed issue where the Note tab was not always being underlined

This commit is contained in:
John Jenko 2014-01-09 14:15:41 +00:00
parent c2857b2b16
commit 1aa10bf9cd

View File

@ -259,11 +259,43 @@ namespace Volian.Print.Library
//DisplayText vlntxt = new DisplayText(text.TrimStart(" ".ToCharArray()), vFont, false);
DisplayText vlntxt = new DisplayText(text, vFont, false);
//rtfSB.Append(AddFontTable(vlntxt.TextFont.WindowsFont));
rtfSB.Append(AddFontTable(vFont.WindowsFont));
//rtfSB.Append(AddFontTable(vFont.WindowsFont));
rtfSB.Append(AddFontTable(vFont));
rtfSB.Append(vlntxt.StartText);
rtfSB.Append("}");
return rtfSB.ToString();
}
public static string AddFontTable(VE_Font vfont)
{
System.Drawing.Font font = vfont.WindowsFont;
StringBuilder rtfSB = new StringBuilder();
StringBuilder sbbeg = new StringBuilder();
StringBuilder sbend = new StringBuilder();
if ((vfont.Style & E_Style.Bold) > 0)
{
sbbeg.Append(@"\b");
sbend.Append(@"\b0");
}
if ((vfont.Style & E_Style.Underline) > 0)
{
sbbeg.Append(@"\ul");
sbend.Insert(0, @"\ulnone");
}
if ((vfont.Style & E_Style.Italics) > 0)
{
sbbeg.Append(@"\i");
sbend.Insert(0, @"\i0");
}
rtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + font.FontFamily.Name + @";}"); //}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}}";
if (!FontIsFixed(font))
rtfSB.Append(@"{\f1\fnil\fcharset0 Arial Unicode MS;}}{\colortbl ;\red255\green0\blue0;}");
else
rtfSB.Append(@"{\f1\fnil\fcharset0 VESymbFix;}}{\colortbl ;\red255\green0\blue0;}");
rtfSB.Append("\r\n");
// use styles to construct rtf commands to insert into next line (where \b, etc is)
rtfSB.Append(@"\viewkind4\uc1\pard\sl-240\slmult0" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(font.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}";
return rtfSB.ToString();
}
public static string AddFontTable(System.Drawing.Font font)
{
StringBuilder rtfSB = new StringBuilder();