From 4dc9a5e13d67ebcae59f9323ef06fbce7c07272a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Wed, 6 Oct 2010 19:18:07 +0000 Subject: [PATCH] Fixed Issue 129. --- GUI/SensorGadget.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/GUI/SensorGadget.cs b/GUI/SensorGadget.cs index 363ad53..ee079c9 100644 --- a/GUI/SensorGadget.cs +++ b/GUI/SensorGadget.cs @@ -305,8 +305,13 @@ namespace OpenHardwareMonitor.GUI { } private Font CreateFont(float size, FontStyle style) { - return new Font(SystemFonts.MessageBoxFont.FontFamily, size, - style); + try { + return new Font(SystemFonts.MessageBoxFont.FontFamily, size, style); + } catch (ArgumentException) { + // if the style is not supported, fall back to the original one + return new Font(SystemFonts.MessageBoxFont.FontFamily, size, + SystemFonts.MessageBoxFont.Style); + } } private void SetFontSize(float size) {