24 instantiations of FontFamily
System.Drawing.Common.Tests (20)
System\Drawing\FontFamilyTests.cs (19)
19using FontFamily fontFamily = new(genericFamily); 30using FontFamily fontFamily = new(name); 40using FontFamily fontFamily = new("Code New Roman", fontCollection); 49AssertExtensions.Throws<ArgumentException>(null, () => new FontFamily(name)); 50AssertExtensions.Throws<ArgumentException>(null, () => new FontFamily(name, null)); 56AssertExtensions.Throws<ArgumentNullException>("name", () => new FontFamily(null!)); 57AssertExtensions.Throws<ArgumentNullException>("name", () => new FontFamily(null!, null)); 64AssertExtensions.Throws<ArgumentException>(null, () => new FontFamily("Times New Roman", fontCollection)); 113using FontFamily copy = new(fontFamily.Name); 179using FontFamily fontFamily = new("Code New Roman", fontCollection); 193FontFamily family = new("Code New Roman", collection); 205FontFamily family = new("Code New Roman", collection); 224using FontFamily fontFamily = new("Code New Roman", fontCollection); 234FontFamily family = new("Code New Roman", collection); 246FontFamily family = new("Code New Roman", collection); 258FontFamily family = new("Code New Roman", collection); 270FontFamily family = new("Code New Roman", collection); 287using FontFamily fontFamily1 = new("Calibri"); 288using FontFamily fontFamily2 = new("Calibri");
System\Drawing\FontTests.cs (1)
340FontFamily family = new("Code New Roman", collection);
System.Windows.Forms.Design (1)
System\Drawing\Design\FontNameEditor.cs (1)
41using FontFamily fontFamily = new(fontName);
System.Windows.Forms.Tests (3)
System\Windows\Forms\ApplicationTests.cs (3)
220Font font = new(new FontFamily("Arial"), 12f); 221Font scaled = new(new FontFamily("Arial"), 16f); 310using Font customFont = new(new FontFamily("Arial"), 12f);
225 references to FontFamily
System.Drawing (1)
System.Drawing.cs (1)
58[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.FontFamily))]
System.Drawing.Common (17)
Special\NotSupported.cs (17)
302public Font(System.Drawing.FontFamily family, float emSize) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 303public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 304public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style, System.Drawing.GraphicsUnit unit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 305public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style, System.Drawing.GraphicsUnit unit, byte gdiCharSet) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 306public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.FontStyle style, System.Drawing.GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 307public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.GraphicsUnit unit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 317public System.Drawing.FontFamily FontFamily { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 401public static System.Drawing.FontFamily[] Families { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 402public static System.Drawing.FontFamily GenericMonospace { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 403public static System.Drawing.FontFamily GenericSansSerif { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 404public static System.Drawing.FontFamily GenericSerif { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 413public static System.Drawing.FontFamily[] GetFamilies(System.Drawing.Graphics graphics) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1551public void AddString(string s, System.Drawing.FontFamily family, int style, float emSize, System.Drawing.Point origin, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1552public void AddString(string s, System.Drawing.FontFamily family, int style, float emSize, System.Drawing.PointF origin, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1553public void AddString(string s, System.Drawing.FontFamily family, int style, float emSize, System.Drawing.Rectangle layoutRect, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1554public void AddString(string s, System.Drawing.FontFamily family, int style, float emSize, System.Drawing.RectangleF layoutRect, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 3180public System.Drawing.FontFamily[] Families { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
System.Drawing.Common.Tests (196)
mono\System.Drawing\GraphicsTests.cs (1)
2014using Font font = new(FontFamily.GenericSerif, 11.0f);
mono\System.Imaging\MetafileTest.cs (1)
286Font test_font = new(FontFamily.GenericMonospace, 12);
System\Drawing\Drawing2D\GraphicsPathTests.cs (19)
995gpi.AddString("mono", FontFamily.GenericMonospace, 0, 10, new Point(10, 10), StringFormat.GenericDefault); 998gpf.AddString("mono", FontFamily.GenericMonospace, 0, 10, new PointF(10f, 10f), StringFormat.GenericDefault); 1007gpi.AddString("mono", FontFamily.GenericMonospace, 0, 10, new Rectangle(10, 10, 10, 10), StringFormat.GenericDefault); 1010gpf.AddString("mono", FontFamily.GenericMonospace, 0, 10, new RectangleF(10f, 10f, 10f, 10f), StringFormat.GenericDefault); 1019gpi.AddString("mono", FontFamily.GenericMonospace, 0, -10, new Point(10, 10), StringFormat.GenericDefault); 1023gpi.AddString("mono", FontFamily.GenericMonospace, 0, -10, new Rectangle(10, 10, 10, 10), StringFormat.GenericDefault); 1026gpf.AddString("mono", FontFamily.GenericMonospace, 0, -10, new PointF(10f, 10f), StringFormat.GenericDefault); 1030gpf.AddString("mono", FontFamily.GenericMonospace, 0, -10, new RectangleF(10f, 10f, 10f, 10f), StringFormat.GenericDefault); 1040gp1.AddString("mono", FontFamily.GenericMonospace, 0, 10, new RectangleF(10f, 10f, 10f, 10f), null); 1043gp2.AddString("mono", FontFamily.GenericMonospace, 0, 10, new RectangleF(10f, 10f, 10f, 10f), StringFormat.GenericDefault); 1046gp3.AddString("mono", FontFamily.GenericMonospace, 0, 10, new RectangleF(10f, 10f, 10f, 10f), StringFormat.GenericTypographic); 1055gpi.AddString(string.Empty, FontFamily.GenericMonospace, 0, 10, new Point(10, 10), StringFormat.GenericDefault); 1058gpi.AddString(string.Empty, FontFamily.GenericMonospace, 0, 10, new PointF(10f, 10f), StringFormat.GenericDefault); 1067gp.AddString(null, FontFamily.GenericMonospace, 0, 10, new Point(10, 10), StringFormat.GenericDefault)); 1069gp.AddString(null, FontFamily.GenericMonospace, 0, 10, new PointF(10f, 10f), StringFormat.GenericDefault)); 1071gp.AddString(null, FontFamily.GenericMonospace, 0, 10, new Rectangle(10, 10, 10, 10), StringFormat.GenericDefault)); 1073gp.AddString(null, FontFamily.GenericMonospace, 0, 10, new RectangleF(10f, 10f, 10f, 10f), StringFormat.GenericDefault)); 1636gp.AddString("mono", FontFamily.GenericMonospace, 0, 10, new Point(20, 20), StringFormat.GenericDefault); 1979gp.AddString("Mono::", FontFamily.GenericMonospace, 0, 10, new Point(10, 10), StringFormat.GenericDefault);
System\Drawing\FontFamilyTests.cs (45)
19using FontFamily fontFamily = new(genericFamily); 30using FontFamily fontFamily = new(name); 40using FontFamily fontFamily = new("Code New Roman", fontCollection); 69FontFamily fontFamily = FontFamily.GenericMonospace; 71yield return new object[] { FontFamily.GenericMonospace, FontFamily.GenericMonospace, true }; 72yield return new object[] { FontFamily.GenericMonospace, FontFamily.GenericSansSerif, false }; 74yield return new object[] { FontFamily.GenericSansSerif, new(), false }; 75yield return new object[] { FontFamily.GenericSansSerif, null, false }; 80public void Equals_Object_ReturnsExpected(FontFamily fontFamily, object other, bool expected) 99FontFamily[] families = FontFamily.Families; 100FontFamily[] familiesWithGraphics = FontFamily.GetFamilies(graphics); 111foreach (FontFamily fontFamily in families) 113using FontFamily copy = new(fontFamily.Name); 122using FontFamily fontFamily1 = FontFamily.GenericMonospace; 123using FontFamily fontFamily2 = FontFamily.GenericMonospace; 131using FontFamily fontFamily1 = FontFamily.GenericSansSerif; 132using FontFamily fontFamily2 = FontFamily.GenericSansSerif; 140using FontFamily fontFamily1 = FontFamily.GenericSerif; 141using FontFamily fontFamily2 = FontFamily.GenericSerif; 150AssertExtensions.Throws<ArgumentNullException>("graphics", () => FontFamily.GetFamilies(null)); 157using FontFamily fontFamily = FontFamily.GenericSansSerif; 179using FontFamily fontFamily = new("Code New Roman", fontCollection); 193FontFamily family = new("Code New Roman", collection); 205FontFamily family = new("Code New Roman", collection); 224using FontFamily fontFamily = new("Code New Roman", fontCollection); 234FontFamily family = new("Code New Roman", collection); 246FontFamily family = new("Code New Roman", collection); 258FontFamily family = new("Code New Roman", collection); 270FontFamily family = new("Code New Roman", collection); 279FontFamily fontFamily = FontFamily.GenericMonospace; 287using FontFamily fontFamily1 = new("Calibri"); 288using FontFamily fontFamily2 = new("Calibri");
System\Drawing\FontTests.cs (125)
13yield return new object[] { FontFamily.GenericMonospace, 1 }; 14yield return new object[] { FontFamily.GenericSerif, float.MaxValue }; 19yield return new object[] { FontFamily.GenericMonospace, 1 }; 20yield return new object[] { FontFamily.GenericSerif, float.MaxValue }; 21yield return new object[] { FontFamily.GenericSansSerif, 10 }; 26yield return new object[] { FontFamily.GenericMonospace, FontFamily.GenericSerif }; 27yield return new object[] { FontFamily.GenericSansSerif, FontFamily.GenericSerif }; 28yield return new object[] { FontFamily.GenericSansSerif, FontFamily.GenericMonospace }; 33public void Font_Equals_SameFontFamily(FontFamily fontFamily, float size) 42public void Font_Equals_DifferentFontFamily(FontFamily fontFamily1, FontFamily fontFamily2) 54FontFamily nullFamily = null; 55Assert.False(FontFamily.GenericMonospace.Equals(nullFamily)); 60public void Ctor_Family_Size(FontFamily fontFamily, float emSize) 75public void Ctor_FamilyName_Size(FontFamily fontFamily, float emSize) 90yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold }; 91yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic }; 92yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular }; 93yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout }; 94yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline }; 95yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1) }; 96yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue }; 97yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue }; 102public void Ctor_Family_Size_Style(FontFamily fontFamily, float emSize, FontStyle style) 117public void Ctor_FamilyName_Size_Style(FontFamily fontFamily, float emSize, FontStyle style) 132yield return new object[] { FontFamily.GenericMonospace, 1, GraphicsUnit.Document }; 133yield return new object[] { FontFamily.GenericSerif, 2, GraphicsUnit.Inch }; 134yield return new object[] { FontFamily.GenericSansSerif, 3, GraphicsUnit.Millimeter }; 135yield return new object[] { FontFamily.GenericSerif, 4, GraphicsUnit.Point }; 136yield return new object[] { FontFamily.GenericSerif, float.MaxValue, GraphicsUnit.Pixel }; 137yield return new object[] { FontFamily.GenericSerif, 16, GraphicsUnit.World }; 142public void Ctor_Family_Size_Unit(FontFamily fontFamily, float emSize, GraphicsUnit unit) 157public void Ctor_FamilyName_Size_Unit(FontFamily fontFamily, float emSize, GraphicsUnit unit) 172yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold, GraphicsUnit.Document }; 173yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic, GraphicsUnit.Inch }; 174yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular, GraphicsUnit.Millimeter }; 175yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout, GraphicsUnit.Point }; 176yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline, GraphicsUnit.Pixel }; 177yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1), GraphicsUnit.World }; 178yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue, GraphicsUnit.Millimeter }; 179yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue, GraphicsUnit.Millimeter }; 184public void Ctor_Family_Size_Style_Unit(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit) 199public void Ctor_FamilyName_Size_Style_Unit(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit) 214yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold, GraphicsUnit.Document, 0 }; 215yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic, GraphicsUnit.Inch, 1 }; 216yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular, GraphicsUnit.Millimeter, 255 }; 217yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout, GraphicsUnit.Point, 10 }; 218yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline, GraphicsUnit.Pixel, 10 }; 219yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1), GraphicsUnit.World, 8 }; 220yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue, GraphicsUnit.Millimeter, 127 }; 221yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue, GraphicsUnit.Millimeter, 200 }; 226public void Ctor_Family_Size_Style_Unit_GdiCharSet(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet) 241public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet) 256yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold, GraphicsUnit.Document, 0, true }; 257yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic, GraphicsUnit.Inch, 1, false }; 258yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular, GraphicsUnit.Millimeter, 255, true }; 259yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout, GraphicsUnit.Point, 10, false }; 260yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline, GraphicsUnit.Pixel, 10, true }; 261yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1), GraphicsUnit.World, 8, false }; 262yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue, GraphicsUnit.Millimeter, 127, true }; 263yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue, GraphicsUnit.Millimeter, 200, false }; 268public void Ctor_Family_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 283public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 299using FontFamily family = FontFamily.GenericMonospace; 314using FontFamily family = FontFamily.GenericSerif; 326AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10)); 327AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic)); 328AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, GraphicsUnit.Display)); 329AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display)); 330AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display, 10)); 331AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true)); 340FontFamily family = new("Code New Roman", collection); 359using FontFamily family = FontFamily.GenericSansSerif; 380using FontFamily family = FontFamily.GenericSansSerif; 394using FontFamily family = FontFamily.GenericSansSerif; 410using FontFamily family = FontFamily.GenericSansSerif; 419FontFamily family = FontFamily.GenericSansSerif; 489using FontFamily family = FontFamily.GenericSansSerif; 500using FontFamily family = FontFamily.GenericSansSerif; 516using FontFamily family = FontFamily.GenericSansSerif; 524using FontFamily family = FontFamily.GenericSansSerif; 532using FontFamily family = FontFamily.GenericMonospace; 544using FontFamily family = FontFamily.GenericSansSerif; 574using FontFamily family = FontFamily.GenericMonospace; 685using FontFamily family = FontFamily.GenericMonospace; 704using FontFamily family = FontFamily.GenericMonospace; 734using FontFamily family = FontFamily.GenericMonospace; 762using FontFamily family = FontFamily.GenericMonospace; 773using FontFamily family = FontFamily.GenericMonospace; 781using FontFamily family = FontFamily.GenericMonospace; 813using FontFamily family = FontFamily.GenericSansSerif; 826using FontFamily family = FontFamily.GenericSansSerif; 839using FontFamily family = FontFamily.GenericSansSerif; 851using FontFamily family = FontFamily.GenericSansSerif; 878using FontFamily family1 = FontFamily.GenericSansSerif; 881using FontFamily family2 = FontFamily.GenericMonospace;
System\Drawing\Text\PrivateFontCollectionTests.cs (5)
30FontFamily fontFamily = Assert.Single(fontCollection.Families); 47FontFamily fontFamily = Assert.Single(fontCollection.Families); 64FontFamily fontFamily = Assert.Single(fontCollection.Families); 84FontFamily fontFamily = Assert.Single(fontCollection.Families); 146FontFamily font = Assert.Single(fontCollection.Families);
System.Windows.Forms.Design (2)
System\Drawing\Design\FontNameEditor.cs (2)
41using FontFamily fontFamily = new(fontName); 69private static void DrawFontSample(PaintValueEventArgs e, FontFamily fontFamily, FontStyle fontStyle)
System.Windows.Forms.Tests (8)
SerializableTypesTests.cs (6)
161using (Font font = new(FontFamily.GenericSansSerif, 9f)) 191Assert.Equal(FontFamily.GenericSansSerif.Name, result.Font.FontFamily.Name); 208using (Font font = new(FontFamily.GenericSansSerif, 9f)) 239Assert.Equal(FontFamily.GenericSansSerif.Name, result.Font.FontFamily.Name); 354NodeFont = new Font(FontFamily.GenericSansSerif, 9f) 380Assert.Equal(FontFamily.GenericSansSerif.Name, result.NodeFont.FontFamily.Name);
System\Windows\Forms\TreeViewTests.cs (2)
2702Font font = new(FontFamily.GenericSansSerif, 100); 2710Font smallFont = new(FontFamily.GenericSansSerif, 2);
WindowsFormsIntegration (1)
System\Windows\Integration\Convert.cs (1)
221internal static SWM.FontFamily ToSystemWindowsFontFamily(SD.FontFamily sdFamily)