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:
2017-06-12 17:58:30 +00:00
parent 74898f5e4e
commit 0d0bd7661b
6 changed files with 122 additions and 61 deletions

View File

@@ -216,8 +216,13 @@ namespace Volian.Print.Library
{
// use bigger font if revnum msg
iTextSharp.text.Font iFont = _IsRev? Volian.Svg.Library.VolianPdf.GetFont(new System.Drawing.Font("Letter Gothic", 10F)):
Volian.Svg.Library.VolianPdf.GetFont(new System.Drawing.Font("Letter Gothic", 5.5F));
// 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 B21017-117
//iTextSharp.text.Font iFont = _IsRev? Volian.Svg.Library.VolianPdf.GetFont(new System.Drawing.Font("Letter Gothic", 10F)):
// Volian.Svg.Library.VolianPdf.GetFont(new System.Drawing.Font("Letter Gothic", 5.5F));
iTextSharp.text.Font iFont = _IsRev? Volian.Svg.Library.VolianPdf.GetFont(VE_Font.GetWinSysFont("Letter Gothic", 10F)):
Volian.Svg.Library.VolianPdf.GetFont(VE_Font.GetWinSysFont("Letter Gothic", 5.5F));
Chunk chk = new Chunk(vcbm.Message.IndexOf(@"\n") > -1 ? vcbm.Message.Substring(0, vcbm.Message.IndexOf(@"\n")) : vcbm.Message, iFont);
Paragraph myparagraph = new Paragraph(chk);