C2017-036 Call method that finds a proportional font that supports the symbol characters we use.

This commit is contained in:
John Jenko 2017-11-13 17:38:22 +00:00
parent a2c11290a7
commit 203baaf699
12 changed files with 101 additions and 69 deletions

View File

@ -1048,14 +1048,15 @@ namespace Volian.Controls.Library
get { return _CircleYOffset; }
set { _CircleYOffset = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); }
}
private Font _CircleFont = new Font("Arial Unicode MS", 23);
[Category("Circle")]
[DisplayName("Circle Font")]
public Font CircleFont
{
get { return _CircleFont; }
set { _CircleFont = value; if(_MyStepPanel != null) _MyStepPanel.Refresh(); }
}
// Appears to not be used - JSJ - 11-13-2017
//private Font _CircleFont = new Font("Arial Unicode MS", 23);
//[Category("Circle")]
//[DisplayName("Circle Font")]
//public Font CircleFont
//{
// get { return _CircleFont; }
// set { _CircleFont = value; if(_MyStepPanel != null) _MyStepPanel.Refresh(); }
//}
private Color _CircleColor = Color.Black;
[Category("Circle")]
[DisplayName("Circle Color")]

View File

@ -281,8 +281,7 @@ namespace Volian.Controls.Library
using (StepRTB srtb = new StepRTB())
{
if (srtb.FontIsFixed(font)) MySymbolFontName = "FreeMono"; // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing
//else MySymbolFontName = Volian.Base.Library.vlnFont.ProportionalSymbolFont; // "FreeSerif";
else MySymbolFontName = "Arial Unicode MS";
else MySymbolFontName = Volian.Base.Library.vlnFont.ProportionalSymbolFont; // C2017-036 get best available proportional font for symbols
}
}
else
@ -1250,8 +1249,7 @@ namespace Volian.Controls.Library
}
selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + myFont.FontFamily.Name + @";}"); //}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}}";
if (!isFixed)
//selectedRtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;}");
selectedRtfSB.Append(@"{\f1\fnil\fcharset0 Arial Unicode MS;}}{\colortbl ;\red255\green0\blue0;}");
selectedRtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;}"); // C2017-036 get best available proportional font for symbols
else
selectedRtfSB.Append(@"{\f1\fnil\fcharset0 FreeMono;}}{\colortbl ;\red255\green0\blue0;}"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing
selectedRtfSB.Append("\r\n");
@ -1330,8 +1328,7 @@ namespace Volian.Controls.Library
StringBuilder sb = new StringBuilder();
sb.Append(@"{\fonttbl{\f0\fnil\fcharset2 " + this.Font.FontFamily.Name + @";}");
if (!FontIsFixed(this.Font))
//sb.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}");
sb.Append(@"{\f1\fnil\fcharset0 Arial Unicode MS;}}");
sb.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}"); // C2017-036 get best available proportional font for symbols
else
sb.Append(@"{\f1\fnil\fcharset0 FreeMono;}}"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing
return sb.ToString();

View File

@ -869,9 +869,10 @@ namespace Volian.Controls.Library
get { return _ReadingXml; }
}
private static Regex _ReplaceVESymbFix = new Regex(@"({\\f[0-9]+[^ ]* )(FreeMono)(;})"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing
private static Regex _ReplaceArialUnicodeMS = new Regex(@"({\\f[0-9]+[^ ]* )(Arial Unicode MS)(;})");
private static Regex _ReplaceArialUnicodeMS = new Regex(@"({\\f[0-9]+[^ ]* )(" + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @")(;})"); // C2017-036 get best available proportional font for symbols
// B2017-173 VESymFix font was being replaced by the table's default font, causing empty squares for the symbols (pre FreeMono font) in tables
private static Regex _ReplaceTextFont = new Regex(@"({\\f[0-9]+[^ ]* )(?((?!FreeMono)(?!Arial Unicode MS)(?!VESymbFix))([^;]*)|(!!!!))(;})"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing
//C2017-036 Added FreeSerif which may be used if Arial Unicode MS is not available
private static Regex _ReplaceTextFont = new Regex(@"({\\f[0-9]+[^ ]* )(?((?!FreeMono)(?!FreeSerif)(?!Arial Unicode MS)(?!VESymbFix))([^;]*)|(!!!!))(;})"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing
private bool FontIsFixed(Font myFont)
{
Graphics grph = Graphics.FromHwnd(this.Handle);
@ -899,7 +900,7 @@ namespace Volian.Controls.Library
FontFamily ff = StepRTB.MyFontFamily;
if (StepRTB.MySymbolFontName != "FreeMono") // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing
str = _ReplaceVESymbFix.Replace(str, "$1" + StepRTB.MySymbolFontName + "$3");
if (StepRTB.MySymbolFontName != "Arial Unicode MS")
if (StepRTB.MySymbolFontName != Volian.Base.Library.vlnFont.ProportionalSymbolFont) // C2017-036 get best available proportional font for symbols
str = _ReplaceArialUnicodeMS.Replace(str, "$1" + StepRTB.MySymbolFontName + "$3");
str = _ReplaceTextFont.Replace(str, "$1" + ff.Name + "$4");
}
@ -909,7 +910,7 @@ namespace Volian.Controls.Library
if (FontIsFixed(vefont.WindowsFont))
str = _ReplaceArialUnicodeMS.Replace(str, "$1" + "FreeMono" + "$3"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing
else
str = _ReplaceVESymbFix.Replace(str, "$1" + "Arial Unicode MS" + "$3");
str = _ReplaceVESymbFix.Replace(str, "$1" + Volian.Base.Library.vlnFont.ProportionalSymbolFont + "$3"); // C2017-036 get best available proportional font for symbols
str = _ReplaceTextFont.Replace(str, "$1" + ff.Name + "$4");
}
// To prevent scroll bars from being flashed on/off

View File

@ -876,7 +876,7 @@ namespace Volian.Print.Library
rtb.SelectionFont = VE_Font.GetWinSysFont(DefaultFont, fnt.Style);
changed = true;
}
if ((rtb.SelectionFont.FontFamily.Name == "VESymbFix" || rtb.SelectionFont.FontFamily.Name.StartsWith("Arial Unicode")) && rtb.SelectedText.Length > 0)
if ((rtb.SelectionFont.FontFamily.Name == "VESymbFix" || rtb.SelectionFont.FontFamily.Name.StartsWith(Volian.Base.Library.vlnFont.ProportionalSymbolFont)) && rtb.SelectedText.Length > 0) // C2017-036 get best available proportional font for symbols
{
for (int j = 0; j < SymReplaceList.MaxIndex; j++)
{

View File

@ -209,10 +209,12 @@ namespace Volian.Print.Library
float[] widths = new float[] { 1f, 1f, 1f, 1f, 4f };
t.SetWidths(widths);
//t.HorizontalAlignment = 0;
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 9, 0, Color.BLACK);
iTextSharp.text.Font f4 = pdf.GetFont("Arial Unicode MS", 9, 1, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 9, 0, Color.BLACK);
iTextSharp.text.Font f4 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 9, 1, Color.BLACK);
//report title
Phrase h = new Phrase();
h.Font = f1;
@ -818,10 +820,12 @@ namespace Volian.Print.Library
float[] widths = new float[] { 1f, 1f, 1f, 1f, 4f };
t.SetWidths(widths);
//t.HorizontalAlignment = 0;
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 9, 0, Color.BLACK);
iTextSharp.text.Font f4 = pdf.GetFont("Arial Unicode MS", 9, 1, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial.
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 9, 0, Color.BLACK);
iTextSharp.text.Font f4 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 9, 1, Color.BLACK);
//report title
Phrase h = new Phrase();
h.Font = f1;
@ -1297,10 +1301,12 @@ namespace Volian.Print.Library
float[] widths = new float[] { 1f, 1f, 1f, 1f, 4f };
t.SetWidths(widths);
//t.HorizontalAlignment = 0;
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 9, 0, Color.BLACK);
iTextSharp.text.Font f4 = pdf.GetFont("Arial Unicode MS", 9, 1, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 9, 0, Color.BLACK);
iTextSharp.text.Font f4 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 9, 1, Color.BLACK);
//report title
Phrase h = new Phrase();
h.Font = f1;

View File

@ -123,10 +123,12 @@ namespace Volian.Print.Library
}
private void BuildConsistencyReport(iTextSharp.text.Document doc)
{
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 12, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 8, 0, Color.BLACK);
iTextSharp.text.Font f4 = pdf.GetFont("Arial Unicode MS", 10, 2, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 8, 0, Color.BLACK);
iTextSharp.text.Font f4 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 2, Color.BLACK);
int cols = 5;
int borders = 0;
int paddingBottom = 6;
@ -251,10 +253,12 @@ namespace Volian.Print.Library
}
private void BuildAllInConsistenciesReport(iTextSharp.text.Document doc)
{
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 12, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 8, 0, Color.BLACK);
iTextSharp.text.Font f4 = pdf.GetFont("Arial Unicode MS", 10, 2, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 8, 0, Color.BLACK);
iTextSharp.text.Font f4 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 2, Color.BLACK);
int cols = 3;
int borders = 0;
int paddingBottom = 6;

View File

@ -488,9 +488,11 @@ namespace Volian.Print.Library
//datatable.FooterRows = 1;
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0);
@ -655,7 +657,9 @@ namespace Volian.Print.Library
{
// Adjusted from 20,80 to 25,75 to account for long Procedure Numbers
float[] headerwidths = { 25, 75 };
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
BuildLibDocProcSetList();
int splitAt = FindSpitLevel()-1; // find the split level of the common path - for all procedure sets that use these library documents
string lastDvPath = "";
@ -733,8 +737,10 @@ namespace Volian.Print.Library
datatable.KeepTogether = false;
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
//cell.Colspan = 2;
@ -767,7 +773,9 @@ namespace Volian.Print.Library
private void PutROusageForProcedure(PdfPTable curTable, Dictionary<string, List<ItemInfo>> rosused, float[] headerwidths)
{
//if (rosused.Count == 0) return; // nothing to process
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
foreach (string roKey in rosused.Keys)
{
PdfPTable rotable = new PdfPTable(headerwidths);
@ -941,9 +949,11 @@ namespace Volian.Print.Library
//datatable.FooterRows = 1;
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
//cell.Colspan = 2;
@ -1028,7 +1038,9 @@ namespace Volian.Print.Library
private void PutStepListForProcedure(PdfPTable rotable, SortedDictionary<string, ItemInfo> sortedStepList)
{
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
foreach (ItemInfo itm in sortedStepList.Values)
{
string stepnum = (itm.IsSection)? itm.MyActiveSection.DisplayNumber:stepnum = BuildStepTab(itm);
@ -1040,7 +1052,9 @@ namespace Volian.Print.Library
private void PutROusageForROID(PdfPTable curTable, SortedDictionary<string, List<ItemInfo>> procRoUse, float[] headerwidths, int splitAt , bool moreThanOneProcSet)
{
SortedDictionary<string, ItemInfo> sortedStepList = new SortedDictionary<string, ItemInfo>();
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
string lastProcKey = "";
string lastProcNumTitle = "";
string lastDVPath = "";
@ -1137,9 +1151,11 @@ namespace Volian.Print.Library
//datatable.FooterRows = 1;
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0); // light blue
@ -1276,7 +1292,9 @@ namespace Volian.Print.Library
compRORpt.F10Bold = pdf.GetFont("Courier New", 10, 1, Color.BLACK);
compRORpt.F12 = pdf.GetFont("Courier New", 12, 0, Color.BLACK);
compRORpt.F12Bold = pdf.GetFont("Courier New", 12, 1, Color.BLACK);
compRORpt.F14 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
compRORpt.F14 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
compRORpt.ROFstID = _ROFSTLookup.MyDocVersionInfo.DocVersionAssociations[0].MyROFst.ROFstID;
compRORpt.Run();
}
@ -1335,9 +1353,11 @@ namespace Volian.Print.Library
PdfPTable datatable = new PdfPTable(1);
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 12, 1, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 1, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
//cell.Colspan = 2;

View File

@ -264,10 +264,12 @@ namespace Volian.Print.Library
levels.Add(4, "Outside From Transitions");
levels.Add(5, "Outside To Transitions");
Dictionary<int, iTextSharp.text.Font> fonts = new Dictionary<int, Font>();
fonts.Add(1, pdf.GetFont("Arial Unicode MS", 12, 0, Color.BLACK));
fonts.Add(2, pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK));
fonts.Add(3, pdf.GetFont("Arial Unicode MS", 8, 0, Color.BLACK));
fonts.Add(4, pdf.GetFont("Arial Unicode MS", 8, 0, Color.BLACK));
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
fonts.Add(1, pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK));
fonts.Add(2, pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK));
fonts.Add(3, pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 8, 0, Color.BLACK));
fonts.Add(4, pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 8, 0, Color.BLACK));
int lastLevel = transitionInfoList.Count > 0 ? transitionInfoList[0].Level : 0; //set level to first transition level
#region buildtable
int cols = 3;

View File

@ -328,7 +328,7 @@ namespace Volian.Print.Library
}
private float GetTextWidth(VE_Font vefont, string txt)
{
string symblFontName = (vefont.FontIsProportional()) ? "Arial Unicode MS" : "VESymbFix";
string symblFontName = (vefont.FontIsProportional()) ? Volian.Base.Library.vlnFont.ProportionalSymbolFont : "VESymbFix"; // C2017-036 get best available proportional font for symbols
// follow through in fixing an Out of Window Handles bug, use new function to see if
// we can retrieve the font from a dictionary instead a doing a New and using another
// window handle

View File

@ -4488,7 +4488,7 @@ namespace Volian.Print.Library
private string FixRTFToPrint(string rtf)
{
// Only do this if the text contains symbols.
if ((rtf.Contains("VESymbFix") || rtf.Contains("Arial Unicode")))
if ((rtf.Contains("VESymbFix") || rtf.Contains(Volian.Base.Library.vlnFont.ProportionalSymbolFont))) // C2017-036 get best available proportional font for symbols
{
// bug fix: B2017-117 was getting an out of window handles error when doing a print all for Bryon
// add the using statment to free up window handle that is created doing a New RichTextBox()
@ -4520,7 +4520,7 @@ namespace Volian.Print.Library
for (int i = 0; i < rtb.TextLength; i++)
{
rtb.Select(i, 1);
if ((rtb.SelectionFont.FontFamily.Name == "VESymbFix" || rtb.SelectionFont.FontFamily.Name.StartsWith("Arial Unicode")) && rtb.SelectedText.Length > 0)
if ((rtb.SelectedRtf.Contains("VESymbFix") || rtb.SelectedRtf.Contains(Volian.Base.Library.vlnFont.ProportionalSymbolFont)) && rtb.SelectedText.Length > 0) // C2017-036 get best available proportional font for symbols
{
for (int j = 0; j < SymReplaceList.MaxIndex; j++)
{

View File

@ -350,7 +350,7 @@ namespace Volian.Print.Library
}
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;}");
rtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;}"); // C2017-036 get best available proportional font for symbols
else
rtfSB.Append(@"{\f1\fnil\fcharset0 VESymbFix;}}{\colortbl ;\red255\green0\blue0;}");
rtfSB.Append("\r\n");
@ -380,7 +380,7 @@ namespace Volian.Print.Library
}
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;}");
rtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;}"); // C2017-036 get best available proportional font for symbols
else
rtfSB.Append(@"{\f1\fnil\fcharset0 VESymbFix;}}{\colortbl ;\red255\green0\blue0;}");
rtfSB.Append("\r\n");

View File

@ -848,8 +848,9 @@ namespace Volian.Svg.Library
}
else
{
VolianPdf.RegisterFont("Arial Unicode MS");
fs.AddFont(FontFactory.GetFont("Arial Unicode MS", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, fontSize, fontStyle, new Color(FillColor)));
// C2017-036 get best available proportional font for symbols
VolianPdf.RegisterFont(Volian.Base.Library.vlnFont.ProportionalSymbolFont);
fs.AddFont(FontFactory.GetFont(Volian.Base.Library.vlnFont.ProportionalSymbolFont, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, fontSize, fontStyle, new Color(FillColor)));
}
Phrase ph = fs.Process(text);
return ph;