2010-06-03 Jb Evain <jbevain@novell.com>
[mcs.git] / class / System.Drawing / System.Drawing / SystemFonts.cs
blob381349d9440b66ccfd71089e3eb5ef8329ade127
1 //
2 // Copyright (C) 2005, 2007 Novell, Inc (http://www.novell.com)
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining
5 // a copy of this software and associated documentation files (the
6 // "Software"), to deal in the Software without restriction, including
7 // without limitation the rights to use, copy, modify, merge, publish,
8 // distribute, sublicense, and/or sell copies of the Software, and to
9 // permit persons to whom the Software is furnished to do so, subject to
10 // the following conditions:
12 // The above copyright notice and this permission notice shall be
13 // included in all copies or substantial portions of the Software.
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 // Authors:
24 // Jordi Mas i Hernandez <jordimash@gmail.com>
25 // Sebastien Pouliot <sebastien@ximian.com>
28 #if NET_2_0
30 namespace System.Drawing {
32 public sealed class SystemFonts {
34 static SystemFonts ()
38 private SystemFonts()
42 public static Font GetFontByName (string systemFontName)
44 if (systemFontName == "CaptionFont")
45 return CaptionFont;
47 if (systemFontName == "DefaultFont")
48 return DefaultFont;
50 if (systemFontName == "DialogFont")
51 return DialogFont;
53 if (systemFontName == "IconTitleFont")
54 return IconTitleFont;
56 if (systemFontName == "MenuFont")
57 return MenuFont;
59 if (systemFontName == "MessageBoxFont")
60 return MessageBoxFont;
62 if (systemFontName == "SmallCaptionFont")
63 return SmallCaptionFont;
65 if (systemFontName == "StatusFont")
66 return StatusFont;
68 return null;
71 public static Font CaptionFont {
72 get { return new Font ("Microsoft Sans Serif", 11, "CaptionFont"); }
75 public static Font DefaultFont {
76 get { return new Font ("Microsoft Sans Serif", 8.25f, "DefaultFont"); }
79 public static Font DialogFont {
80 get { return new Font ("Tahoma", 8, "DialogFont"); }
83 public static Font IconTitleFont {
84 get { return new Font ("Microsoft Sans Serif", 11, "IconTitleFont"); }
87 public static Font MenuFont {
88 get { return new Font ("Microsoft Sans Serif", 11, "MenuFont"); }
91 public static Font MessageBoxFont {
92 get { return new Font ("Microsoft Sans Serif", 11, "MessageBoxFont"); }
95 public static Font SmallCaptionFont {
96 get { return new Font ("Microsoft Sans Serif", 11, "SmallCaptionFont"); }
99 public static Font StatusFont {
100 get { return new Font ("Microsoft Sans Serif", 11, "StatusFont"); }
105 #endif