GUI/SensorGadget.cs
changeset 215 79e9a77f6a71
parent 202 551243a66b32
child 217 d93ddd6ca0af
     1.1 --- a/GUI/SensorGadget.cs	Wed Oct 06 11:34:54 2010 +0000
     1.2 +++ b/GUI/SensorGadget.cs	Wed Oct 06 19:18:07 2010 +0000
     1.3 @@ -305,8 +305,13 @@
     1.4      }
     1.5  
     1.6      private Font CreateFont(float size, FontStyle style) {
     1.7 -      return new Font(SystemFonts.MessageBoxFont.FontFamily, size,
     1.8 -        style);
     1.9 +      try {
    1.10 +        return new Font(SystemFonts.MessageBoxFont.FontFamily, size, style);
    1.11 +      } catch (ArgumentException) {
    1.12 +        // if the style is not supported, fall back to the original one
    1.13 +        return new Font(SystemFonts.MessageBoxFont.FontFamily, size, 
    1.14 +          SystemFonts.MessageBoxFont.Style);
    1.15 +      }
    1.16      }
    1.17  
    1.18      private void SetFontSize(float size) {