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