Use method from VE_Font to get a font reference (uses dictionary so redundant Window Handles are not created) B2017-117
Add a Using statement when we temporarily create a RichTextBox to ensure the Window Handle is free’d. Also use method from VE_Font to get a font reference (uses dictionary so redundant Window Handles are not created) B2017-117
This commit is contained in:
@@ -83,8 +83,13 @@ namespace Volian.Print.Library
|
||||
}
|
||||
private float GetTextWidth(VE_Font vefont, string txt, string symblFontName)
|
||||
{
|
||||
System.Drawing.Font font = new System.Drawing.Font(vefont.Family, (float)vefont.Size, GetSysFontStyle(vefont));
|
||||
System.Drawing.Font symbFont = new System.Drawing.Font(symblFontName, (float)vefont.Size);
|
||||
// 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 B2017-117
|
||||
//System.Drawing.Font font = new System.Drawing.Font(vefont.Family, (float)vefont.Size, GetSysFontStyle(vefont));
|
||||
//System.Drawing.Font symbFont = new System.Drawing.Font(symblFontName, (float)vefont.Size);
|
||||
System.Drawing.Font font = VE_Font.GetWinSysFont(vefont.Family, (float)vefont.Size, GetSysFontStyle(vefont));
|
||||
System.Drawing.Font symbFont = VE_Font.GetWinSysFont(symblFontName, (float)vefont.Size);
|
||||
iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font);
|
||||
iTextSharp.text.Font iSymblFont = Volian.Svg.Library.VolianPdf.GetFont(symbFont);
|
||||
float w = 0;
|
||||
@@ -227,7 +232,11 @@ namespace Volian.Print.Library
|
||||
FontStyle style = FontStyle.Regular;
|
||||
if ((vFont.Style & E_Style.Bold) > 0) style |= FontStyle.Bold;
|
||||
if ((vFont.Style & E_Style.Italics) > 0) style |= FontStyle.Italic;
|
||||
vFont.WindowsFont = new System.Drawing.Font(vFont.Family, (float)vFont.Size, style);
|
||||
// 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 B2017-117
|
||||
//vFont.WindowsFont = new System.Drawing.Font(vFont.Family, (float)vFont.Size, style);
|
||||
vFont.WindowsFont = VE_Font.GetWinSysFont(vFont.Family, (float)vFont.Size, style);
|
||||
int indxC = origTab.IndexOf(":");
|
||||
origTab = @"\ul " + origTab.Substring(0, indxC) + @"\ulnone" + origTab.Substring(indxC);
|
||||
}
|
||||
@@ -240,7 +249,11 @@ namespace Volian.Print.Library
|
||||
FontStyle style = FontStyle.Regular;
|
||||
if ((vFont.Style & E_Style.Bold) > 0) style |= FontStyle.Bold;
|
||||
if ((vFont.Style & E_Style.Italics) > 0) style |= FontStyle.Italic;
|
||||
vFont.WindowsFont = new System.Drawing.Font(vFont.Family, (float)vFont.Size, style);
|
||||
// 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 B2017-117
|
||||
//vFont.WindowsFont = new System.Drawing.Font(vFont.Family, (float)vFont.Size, style);
|
||||
vFont.WindowsFont = VE_Font.GetWinSysFont(vFont.Family, (float)vFont.Size, style);
|
||||
int indxC = origTab.IndexOf(ut.Text);
|
||||
string prefix = ((vFont.Style & E_Style.Bold) > 0) ? @"\b\ul " : @"\ul ";
|
||||
string suffix = ((vFont.Style & E_Style.Bold) > 0) ? @"\b0\ulnone " : @"\ulnone ";
|
||||
@@ -323,7 +336,11 @@ namespace Volian.Print.Library
|
||||
string txt = Text;
|
||||
if (alignAsIfBulleted)
|
||||
txt += myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
||||
System.Drawing.Font font = new System.Drawing.Font(MyFont.Family, (float)MyFont.Size);
|
||||
// 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 B2017-117
|
||||
//System.Drawing.Font font = new System.Drawing.Font(MyFont.Family, (float)MyFont.Size);
|
||||
System.Drawing.Font font = VE_Font.GetWinSysFont(MyFont.Family, (float)MyFont.Size);
|
||||
iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font);
|
||||
float w = iFont.BaseFont.GetWidthPointKerned(txt, (float)MyFont.Size);
|
||||
Width = w;
|
||||
|
Reference in New Issue
Block a user