From 08e7041bcf7706e2fb855959117593fc9e520e07 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Fri, 18 Aug 2017 10:02:17 +0200 Subject: [PATCH] EnhancedPrintDocument : SW crash prevented with default configuration of fonts. --- Results/Output/Printers/Enhanced/EnhancedPrintDocument.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Results/Output/Printers/Enhanced/EnhancedPrintDocument.cs b/Results/Output/Printers/Enhanced/EnhancedPrintDocument.cs index 722295e37..2e53281fa 100644 --- a/Results/Output/Printers/Enhanced/EnhancedPrintDocument.cs +++ b/Results/Output/Printers/Enhanced/EnhancedPrintDocument.cs @@ -85,9 +85,9 @@ namespace Results.Output.Printers.Enhanced footer = string.IsNullOrEmpty(cfg.Footer) ? string.Empty : cfg.Footer.Replace("~", Environment.NewLine); /// Initialize fonts - titleFont = new Font(cfg.TitFntFml, cfg.TitFntSz, (FontStyle)cfg.TitFntSty); - headerFont = new Font(cfg.HdrFntFml, cfg.HdrFntSz, (FontStyle)cfg.HdrFntSty); - font = new Font(cfg.BodyFntFml, cfg.BodyFntSz, (FontStyle)cfg.BodyFntSty); + titleFont = new Font((cfg.TitFntFml != null ? cfg.TitFntFml : "Arial"), (cfg.TitFntSz > 0 ? cfg.TitFntSz : 10), (FontStyle)cfg.TitFntSty); + headerFont = new Font((cfg.HdrFntFml != null ? cfg.HdrFntFml : "Arial"), (cfg.HdrFntSz > 0 ? cfg.HdrFntSz : 10), (FontStyle)cfg.HdrFntSty); + font = new Font((cfg.BodyFntFml != null ? cfg.BodyFntFml : "Arial"), (cfg.BodyFntSz > 0 ? cfg.BodyFntSz : 10), (FontStyle)cfg.BodyFntSty); /// Set print area size and margins (in dots using 100 dpi) DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);