C2022-003-Change-Textboxes-to-RTF-3

This commit is contained in:
2026-01-29 19:38:04 -05:00
parent 77c6298067
commit 35eb05432b
8 changed files with 36 additions and 144 deletions

View File

@@ -46,25 +46,12 @@ namespace ctlXMLEditLib
{
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
{
string clpBrd = Clipboard.GetText();
char[] chrAry = clpBrd.ToCharArray();
foreach (int chr in chrAry)
{
if (chr > 166)
{
symFlg = true;
break;
}
else
{
symFlg = false;
}
}
if (symFlg == true)
{
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
string clpBrd = Clipboard.GetText();
if (clpBrd.Any(c => c > 166))
{
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
}
}
}
@@ -87,14 +74,10 @@ namespace ctlXMLEditLib
sbbeg.Append(@"\i");
sbend.Insert(0, @"\i0");
}
// RO Editor add symbols C2022-003
selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + myFont.FontFamily.Name + @";}");
if (!isFixed)
selectedRtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // C2017-036 get best available proportional font for symbols - B2025-039 add Blue for Colored Replace Words
else
selectedRtfSB.Append(@"{\f1\fnil\fcharset0 FreeMono;}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing
selectedRtfSB.Append(@"{\f1\fnil\fcharset0 FreeMono;}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // FreeMono is now used for symbols display.
selectedRtfSB.Append("\r\n");
// use styles to construct rtf commands to insert into next line (where \b, etc is)
// B2015-134 Hanging Indent with Hard Returns was not being saved- removed \sl-240\slmult0
selectedRtfSB.Append(@"\viewkind4\uc1\pard" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(myFont.SizeInPoints * 2).ToString() + @" ");
}
private Font _FormatFont;
@@ -108,15 +91,6 @@ namespace ctlXMLEditLib
formatFont = Font;
_FormatFont = formatFont;
}
// We found that the characters in the Letter Gothic font do not all use the same spacing.
// Also, the character spacing is even more different between screen resolutions.
// But the Letter Gothic font will print just fine.
// We also found that the Letter Gothic Tall font works just fine on the screen, the only difference
// is that the characters are a little bit taller.
// So we decided to use the Letter Gothic Tall font for the screen display any time that Letter Gothic is used.
if (_FormatFont.Name.ToUpper().Equals("LETTER GOTHIC"))
_FormatFont = new Font("Letter Gothic Tall", _FormatFont.Size, _FormatFont.Style);
return _FormatFont;
}
set { _FormatFont = value; }