352 instantiations of Font
Accessibility_Core_App (1)
PrintingControls.cs (1)
22
Font font =
new
("Times New Roman", 30);
PresentationUI (3)
MS\Internal\Documents\RMEnrollmentPage1.Designer.cs (1)
150
_instructionlabel.Font = new System.Drawing.
Font
("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
232
Font columnHeaderFont = new System.Drawing.
Font
(Font, System.Drawing.FontStyle.Bold);
MS\Internal\Documents\SigningDialog.cs (1)
264
_signerlabel.Font = new
Font
(System.Drawing.SystemFonts.DialogFont, System.Drawing.SystemFonts.DialogFont.Style | FontStyle.Bold);
System.Drawing.Common.Tests (92)
mono\System.Drawing\GraphicsTests.cs (2)
48
_font = new
Font
("Arial", 12);
2011
using Font font =
new
(FontFamily.GenericSerif, 11.0f);
mono\System.Imaging\MetafileTest.cs (1)
286
Font test_font =
new
(FontFamily.GenericMonospace, 12);
System\Drawing\FontConverterTests.cs (9)
100
Font font =
new
($"Courier New", 8.25f, FontStyle.Regular, GraphicsUnit.Point);
139
{ new
Font
("Arial", 12.0f), 2 },
140
{ new
Font
("Arial", 12.0f, FontStyle.Regular), 2 },
141
{ new
Font
("Courier", 8.0f, FontStyle.Italic), 3 },
142
{ new
Font
("Courier", 1.0f, FontStyle.Regular, GraphicsUnit.Point), 2 },
143
{ new
Font
("Courier", 1.0f, FontStyle.Regular, GraphicsUnit.Inch), 4 },
144
{ new
Font
("Courier", 1.0f, FontStyle.Regular, GraphicsUnit.Pixel, gdiCharSet: 2 /* SYMBOL_CHARSET */), 5 },
145
{ new
Font
("Courier", 1.0f, FontStyle.Regular, GraphicsUnit.Point, gdiCharSet: 1 /* DEFAULT_CHARSET */), 2 },
146
{ new
Font
("Courier", 1.0f, FontStyle.Regular, GraphicsUnit.Pixel, gdiCharSet: 1 /* DEFAULT_CHARSET */, gdiVerticalFont: true), 6 },
System\Drawing\FontTests.cs (80)
35
using Font font1 =
new
(fontFamily, size);
36
using Font font2 =
new
(fontFamily, size);
44
using Font font1 =
new
(fontFamily1, 9);
45
using Font font2 =
new
(fontFamily2, 9);
64
using Font font =
new
(fontFamily, emSize);
79
using Font font =
new
(fontFamily.Name, emSize);
106
using Font font =
new
(fontFamily, emSize, style);
121
using Font font =
new
(fontFamily.Name, emSize, style);
146
using Font font =
new
(fontFamily, emSize, unit);
161
using Font font =
new
(fontFamily.Name, emSize, unit);
188
using Font font =
new
(fontFamily, emSize, style, unit);
203
using Font font =
new
(fontFamily.Name, emSize, style, unit);
230
using Font font =
new
(fontFamily, emSize, style, unit, gdiCharSet);
245
using Font font =
new
(fontFamily.Name, emSize, style, unit, gdiCharSet);
272
using Font font =
new
(fontFamily, emSize, style, unit, gdiCharSet, gdiVerticalFont);
287
using Font font =
new
(fontFamily.Name, emSize, style, unit, gdiCharSet, gdiVerticalFont);
300
using Font font =
new
($"@{family.Name}", 10);
308
Assert.Throws<NullReferenceException>(() => new
Font
(null, FontStyle.Regular));
315
Font font =
new
(family, 10);
318
using Font copy =
new
(font, FontStyle.Italic);
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));
343
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family, 10));
344
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family, 10, FontStyle.Italic));
345
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family, 10, GraphicsUnit.Display));
346
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family, 10, FontStyle.Italic, GraphicsUnit.Display));
347
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family, 10, FontStyle.Italic, GraphicsUnit.Display, 10));
348
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family, 10, FontStyle.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true));
360
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family, emSize));
361
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family.Name, emSize));
362
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family, emSize, FontStyle.Italic));
363
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family.Name, emSize, FontStyle.Italic));
364
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family, emSize, GraphicsUnit.Document));
365
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family.Name, emSize, GraphicsUnit.Document));
366
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family, emSize, FontStyle.Italic, GraphicsUnit.Document));
367
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document));
368
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family, emSize, FontStyle.Italic, GraphicsUnit.Document, 10));
369
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document, 10));
370
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family, emSize, FontStyle.Italic, GraphicsUnit.Document, 10, gdiVerticalFont: true));
371
AssertExtensions.Throws<ArgumentException>("emSize", () => new
Font
(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document, 10, gdiVerticalFont: true));
381
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family, 10, unit));
382
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family.Name, 10, unit));
383
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family, 10, FontStyle.Italic, unit));
384
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family.Name, 10, FontStyle.Italic, unit));
385
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family, 10, FontStyle.Italic, unit, 10));
386
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family.Name, 10, FontStyle.Italic, unit, 10));
387
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family, 10, FontStyle.Italic, unit, 10, gdiVerticalFont: true));
388
AssertExtensions.Throws<ArgumentException>(null, () => new
Font
(family.Name, 10, FontStyle.Italic, unit, 10, gdiVerticalFont: true));
395
using Font font =
new
(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
411
Font font =
new
(family, 10);
420
Font font =
new
(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
423
yield return new object[] { font.Clone(), new
Font
(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true), false };
424
yield return new object[] { font.Clone(), new
Font
(family, 9, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true), false };
425
yield return new object[] { font.Clone(), new
Font
(family, 10, FontStyle.Italic, GraphicsUnit.Millimeter, 10, gdiVerticalFont: true), false };
426
yield return new object[] { font.Clone(), new
Font
(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 9, gdiVerticalFont: true), false };
427
yield return new object[] { font.Clone(), new
Font
(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: false), false };
429
yield return new object[] { new
Font
(family, 10), new(), false };
430
yield return new object[] { new
Font
(family, 10), null, false };
490
using Font font =
new
(family, 10);
501
using Font font =
new
(family, 10);
517
using Font font =
new
(family, 10);
525
using Font font =
new
(family, 10);
533
using Font font =
new
(family, 10);
547
Font font =
new
(family, 10);
686
using Font font =
new
(family, 10, unit);
705
using Font font =
new
(family, 10, fontStyle, GraphicsUnit.Point, gdiCharSet, gdiVerticalFont);
735
using Font font =
new
(family, 10);
763
using Font font =
new
(family, 10);
774
using Font font =
new
(family, 10);
782
using Font font =
new
(family, 10);
814
using Font font =
new
(family, 10);
827
using Font font =
new
(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
842
Font font =
new
(family, 10);
852
using Font font =
new
(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
879
using Font font1 =
new
(family1, 1, FontStyle.Bold, GraphicsUnit.Point);
882
using Font font2 =
new
(family2, 1, FontStyle.Bold, GraphicsUnit.Point);
System.Windows.Forms (13)
System\Windows\Forms\ActiveX\AxHost.cs (2)
3712
:
new
(f.Name, f.SizeInPoints, f.Style, GraphicsUnit.Point, f.GdiCharSet, f.GdiVerticalFont);
3795
return new
Font
(
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
530
using Font alwaysUnderlined = new
Font
(Font, Font.Style | FontStyle.Underline);
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (3)
222
hoverLinkFont = new
Font
(f, style);
237
hoverLinkFont = new
Font
(f, hoverStyle);
249
linkFont = new
Font
(f, linkStyle);
System\Windows\Forms\Controls\ListView\ListView.cs (2)
2607
_odCacheFont = new
Font
(_odCacheFont, FontStyle.Bold);
2794
subItemFont = new
Font
(item.SubItems[0].Font, FontStyle.Underline);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (1)
232
_titleLabel.Font =
new
(Font, FontStyle.Bold);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
1304
public Font GetBoldFont() => _boldFont ??= new
Font
(Font, FontStyle.Bold);
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (2)
144
result = new
Font
(result.FontFamily, MinSize, result.Style, GraphicsUnit.Point);
149
result = new
Font
(result.FontFamily, MaxSize, result.Style, GraphicsUnit.Point);
System\Windows\Forms\Rendering\ControlPaint.cs (1)
2062
=>
new
(
System.Windows.Forms.Design (10)
System\ComponentModel\Design\ByteViewer.cs (2)
37
private static readonly Font s_addressFont =
new
("Microsoft Sans Serif", 8.0f);
38
private static readonly Font s_hexDumpFont =
new
("Courier New", 8.0f);
System\ComponentModel\Design\DesignerActionPanel.HeaderLine.cs (1)
16
protected override Font GetFont() =>
new
(ActionPanel.Font, FontStyle.Bold);
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (1)
94
_titleLabel.Font = new
Font
(ActionPanel.Font, FontStyle.Bold);
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
305
replaceFont = new
Font
(fallBackFontName, base.Font.Size, base.Font.Style);
System\Drawing\Design\FontNameEditor.cs (1)
72
using Font font =
new
(fontFamily, fontSize, fontStyle, GraphicsUnit.Pixel);
System\Windows\Forms\Design\ControlDesigner.cs (1)
2258
using (Font errorFont =
new
(
System\Windows\Forms\Design\SplitterPanelDesigner.cs (1)
191
using Font drawFont =
new
("Arial", 8);
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
334
label.Font = new
Font
(label.Font, FontStyle.Bold);
System\Windows\Forms\Design\TabOrder.cs (1)
49
_tabFont = new
Font
(_tabFont, FontStyle.Bold);
System.Windows.Forms.Design.Tests (2)
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (2)
16
Font expectedFont = new
Font
("Arial", 12.0f);
21
contextMenuStrip.Font = new
Font
("Times New Roman", 10.0f, FontStyle.Italic);
System.Windows.Forms.Primitives (1)
System\Windows\Forms\FontExtensions.cs (1)
22
:
new
(
System.Windows.Forms.Primitives.Tests (5)
System\Windows\Forms\Automation\UiaTextRangeTests.cs (5)
531
using Font font =
new
("Segoe UI", 9, FontStyle.Regular);
618
using Font font =
new
("Arial", 9f, FontStyle.Regular);
711
using Font font =
new
("Arial", 9f, FontStyle.Regular);
793
using Font font =
new
("Arial", 9f, FontStyle.Regular);
1200
using Font font =
new
("Arial", fontSize, FontStyle.Regular);
System.Windows.Forms.Tests (184)
CheckedListBoxTests.cs (1)
408
yield return new object[] { new
Font
("Arial", 8.25f), new Rectangle(10, 20, 30, 40), 1, DrawItemState.Default, Color.Red, Color.Blue };
SerializableTypesTests.cs (3)
161
using (Font font =
new
(FontFamily.GenericSansSerif, 9f))
208
using (Font font =
new
(FontFamily.GenericSansSerif, 9f))
354
NodeFont = new
Font
(FontFamily.GenericSansSerif, 9f)
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);
System\Windows\Forms\AxHostTests.cs (6)
1446
using Font font =
new
("Arial", 10);
1475
using Font font =
new
("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10);
1509
using Font font =
new
("Arial", 10, unit);
1522
using Font font =
new
("Arial", 10);
1544
using Font font =
new
("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10);
1570
using Font font =
new
("Arial", 10, unit);
System\Windows\Forms\ButtonTests.cs (2)
689
using Font font =
new
("Arial", 100f);
719
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\ComboBoxTests.cs (1)
1017
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (1)
77
using Font newFont =
new
(font.Name, 20.0f);
System\Windows\Forms\ContainerControlTests.cs (1)
460
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\Control.ActiveXFontMarshallerTests.cs (1)
22
using Font font =
new
("Arial", 11.0f, GraphicsUnit.Point);
System\Windows\Forms\ControlTests.ControlCollection.cs (8)
649
Font font =
new
("Arial", 8.25f);
799
Font font =
new
("Arial", 8.25f);
952
Font font =
new
("Arial", 8.25f);
1025
Font font =
new
("Arial", 8.25f);
2352
Font font =
new
("Arial", 8.25f);
2496
Font font =
new
("Arial", 8.25f);
2628
Font font =
new
("Arial", 8.25f);
2692
Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ControlTests.Handlers.cs (3)
1784
using Font childFont1 =
new
("Arial", 1);
1785
using Font childFont2 =
new
("Arial", 2);
4488
Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ControlTests.Methods.cs (1)
6438
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ControlTests.Properties.cs (18)
4797
using Font font1 =
new
("Arial", 8.25f);
4798
using Font font2 =
new
("Arial", 8.5f);
4817
using Font font1 =
new
("Arial", 8.25f);
4818
using Font font2 =
new
("Arial", 8.5f);
4855
Font font =
new
("Arial", 8.25f);
4882
Font font =
new
("Arial", 8.25f);
4894
Font = new
Font
("Arial", 1)
4915
Font = new
Font
("Arial", 1)
4934
yield return new object[] { userPaint, new
Font
("Arial", 8.25f), 1 };
4977
yield return new object[] { userPaint, new
Font
("Arial", 8.25f) };
4988
Font = new
Font
("Arial", 1)
5033
using Font font1 =
new
("Arial", 8.25f);
5096
using Font font1 =
new
("Arial", 8.25f);
5149
using Font childFont1 =
new
("Arial", 1);
5150
using Font childFont2 =
new
("Arial", 1);
5189
using Font font1 =
new
("Arial", 8.25f);
5246
using Font font =
new
("Arial", 8.25f);
5271
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\DataGridViewRowTests.cs (1)
2022
using Font font =
new
("Times New Roman", 12);
System\Windows\Forms\DataGridViewTests.cs (7)
2320
using Font formFont1 =
new
("Times New Roman", 12F, FontStyle.Regular);
2326
using Font customFont1 =
new
("Tahoma", 8.25F, FontStyle.Regular);
2327
using Font customFont2 =
new
("Consolas", 14F, FontStyle.Italic);
2328
using Font customFont3 =
new
("Arial", 9F, FontStyle.Bold);
2369
using Font formFont2 =
new
("Arial Black", 10F, FontStyle.Italic);
3507
using Font font1 =
new
("Arial", 12);
3508
using Font font2 =
new
("Times New Roman", 14);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
104
using Font formFont1 =
new
("Times New Roman", 12F, FontStyle.Regular);
111
using Font customCellStyleFont =
new
("Tahoma", 8.25F, FontStyle.Regular);
112
using Font customColumnHeaderFont =
new
("Consolas", 14F, FontStyle.Italic);
113
using Font customRowHeaderFont =
new
("Arial", 9F, FontStyle.Bold);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (4)
548
using Font font =
new
("Arial", 8.25f);
735
using Font oldFont =
new
("Arial", 8.25f);
757
using Font font =
new
("Arial", 8.25f);
945
using Font oldFont =
new
("Arial", 8.25f);
System\Windows\Forms\DateTimePickerTests.cs (2)
284
using (Font expectedFont =
new
("Arial", 8.25f))
290
using (Font differentFont =
new
("Times New Roman", 10f))
System\Windows\Forms\FontCacheTests.cs (1)
16
fonts[i] = new
Font
("Arial", i + 6);
System\Windows\Forms\FontDialogTests.cs (10)
229
using Font font =
new
("Arial", 8.25f);
241
using Font font =
new
("Arial", 8.25f);
259
using Font font =
new
("Arial", 8.25f);
277
using Font font =
new
("Arial", 8.25f);
291
Font font =
new
("Arial", 8.25f);
314
using Font font =
new
("Arial", 8.25f);
335
using Font font =
new
("Arial", 8.25f);
352
using Font font =
new
("Arial", 8.25f);
583
using Font font =
new
("Arial", 8.25f);
697
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\GroupBoxTests.cs (3)
576
using Font font =
new
("Arial", 8.25f);
589
using Font font =
new
("Arial", 8.25f);
604
using Font newFont =
new
(originalFont.FontFamily, originalFont.Size + 5, originalFont.Style);
System\Windows\Forms\ListBoxTests.cs (6)
1045
yield return new object[] { integralHeight, new
Font
("Arial", 8.25f) };
1105
yield return new object[] { true, new
Font
("Arial", 8.25f), 1, 1 };
1106
yield return new object[] { false, new
Font
("Arial", 8.25f), 1, 2 };
1151
yield return new object[] { true, new
Font
("Arial", 8.25f), 1, 1 };
1152
yield return new object[] { false, new
Font
("Arial", 8.25f), 2, 3 };
1210
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\PictureBoxTests.cs (1)
500
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\ProgressBarTests.cs (1)
505
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\RichTextBoxTests.cs (19)
1372
using Font oldValue =
new
("Arial", 1);
1394
using Font oldValue =
new
("Arial", 1);
1417
yield return new object[] { userPaint, new
Font
("Arial", 8.25f), 1 };
1497
yield return new object[] { userPaint, new
Font
("Arial", 8.25f) };
1506
using Font oldValue =
new
("Arial", 1);
1544
using Font oldValue =
new
("Arial", 1);
1604
using (Font font =
new
(familyName, emSize, style, unit, gdiCharSet))
1647
using Font font1 =
new
("Arial", 8.25f);
4822
using Font value = hasStyle ? new
Font
(fontName, fontSize, fontStyle, units, gdiCharSet) : new
Font
(fontName, fontSize);
4849
using Font value = hasStyle ? new
Font
(fontName, fontSize, fontStyle, units, gdiCharSet) : new
Font
(fontName, fontSize);
4886
yield return new object[] { new
Font
("Arial", 8.25f) };
4915
yield return new object[] { new
Font
("Arial", 8.25f), 165, 0 };
4916
yield return new object[] { new
Font
("Arial", 8.25f, FontStyle.Bold), 165, CFE_EFFECTS.CFE_BOLD };
4917
yield return new object[] { new
Font
("Arial", 8.25f, FontStyle.Italic), 165, CFE_EFFECTS.CFE_ITALIC };
4918
yield return new object[] { new
Font
("Arial", 8.25f, FontStyle.Strikeout), 165, CFE_EFFECTS.CFE_STRIKEOUT };
4919
yield return new object[] { new
Font
("Arial", 8.25f, FontStyle.Underline), 165, CFE_EFFECTS.CFE_UNDERLINE };
4920
yield return new object[] { new
Font
("Arial", 8.25f, FontStyle.Bold | FontStyle.Italic | FontStyle.Regular | FontStyle.Strikeout | FontStyle.Underline, GraphicsUnit.Point, 10), 165, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ITALIC | CFE_EFFECTS.CFE_UNDERLINE | CFE_EFFECTS.CFE_STRIKEOUT };
System\Windows\Forms\ScrollBarTests.cs (1)
513
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\SplitterTests.cs (1)
765
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\ToolStripButtonTests.cs (3)
1273
using Font font =
new
("Arial", 8.25f);
1364
using Font font =
new
("Arial", 8.25f);
1463
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ToolStripControlHostTests.cs (5)
615
using Font value =
new
("Arial", 8.25f);
958
yield return new object[] { displayStyle, new
Font
("Arial", 8.25f) };
991
using Font font =
new
("Arial", 8.25f);
1003
using Font font =
new
("Arial", 8.25f);
1043
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ToolStripDropDownTests.cs (9)
1483
using Font font1 =
new
("Arial", 8.25f);
1484
using Font font2 =
new
("Arial", 8.5f);
1504
using Font font1 =
new
("Arial", 8.25f);
1505
using Font font2 =
new
("Arial", 8.5f);
1555
using Font font1 =
new
("Arial", 8.25f);
1602
using Font font1 =
new
("Arial", 8.25f);
1643
using Font childFont1 =
new
("Arial", 1);
1644
using Font childFont2 =
new
("Arial", 1);
1667
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\ToolStripItemTests.cs (15)
2932
using Font font =
new
("Arial", 8.25f);
2950
using Font font =
new
("Arial", 8.25f);
2967
yield return new object[] { displayStyle, new
Font
("Arial", 8.25f) };
2995
yield return new object[] { ToolStripItemDisplayStyle.None, new
Font
("Arial", 8.25f), 0 };
2996
yield return new object[] { ToolStripItemDisplayStyle.Text, new
Font
("Arial", 8.25f), 1 };
2997
yield return new object[] { ToolStripItemDisplayStyle.Image, new
Font
("Arial", 8.25f), 0 };
2998
yield return new object[] { ToolStripItemDisplayStyle.ImageAndText, new
Font
("Arial", 8.25f), 1 };
3182
using Font font =
new
("Arial", 8.25f);
3211
using Font font =
new
("Arial", 8.25f);
12263
item.Font = new
Font
("Arial", 8.25f);
12301
item.Font = new
Font
("Arial", 8.25f);
12362
item.Font = new
Font
("Arial", 8.25f);
12404
item.Font = new
Font
("Arial", 8.25f);
12454
item.Font = new
Font
("Arial", 8.25f);
14117
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ToolStripLabelTests.cs (5)
172
accessor._linkFont = new
Font
("Arial", 10);
173
accessor._hoverLinkFont = new
Font
("Arial", 10, FontStyle.Underline);
185
accessor._linkFont = new
Font
("Arial", 10);
186
accessor._hoverLinkFont = new
Font
("Arial", 10, FontStyle.Underline);
188
_toolStripLabel.Font = new
Font
("Times New Roman", 12);
System\Windows\Forms\ToolStripMenuItemTests.cs (1)
286
Font = new
Font
("Arial", 12),
System\Windows\Forms\ToolStripSeparatorTests.cs (1)
312
yield return new object[] { displayStyle, new
Font
("Arial", 8.25f) };
System\Windows\Forms\ToolStripTests.cs (13)
1399
using Font font1 =
new
("Arial", 8.25f);
1400
using Font font2 =
new
("Arial", 8.5f);
1420
using Font font1 =
new
("Arial", 8.25f);
1421
using Font font2 =
new
("Arial", 8.5f);
1471
using Font font1 =
new
("Arial", 8.25f);
1518
using Font font1 =
new
("Arial", 8.25f);
1559
using Font childFont1 =
new
("Arial", 1);
1560
using Font childFont2 =
new
("Arial", 1);
1583
using Font font1 =
new
("Arial", 8.25f);
1625
using Font font =
new
("Microsoft Sans Serif", 8.25f);
1645
using Font font =
new
("Microsoft Sans Serif", 8.25f);
5309
using Font childFont1 =
new
("Arial", 1);
5310
using Font childFont2 =
new
("Arial", 2);
System\Windows\Forms\ToolStripTextBoxTests.cs (1)
188
_toolStripTextBox.Font = new
Font
("Arial", 8.25f);
System\Windows\Forms\TreeNodeTests.cs (5)
2833
yield return new object[] { new
Font
("Arial", 8.25f), 1 };
2871
using Font oldValue =
new
("Arial", 1);
2890
using Font oldValue =
new
("Arial", 1);
2910
yield return new object[] { new
Font
("Arial", 8.25f), 1 };
2918
using Font oldValue =
new
("Arial", 1);
System\Windows\Forms\TreeViewTests.cs (2)
2702
Font font =
new
(FontFamily.GenericSansSerif, 100);
2710
Font smallFont =
new
(FontFamily.GenericSansSerif, 2);
Text\FontMetrics.cs (5)
18
using Font font =
new
(family, size);
37
using Font font =
new
(family, size);
58
using Font font =
new
(family, size);
76
using Font font =
new
(family, size);
133
using Font font =
new
(family, size);
TextBoxBaseTests.cs (8)
910
using Font oldValue =
new
("Arial", 1);
932
using Font oldValue =
new
("Arial", 1);
955
yield return new object[] { userPaint, new
Font
("Arial", 8.25f), 1 };
1035
yield return new object[] { userPaint, new
Font
("Arial", 8.25f) };
1044
using Font oldValue =
new
("Arial", 1);
1082
using Font oldValue =
new
("Arial", 1);
1131
using Font font1 =
new
("Arial", 8.25f);
1278
using Font font =
new
("Arial", 8.25f);
TrackBarTests.cs (1)
654
using Font font1 =
new
("Arial", 8.25f);
System.Windows.Forms.UI.IntegrationTests (1)
Dpi\ToolStripItemTests.Dpi.cs (1)
45
using Font initialFont = toolStrip.Font =
new
("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
WindowsFormsIntegration (4)
System\Windows\Integration\WindowsFormsHostPropertyMap.cs (4)
142
adapter.Font = new SD.
Font
(familySource, adapter.Font.Size, adapter.Font.Style);
173
adapter.Font = new SD.
Font
(CurrentFontFamily, CurrentFontSize, style);
194
adapter.Font = new SD.
Font
(CurrentFontFamily, CurrentFontSize, style);
210
adapter.Font = new SD.
Font
(CurrentFontFamily, (float)pointSize, CurrentFontStyle);
WinFormsControlsTest (36)
ChartControl.cs (1)
40
chart4.Series[0].Font = new
Font
("Trebuchet MS", 8, FontStyle.Bold);
ChartControl.Designer.cs (16)
110
chartArea1.AxisX.LabelStyle.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
114
chartArea1.AxisY.LabelStyle.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
133
legend1.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
172
title1.Font = new System.Drawing.
Font
("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold);
195
chartArea2.AxisX.LabelStyle.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
201
chartArea2.AxisY.LabelStyle.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
246
title2.Font = new System.Drawing.
Font
("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold);
269
chartArea3.AxisX.LabelStyle.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
272
chartArea3.AxisY.LabelStyle.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
284
legend3.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
308
title3.Font = new System.Drawing.
Font
("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold);
329
chartArea4.AxisX.LabelStyle.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
336
chartArea4.AxisY.LabelStyle.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
352
legend4.Font = new System.Drawing.
Font
("Trebuchet MS", 8F, System.Drawing.FontStyle.Bold);
365
series7.Font = new System.Drawing.
Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
402
title4.Font = new System.Drawing.
Font
("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold);
DataGridViewInVirtualModeTest.Designer.cs (1)
87
this.Font = new System.Drawing.
Font
("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
DataGridViewTest.cs (5)
13
new
Font
("Tahoma", 12F, FontStyle.Regular),
14
new
Font
("Consolas", 14F, FontStyle.Italic),
15
new
Font
("Arial", 9F, FontStyle.Bold),
16
new
Font
("Microsoft Sans Serif", 11F, FontStyle.Regular)
93
Font = new
Font
("Tahoma", (float)numericUpDown1.Value, FontStyle.Regular);
DataGridViewTest.Designer.cs (5)
58
dataGridViewCellStyle1.Font = new System.Drawing.
Font
("Cascadia Code", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
76
dataGridViewCellStyle3.Font = new System.Drawing.
Font
("Consolas", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
148
this.changeFontButton.Font = new System.Drawing.
Font
("Consolas", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
196
this.resetFontButton.Font = new System.Drawing.
Font
("Consolas", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
216
this.Font = new System.Drawing.
Font
("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
DragDrop.Designer.cs (2)
86
textBox.Font = new
Font
("Segoe UI", 14.25F);
97
richTextBox.Font = new
Font
("Segoe UI", 14.25F);
ErrorProviderTest.Designer.cs (2)
59
this.label1.Font = new System.Drawing.
Font
("Calibri", 12F, FontStyle.Bold);
89
this.label2.Font = new System.Drawing.
Font
("Calibri", 12F, FontStyle.Bold);
MenuStripAndCheckedListBox.cs (1)
39
menuStrip1.Font = new
Font
(f.FontFamily, f.Size * factor, f.Style);
MultipleControls.Designer.cs (1)
109
this.richTextBox1.Font = new System.Drawing.
Font
("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
ScalingBeforeChanges.cs (1)
100
Font = new
Font
(Font.FontFamily, Font.Size * factorY, Font.Style);
ToolStripTests.Designer.cs (1)
138
this.toolStrip4.Font=new System.Drawing.
Font
("Calibri", 12F, System.Drawing.FontStyle.Bold);
854 references to Font
Accessibility_Core_App (1)
PrintingControls.cs (1)
22
Font
font = new("Times New Roman", 30);
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\ApplicationServices\ApplyApplicationDefaultsEventArgs.vb (1)
49
Public Property Font As
Font
PresentationUI (1)
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
232
Font
columnHeaderFont = new System.Drawing.Font(Font, System.Drawing.FontStyle.Bold);
System.Drawing (1)
System.Drawing.cs (1)
56
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.
Font
))]
System.Drawing.Common (28)
Special\NotSupported.cs (28)
301
public Font(System.Drawing.
Font
prototype, System.Drawing.FontStyle newStyle) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
351
public static System.Drawing.
Font
FromHdc(System.IntPtr hdc) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
352
public static System.Drawing.
Font
FromHfont(System.IntPtr hfont) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
353
public static System.Drawing.
Font
FromLogFont(object lf) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
354
public static System.Drawing.
Font
FromLogFont(object lf, System.IntPtr hdc) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
542
public void DrawString(string? s, System.Drawing.
Font
font, System.Drawing.Brush brush, System.Drawing.PointF point) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
543
public void DrawString(string? s, System.Drawing.
Font
font, System.Drawing.Brush brush, System.Drawing.PointF point, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
544
public void DrawString(string? s, System.Drawing.
Font
font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
545
public void DrawString(string? s, System.Drawing.
Font
font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
546
public void DrawString(string? s, System.Drawing.
Font
font, System.Drawing.Brush brush, float x, float y) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
547
public void DrawString(string? s, System.Drawing.
Font
font, System.Drawing.Brush brush, float x, float y, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
642
public System.Drawing.Region[] MeasureCharacterRanges(string? text, System.Drawing.
Font
font, System.Drawing.RectangleF layoutRect, System.Drawing.StringFormat? stringFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
643
public System.Drawing.SizeF MeasureString(string? text, System.Drawing.
Font
font) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
644
public System.Drawing.SizeF MeasureString(string? text, System.Drawing.
Font
font, System.Drawing.PointF origin, System.Drawing.StringFormat? stringFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
645
public System.Drawing.SizeF MeasureString(string? text, System.Drawing.
Font
font, System.Drawing.SizeF layoutArea) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
646
public System.Drawing.SizeF MeasureString(string? text, System.Drawing.
Font
font, System.Drawing.SizeF layoutArea, System.Drawing.StringFormat? stringFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
647
public System.Drawing.SizeF MeasureString(string? text, System.Drawing.
Font
font, System.Drawing.SizeF layoutArea, System.Drawing.StringFormat? stringFormat, out int charactersFitted, out int linesFilled) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
648
public System.Drawing.SizeF MeasureString(string? text, System.Drawing.
Font
font, int width) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
649
public System.Drawing.SizeF MeasureString(string? text, System.Drawing.
Font
font, int width, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
1267
public static System.Drawing.
Font
? CaptionFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
1268
public static System.Drawing.
Font
DefaultFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
1269
public static System.Drawing.
Font
DialogFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
1270
public static System.Drawing.
Font
? IconTitleFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
1271
public static System.Drawing.
Font
? MenuFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
1272
public static System.Drawing.
Font
? MessageBoxFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
1273
public static System.Drawing.
Font
? SmallCaptionFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
1274
public static System.Drawing.
Font
? StatusFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
1275
public static System.Drawing.
Font
? GetFontByName(string systemFontName) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
System.Drawing.Common.Tests (91)
mono\System.Drawing\GraphicsTests.cs (2)
42
private readonly
Font
_font;
2011
using
Font
font = new(FontFamily.GenericSerif, 11.0f);
mono\System.Imaging\MetafileTest.cs (1)
286
Font
test_font = new(FontFamily.GenericMonospace, 12);
System\Drawing\FontConverterTests.cs (18)
49
Font
font = (
Font
)converter.ConvertFrom(input);
78
Font
font = (
Font
)converter.ConvertFrom(string.Empty);
88
nameof(
Font
.Name),
89
nameof(
Font
.Size),
90
nameof(
Font
.Unit),
91
nameof(
Font
.Bold),
92
nameof(
Font
.GdiCharSet),
93
nameof(
Font
.GdiVerticalFont),
94
nameof(
Font
.Italic),
95
nameof(
Font
.Strikeout),
96
nameof(
Font
.Underline),
100
Font
font = new($"Courier New", 8.25f, FontStyle.Regular, GraphicsUnit.Point);
116
public void ConvertToInstanceDescriptor(
Font
font, int expectedArguments)
123
using
Font
newFont = (
Font
)descriptor.Invoke();
137
public static TheoryData<
Font
, int> InstanceDescriptorTestData => new()
System\Drawing\FontTests.cs (62)
35
using
Font
font1 = new(fontFamily, size);
36
using
Font
font2 = new(fontFamily, size);
44
using
Font
font1 = new(fontFamily1, 9);
45
using
Font
font2 = new(fontFamily2, 9);
64
using
Font
font = new(fontFamily, emSize);
79
using
Font
font = new(fontFamily.Name, emSize);
106
using
Font
font = new(fontFamily, emSize, style);
121
using
Font
font = new(fontFamily.Name, emSize, style);
146
using
Font
font = new(fontFamily, emSize, unit);
161
using
Font
font = new(fontFamily.Name, emSize, unit);
188
using
Font
font = new(fontFamily, emSize, style, unit);
203
using
Font
font = new(fontFamily.Name, emSize, style, unit);
230
using
Font
font = new(fontFamily, emSize, style, unit, gdiCharSet);
245
using
Font
font = new(fontFamily.Name, emSize, style, unit, gdiCharSet);
272
using
Font
font = new(fontFamily, emSize, style, unit, gdiCharSet, gdiVerticalFont);
287
using
Font
font = new(fontFamily.Name, emSize, style, unit, gdiCharSet, gdiVerticalFont);
300
using
Font
font = new($"@{family.Name}", 10);
315
Font
font = new(family, 10);
318
using
Font
copy = new(font, FontStyle.Italic);
395
using
Font
font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
396
Font
clone = Assert.IsType<
Font
>(font.Clone());
411
Font
font = new(family, 10);
420
Font
font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
435
public void Equals_Other_ReturnsExpected(
Font
font, object other, bool expected)
451
if (other is
Font
otherFont && !ReferenceEquals(font, otherFont))
461
AssertExtensions.Throws<ArgumentException>(null, () =>
Font
.FromHdc(IntPtr.Zero));
472
AssertExtensions.Throws<ArgumentException>(null, () =>
Font
.FromHdc(hdc));
483
AssertExtensions.Throws<ArgumentException>(null, () =>
Font
.FromHfont(IntPtr.Zero));
490
using
Font
font = new(family, 10);
501
using
Font
font = new(family, 10);
517
using
Font
font = new(family, 10);
525
using
Font
font = new(family, 10);
533
using
Font
font = new(family, 10);
547
Font
font = new(family, 10);
584
using
Font
font =
Font
.FromLogFont(logFont);
598
AssertExtensions.Throws<ArgumentException>(null, () =>
Font
.FromLogFont(null));
599
AssertExtensions.Throws<ArgumentException>(null, () =>
Font
.FromLogFont(null, hdc));
603
AssertExtensions.Throws<ArgumentNullException>("lf", () =>
Font
.FromLogFont(null));
604
AssertExtensions.Throws<ArgumentNullException>("lf", () =>
Font
.FromLogFont(null, hdc));
622
AssertExtensions.Throws<ArgumentException>(null, () =>
Font
.FromLogFont(logFont));
623
AssertExtensions.Throws<ArgumentException>(null, () =>
Font
.FromLogFont(logFont, hdc));
645
using
Font
font =
Font
.FromLogFont(logFont);
686
using
Font
font = new(family, 10, unit);
705
using
Font
font = new(family, 10, fontStyle, GraphicsUnit.Point, gdiCharSet, gdiVerticalFont);
735
using
Font
font = new(family, 10);
763
using
Font
font = new(family, 10);
774
using
Font
font = new(family, 10);
782
using
Font
font = new(family, 10);
814
using
Font
font = new(family, 10);
819
Font
newFont =
Font
.FromHfont(hfont);
827
using
Font
font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
832
Font
newFont =
Font
.FromHfont(hfont);
842
Font
font = new(family, 10);
852
using
Font
font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
856
private static void VerifyFont(
Font
font, string expectedName, float expectedEmSize, FontStyle expectedStyle, GraphicsUnit expectedUnit, byte expectedGdiCharset, bool expectedGdiVerticalFont)
879
using
Font
font1 = new(family1, 1, FontStyle.Bold, GraphicsUnit.Point);
882
using
Font
font2 = new(family2, 1, FontStyle.Bold, GraphicsUnit.Point);
System\Drawing\SystemFontsTests.cs (7)
22
public void SystemFont_Get_ReturnsExpected(Func<
Font
> getFont)
24
using
Font
font = getFont();
25
using
Font
otherFont = getFont();
75
public void SystemFont_Get_ReturnsExpected_WindowsNames(Func<
Font
> getFont, string systemFontName, string windowsFontName)
77
using
Font
font = getFont();
78
using
Font
otherFont = getFont();
79
using
Font
fontFromName = SystemFonts.GetFontByName(systemFontName);
System\Drawing\Text\PrivateFontCollectionTests.cs (1)
131
AssertExtensions.Throws<ArgumentException>(null, () => fontCollection.AddFontFile(typeof(
Font
).Assembly.Location));
System.Windows.Forms (329)
System\Drawing\Design\UITypeEditor.cs (1)
55
[typeof(
Font
)] = $"System.Drawing.Design.FontEditor, {AssemblyRef.SystemDrawingDesign}",
System\Windows\Forms\ActiveX\AxHost.cs (10)
64
private static ConditionalWeakTable<
Font
, object>? s_fontTable;
338
public override
Font
Font
3599
private static FONTDESC GetFONTDESCFromFont(
Font
font)
3650
protected static object? GetIFontFromFont(
Font
? font)
3669
private protected static IFont* GetIFontPointerFromFont(
Font
? font)
3699
protected static
Font
? GetFontFromIFont(object? font)
3709
Font
f =
Font
.FromHfont(oleFont.hFont);
3724
protected static object? GetIFontDispFromFont(
Font
? font)
3749
protected static
Font
? GetFontFromIFontDisp(object? font)
System\Windows\Forms\ActiveX\Control.ActiveXFontMarshaler.cs (2)
32
Font
font = (
Font
)obj;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (4)
44
private
Font
? ActiveXAmbientFont
200
internal
Font
? AmbientFont
226
return (
Font
?)property.Value;
1376
prop.Value =
Font
.FromHfont(pQaContainer->pFont->hFont);
System\Windows\Forms\AmbientProperties.cs (1)
28
public
Font
? Font { get; set; }
System\Windows\Forms\Application.cs (7)
28
private static
Font
? s_defaultFont;
32
private static
Font
? s_defaultFontScaled;
347
internal static
Font
DefaultFont => s_defaultFontScaled ?? s_defaultFont!;
1347
/// Sets the default <see cref="
Font
"/> for process.
1364
public static void SetDefaultFont(
Font
font)
1393
Font
newSystemFont = SystemFonts.GetFontByName(s_defaultFont.SystemFontName)!;
1406
Font
? font = ScaleHelper.ScaleToSystemTextSize(s_defaultFont);
System\Windows\Forms\ComponentModel\COM2Interop\COM2FontConverter.cs (6)
17
private
Font
? _lastFont;
21
public override Type ManagedType => typeof(
Font
);
53
using
Font
font =
Font
.FromHfont(_lastHandle);
77
_lastFont = (
Font
)managedValue;
106
private static void ApplyFontSettings(
Font
source, IFont* target, out bool targetChanged)
System\Windows\Forms\Control.cs (27)
175
private static
Font
? s_defaultFont;
280
private
Font
? _scaledControlFont;
288
private Dictionary<int,
Font
>? _dpiFonts;
1559
public static
Font
DefaultFont
1804
public virtual
Font
Font
1812
Font
? previous = Properties.GetValueOrDefault<
Font
>(s_fontProperty);
1820
Font
currentFont = Font;
1861
internal
Font
GetScaledFont(
Font
font, int newDpi, int oldDpi)
1867
_dpiFonts ??= new Dictionary<int,
Font
>
1872
if (_dpiFonts.TryGetValue(newDpi, out
Font
? scaledFont))
1892
foreach (
Font
font in _dpiFonts.Values)
1919
if (TryGetExplicitlySetFont(out
Font
? font))
1938
if (Properties.TryGetValue(s_currentAmbientFontProperty, out
Font
? currentAmbient) && currentAmbient == ambientFont)
1966
if (TryGetExplicitlySetFont(out
Font
? font))
2910
internal
Font
? ScaledControlFont
2948
Font
? oldFont = null;
4155
Font
oldFont = Font;
5428
private
Font
GetCurrentFontAndDpi(out int fontDpi)
5438
if (TryGetExplicitlySetFont(out
Font
? font))
7306
Font
localFont = GetCurrentFontAndDpi(out int fontDpi);
7317
Font
fontForDpi = GetScaledFont(localFont, _deviceDpi, fontDpi);
10643
private protected bool TryGetExplicitlySetFont([NotNullWhen(true)] out
Font
? font) =>
10651
private protected void SetScaledFont(
Font
scaledFont, bool raiseOnFontChangedEvent = true)
11434
Font
localFont = GetCurrentFontAndDpi(out int fontDpi);
12484
Font
font = SystemFonts.MessageBoxFont!;
System\Windows\Forms\Control.FontHandleWrapper.cs (2)
11
/// Wrapper for a <see cref="Drawing.
Font
"/>'s <see cref="HFONT"/>.
17
internal FontHandleWrapper(
Font
font) => _handle = (HFONT)font.ToHfont();
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
559
Font
font,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (1)
30
public
Font
Font { get; set; } = null!;
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (1)
302
Font
font,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (1)
154
Font
font,
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
135
Font
font,
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (11)
65
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
124
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
128
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
129
public static void DrawButton(Graphics g, Rectangle bounds, string? buttonText,
Font
? font, bool focused, PushButtonState state)
141
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
142
public static void DrawButton(Graphics g, Rectangle bounds, string? buttonText,
Font
? font, TextFormatFlags flags, bool focused, PushButtonState state)
170
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
197
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
202
Font
? font,
224
Font
? font,
236
Font
? font,
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (9)
49
/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
83
/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
89
Font
? font,
101
/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
107
Font
? font,
117
Font
? font,
155
/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
161
Font
? font,
185
Font
? font,
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (10)
49
/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
87
/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
93
Font
? font,
102
/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
108
Font
? font,
121
Font
? font,
155
/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
161
Font
? font,
185
Font
? font,
208
Font
? font,
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (4)
58
public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText,
Font
? font, ComboBoxState state)
66
public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText,
Font
? font, Rectangle textBounds, ComboBoxState state)
74
public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText,
Font
? font, TextFormatFlags flags, ComboBoxState state)
86
public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText,
Font
? font, Rectangle textBounds, TextFormatFlags flags, ComboBoxState state)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
2616
public override
Font
Font
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (6)
2522
Font
font,
2536
Font
font,
2561
Font
font,
2607
Font
font,
2627
Font
font,
3954
internal static bool TextFitsInBounds(Graphics graphics, string text,
Font
font, Size maxBounds, TextFormatFlags flags)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (3)
143
public
Font
? Font
145
get => Properties.GetValueOrDefault<
Font
>(s_propFont);
148
Font
? previous = Properties.AddOrRemoveValue(s_propFont, value);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (4)
951
Font
? getLinkFont = null;
952
Font
? getHoverFont = null;
956
using
Font
linkFont = getLinkFont;
957
using
Font
hoverFont = getHoverFont;
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (1)
318
Font
font)
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (2)
95
private
Font
? _calendarFont;
205
public
Font
CalendarFont
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
22
private
Font
? _cachedFont;
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (8)
77
public static void DrawGroupBox(Graphics g, Rectangle bounds, string? groupBoxText,
Font
? font, GroupBoxState state)
87
Font
? font,
99
Font
? font,
108
Font
? font,
129
Font
? font,
139
Font
? font,
170
Font
? font,
276
Font
? font,
System\Windows\Forms\Controls\Labels\LinkLabel.cs (6)
34
private
Font
? _linkFont;
35
private
Font
? _hoverLinkFont;
530
using
Font
alwaysUnderlined = new Font(Font, Font.Style | FontStyle.Underline);
1227
Font
linkFont,
1228
Font
hoverLinkFont,
1259
Font
font = (linkState & LinkState.Hover) == LinkState.Hover ? hoverLinkFont : linkFont;
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (4)
163
Font
baseFont,
165
[AllowNull] ref
Font
linkFont,
166
[AllowNull] ref
Font
hoverLinkFont,
198
Font
f = baseFont;
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
588
Font
font = Font;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (1)
430
public override
Font
Font
System\Windows\Forms\Controls\ListView\DrawListViewColumnHeaderEventArgs.cs (2)
26
Font
? font)
76
public
Font
? Font { get; }
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (1)
138
Font
font = ItemIndex == -1 ? Item!.Font : SubItem!.Font;
System\Windows\Forms\Controls\ListView\ListView.cs (4)
108
private
Font
_odCacheFont;
2783
Font
? subItemFont = null;
5997
Font
font = GetListHeaderFont();
6311
private
Font
GetListHeaderFont()
System\Windows\Forms\Controls\ListView\ListViewItem.cs (7)
106
public ListViewItem(string[]? items, int imageIndex, Color foreColor, Color backColor,
Font
? font)
162
public ListViewItem(string[]? items, int imageIndex, Color foreColor, Color backColor,
Font
? font, ListViewGroup? group)
197
public ListViewItem(string[]? items, string? imageKey, Color foreColor, Color backColor,
Font
? font)
235
public ListViewItem(string[]? items, string? imageKey, Color foreColor, Color backColor,
Font
? font, ListViewGroup? group)
388
public
Font
Font
1222
Font = (
Font
)info.GetValue(nameof(Font), typeof(
Font
))!;
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.cs (2)
46
public ListViewSubItem(ListViewItem? owner, string? text, Color foreColor, Color backColor,
Font
font)
141
public
Font
Font
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.SubItemStyle.cs (1)
16
public
Font
? font; // Do NOT rename (binary serialization).
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (2)
125
public ListViewSubItem Add(string? text, Color foreColor, Color backColor,
Font
font)
167
public void AddRange(string[] items, Color foreColor, Color backColor,
Font
font)
System\Windows\Forms\Controls\ListView\ListViewItemConverter.cs (2)
90
typeof(
Font
)
110
typeof(
Font
)
System\Windows\Forms\Controls\ListView\ListViewSubItemConverter.cs (1)
41
typeof(
Font
)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
281
public override
Font
Font
System\Windows\Forms\Controls\ProgressBar\ProgressBar.cs (1)
193
public override
Font
Font
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.MeasureTextHelper.cs (4)
15
public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text,
Font
font)
18
public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text,
Font
font, int width)
21
public static SizeF MeasureTextSimple(PropertyGrid owner, Graphics g, string? text,
Font
font, SizeF size)
31
public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text,
Font
font, SizeF size)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CategoryGridEntry.cs (1)
117
Font
font = GetFont(boldFont: bold);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.CacheItems.cs (2)
13
public
Font
? LastLabelFont;
17
public
Font
? LastValueFont;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (4)
1187
protected int GetLabelTextWidth(string? text, Graphics graphics,
Font
font)
1210
public int GetValueTextWidth(string text, Graphics graphics,
Font
font)
1483
protected
Font
GetFont(bool boldFont)
1535
Font
font = GetFont(boldFont: bold);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (3)
55
private
Font
? _boldFont;
1302
public
Font
GetBaseFont() => Font;
1304
public
Font
GetBoldFont() => _boldFont ??= new Font(Font, FontStyle.Bold);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (5)
389
public override
Font
Font
409
Font
? font = GetCharFormatFont(selectionOnly: false);
938
public
Font
? SelectionFont
2161
private
Font
? GetCharFormatFont(bool selectionOnly)
2728
private unsafe void SetCharFormatFont(bool selectionOnly,
Font
value)
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
159
public override
Font
Font
System\Windows\Forms\Controls\TabControl\TabRenderer.cs (5)
54
public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText,
Font
? font, TabItemState state)
62
public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText,
Font
? font, bool focused, TabItemState state)
72
public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText,
Font
? font, TextFormatFlags flags, bool focused, TabItemState state)
111
public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText,
Font
? font, Image image, Rectangle imageRectangle, bool focused, TabItemState state)
121
public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText,
Font
? font, TextFormatFlags flags, Image image, Rectangle imageRectangle, bool focused, TabItemState state)
System\Windows\Forms\Controls\TextBox\TextBoxRenderer.cs (4)
51
public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText,
Font
? font, TextBoxState state)
59
public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText,
Font
? font, Rectangle textBounds, TextBoxState state)
67
public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText,
Font
? font, TextFormatFlags flags, TextBoxState state)
78
public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText,
Font
? font, Rectangle textBounds, TextFormatFlags flags, TextBoxState state)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (3)
63
private
Font
? _defaultFont;
517
public override
Font
Font
3746
if (item.TryGetExplicitlySetFont(out
Font
? local))
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
189
public override
Font
Font
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (2)
355
public override
Font
Font
610
Font
originalFont = Font;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
787
Font
currentFont = childItem.Font;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (6)
145
internal
Font
_defaultFont = ToolStripManager.DefaultFont;
904
public virtual
Font
Font
908
if (TryGetExplicitlySetFont(out
Font
? font))
2318
private
Font
? GetOwnerFont() => Owner?.Font;
3182
Font
f = Font;
3631
internal bool TryGetExplicitlySetFont([NotNullWhen(true)] out
Font
? local) => Properties.TryGetValue(s_fontProperty, out local);
System\Windows\Forms\Controls\ToolStrips\ToolStripItemTextRenderEventArgs.cs (3)
25
Font
? textFont,
48
Font
? textFont,
86
public
Font
? TextFont { get; set; }
System\Windows\Forms\Controls\ToolStrips\ToolStripLabel.cs (3)
23
private
Font
? _hoverLinkFont;
24
private
Font
? _linkFont;
355
Font
font = Font;
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (6)
24
private static
Font
? s_defaultFont;
25
private static readonly ConcurrentDictionary<int,
Font
> s_defaultFontCache = new();
51
internal static
Font
DefaultFont
60
Font
? sysFont;
67
if (!s_defaultFontCache.TryGetValue(dpi, out
Font
? retFont))
91
Font
? retFont = s_defaultFont;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
867
Font
? textFont = e.TextFont;
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
105
public override
Font
Font
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.ToolStripTextBoxControl.cs (1)
95
public override
Font
Font
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (1)
218
public override
Font
Font
System\Windows\Forms\Controls\TreeView\TreeNode.cs (2)
729
public
Font
? NodeFont
742
Font
? oldfont = NodeFont;
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
2840
Font
font = node.NodeFont ?? node.TreeView.Font;
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
1252
public override
Font
Font
System\Windows\Forms\Design\ComponentEditorForm.cs (2)
169
Font
? uiFont = DefaultFont;
172
uiFont = (
Font
?)uiService.Styles["DialogFont"];
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (5)
26
private
Font
? _font;
135
public
Font
Font
139
Font
? result = _font ?? Control.DefaultFont;
466
using
Font
fontInWorldUnits =
Font
.FromLogFont(in lf, dc);
System\Windows\Forms\Form.cs (2)
3725
public static SizeF GetAutoScaleSize(
Font
font)
4536
Font
fontForDpi = GetScaledFont(Font, deviceDpiNew, deviceDpiOld);
System\Windows\Forms\Help\Help.cs (1)
88
Font
font = SystemFonts.StatusFont ?? SystemFonts.DefaultFont;
System\Windows\Forms\Layout\Containers\ContainerControl.cs (1)
1400
Font
fontForDpi = GetScaledFont(Font, deviceDpiNew, deviceDpiOld);
System\Windows\Forms\Layout\LayoutUtils.cs (1)
43
public static Size OldGetLargestStringSizeInCollection(
Font
? font, ICollection? objects)
System\Windows\Forms\Layout\LayoutUtils.MeasureTextCache.cs (3)
29
public Size GetTextSize(string? text,
Font
? font, Size proposedConstraints, TextFormatFlags flags)
99
public bool TextRequiresWordBreak(string? text,
Font
? font, Size size, TextFormatFlags flags)
108
private Size GetUnconstrainedSize(string? text,
Font
? font, TextFormatFlags flags)
System\Windows\Forms\OwnerDrawPropertyBag.cs (2)
22
if (entry.Name == nameof(Font) && entry.Value is
Font
font)
41
public
Font
? Font { get; set; }
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
637
public override
Font
Font
System\Windows\Forms\Rendering\ControlPaint.cs (5)
1947
Font
font,
1979
Font
font,
1996
Font
font,
2061
internal static
Font
FontInPoints(
Font
font)
System\Windows\Forms\Rendering\DrawItemEventArgs.cs (5)
31
public DrawItemEventArgs(Graphics graphics,
Font
? font, Rectangle rect, int index, DrawItemState state)
41
Font
? font,
58
Font
? font,
67
Font
? font,
90
public
Font
? Font { get; }
System\Windows\Forms\Rendering\FontCache.cs (7)
9
/// Thread safe cache of <see cref="HFONT"/> objects created from <see cref="
Font
"/> objects.
22
internal sealed partial class FontCache : RefCountedCache<HFONT, FontCache.Data, (
Font
Font, FONT_QUALITY Quality)>
36
public CacheEntry GetEntry(
Font
font, FONT_QUALITY quality = FONT_QUALITY.DEFAULT_QUALITY) => GetEntry((font, quality));
38
public override CacheEntry GetEntry((
Font
Font, FONT_QUALITY Quality) key)
46
protected override CacheEntry CreateEntry((
Font
Font, FONT_QUALITY Quality) key, bool cached)
49
protected override bool IsMatch((
Font
Font, FONT_QUALITY Quality) key, CacheEntry entry)
50
=> entry.Data.Font.TryGetTarget(out
Font
? currentFont)
System\Windows\Forms\Rendering\FontCache.Data.cs (4)
18
public WeakReference<
Font
> Font { get; }
24
public Data(
Font
font, FONT_QUALITY quality)
26
Font = new WeakReference<
Font
>(font);
66
private static unsafe HFONT FromFont(
Font
font, FONT_QUALITY quality = FONT_QUALITY.DEFAULT_QUALITY)
System\Windows\Forms\Rendering\GdiCache.cs (1)
91
public static FontCache.Scope GetHFONTScope(
Font
? font, FONT_QUALITY quality = FONT_QUALITY.DEFAULT_QUALITY)
System\Windows\Forms\Rendering\TextRenderer.cs (55)
25
public static void DrawText(IDeviceContext dc, string? text,
Font
? font, Point pt, Color foreColor)
33
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
37
public static void DrawText(IDeviceContext dc, ReadOnlySpan<char> text,
Font
font, Point pt, Color foreColor)
43
Font
? font,
54
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
62
Font
font,
71
Font
? font,
83
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
94
Font
? font,
110
Font
? font,
123
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
135
Font
? font,
149
public static void DrawText(IDeviceContext dc, string? text,
Font
? font, Rectangle bounds, Color foreColor)
157
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
164
Font
? font,
172
Font
? font,
184
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
192
Font
? font,
201
Font
? font,
213
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
224
Font
? font,
240
Font
? font,
253
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
265
Font
? font,
282
Font
? font,
292
Font
? font,
315
Font
? font,
324
Font
? font,
348
Font
? font,
358
Font
? font,
381
public static Size MeasureText(string? text,
Font
? font)
388
/// <param name="font">The <see cref="
Font
"/> to apply to the measured text.</param>
392
/// <see cref="DrawText(IDeviceContext, ReadOnlySpan{char},
Font
?, Rectangle, Color, TextFormatFlags)"/>
396
/// versions of <see cref="DrawText(IDeviceContext, ReadOnlySpan{char},
Font
, Point, Color)"/> and
397
/// <see cref="MeasureText(IDeviceContext, ReadOnlySpan{char},
Font
?)"/> that take a Size and
399
/// <see cref="MeasureText(IDeviceContext, string?,
Font
?, Size, TextFormatFlags)"/>.
401
public static Size MeasureText(ReadOnlySpan<char> text,
Font
? font)
404
public static Size MeasureText(string? text,
Font
? font, Size proposedSize)
412
/// <param name="font">The <see cref="
Font
"/> to apply to the measured text.</param>
418
public static Size MeasureText(ReadOnlySpan<char> text,
Font
? font, Size proposedSize)
421
public static Size MeasureText(string? text,
Font
? font, Size proposedSize, TextFormatFlags flags)
429
/// <param name="font">The <see cref="
Font
"/> to apply to the measured text.</param>
439
public static Size MeasureText(ReadOnlySpan<char> text,
Font
? font, Size proposedSize, TextFormatFlags flags)
442
public static Size MeasureText(IDeviceContext dc, string? text,
Font
? font)
456
public static Size MeasureText(IDeviceContext dc, ReadOnlySpan<char> text,
Font
? font)
459
public static Size MeasureText(IDeviceContext dc, string? text,
Font
? font, Size proposedSize)
468
/// <param name="font">The <see cref="
Font
"/> to apply to the measured text.</param>
475
public static Size MeasureText(IDeviceContext dc, ReadOnlySpan<char> text,
Font
? font, Size proposedSize)
481
Font
? font,
492
/// <param name="font">The <see cref="
Font
"/> to apply to the measured text.</param>
506
Font
? font,
513
Font
? font,
529
Font
? font,
650
/// <inheritdoc cref="GdiCache.GetHFONTScope(
Font
?, FONT_QUALITY)"/>
658
private static FontCache.Scope GetFontOrHdcHFONT(
Font
? font, FONT_QUALITY quality, HDC hdc)
System\Windows\Forms\Scrolling\ScrollBar.cs (1)
170
public override
Font
Font
System\Windows\Forms\SystemInformation.cs (4)
134
public static
Font
MenuFont => GetMenuFontHelper(0, useDpi: false);
139
public static
Font
GetMenuFontForDpi(int dpi)
142
private static unsafe
Font
GetMenuFontHelper(uint dpi, bool useDpi)
156
return
Font
.FromLogFont(Unsafe.AsRef<LOGFONT>((LOGFONT*)&data.lfMenuFont));
System\Windows\Forms\ToolTip\DrawToolTipEventArgs.cs (2)
27
Font
? font)
67
public
Font
? Font { get; }
System\Windows\Forms\ToolTip\ToolTip.cs (2)
2324
Font
font;
2327
font =
Font
.FromHfont(PInvokeCore.SendMessage(this, PInvokeCore.WM_GETFONT));
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (2)
530
public
Font
? GetFont(IDeviceContext dc, FontProperty prop)
547
return
Font
.FromLogFont(logfont);
System.Windows.Forms.Design (35)
System\ComponentModel\Design\ByteViewer.cs (5)
37
private static readonly
Font
s_addressFont = new("Microsoft Sans Serif", 8.0f);
38
private static readonly
Font
s_hexDumpFont = new("Courier New", 8.0f);
124
Font
font = s_addressFont;
193
Font
font = s_hexDumpFont;
205
Font
font = s_hexDumpFont;
System\ComponentModel\Design\DesignerActionPanel.cs (1)
65
Font = (
Font
)uiService.Styles["DialogFont"]!;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (1)
447
public DropDownHolder(Control hostedControl, Control parentControl, Color borderColor,
Font
font, EditorPropertyLine parent)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (1)
18
public FlyoutDialog(Control hostedControl, Control parentControl, Color borderColor,
Font
font)
System\ComponentModel\Design\DesignerActionPanel.HeaderLine.cs (1)
16
protected override
Font
GetFont() => new(ActionPanel.Font, FontStyle.Bold);
System\ComponentModel\Design\DesignerActionPanel.TextLine.cs (1)
58
protected virtual
Font
GetFont()
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (3)
22
private readonly Dictionary<int,
Font
?> _fallbackFonts;
250
public override
Font
Font
295
if (!_fallbackFonts.TryGetValue(planeNumber, out
Font
? replaceFont))
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
259
Font
font = Font;
System\Drawing\Design\CursorEditor.CursorUI.cs (1)
65
Font
font = e.Font!;
System\Drawing\Design\FontEditor.cs (1)
33
if (value is
Font
fontValue)
System\Drawing\Design\FontNameEditor.cs (1)
72
using
Font
font = new(fontFamily, fontSize, fontStyle, GraphicsUnit.Pixel);
System\Windows\Forms\Design\BaseContextMenuStrip.cs (2)
125
_selectionMenuItem.DropDown.Font = (
Font
)uis.Styles["DialogFont"]!;
239
Font = (
Font
)uis.Styles["DialogFont"]!;
System\Windows\Forms\Design\ComponentTray.cs (3)
157
Font = (
Font
)uiService.Styles["DialogFont"];
1425
Font = (
Font
)uiService.Styles["DialogFont"];
1961
public override
Font
Font
System\Windows\Forms\Design\ControlDesigner.cs (1)
2258
using (
Font
errorFont = new(
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (2)
55
Font
uiFont = DefaultFont;
58
uiFont = (
Font
)uiService.Styles["DialogFont"]!;
System\Windows\Forms\Design\DataGridViewCellStyleEditor.cs (1)
30
_builderDialog.Font = (
Font
)uiService.Styles["DialogFont"]!;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
797
if (font is not
Font
uiFont)
System\Windows\Forms\Design\SplitterPanelDesigner.cs (1)
191
using
Font
drawFont = new("Arial", 8);
System\Windows\Forms\Design\TabOrder.cs (3)
26
private readonly
Font
_tabFont;
48
_tabFont = uisvc is not null && uisvc.Styles["DialogFont"] is
Font
dialogFont ? dialogFont : DefaultFont;
194
Font
font = _tabFont;
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
393
contextMenu.Font = (
Font
)uis.Styles["DialogFont"];
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (3)
82
item.DropDown.Font = (
Font
)uis.Styles["DialogFont"];
172
Font
font = (
Font
)uis.Styles["DialogFont"];
System.Windows.Forms.Design.Tests (2)
EnsureEditorsTests.cs (1)
50
[InlineData(typeof(
Font
), typeof(FontEditor))]
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (1)
16
Font
expectedFont = new Font("Arial", 12.0f);
System.Windows.Forms.Primitives (9)
System\Drawing\FontExtensions.cs (2)
11
public static LOGFONTW ToLogicalFont(this
Font
font)
17
public static LOGFONTW ToLogicalFont(this
Font
font, Graphics graphics)
System\Windows\Forms\FontExtensions.cs (3)
16
/// A new <see cref="
Font
"/> object with the new size, or <see langword="null"/> if <paramref name="templateFont"/>
20
public static
Font
? WithSize(this
Font
? templateFont, float emSize) => templateFont is null
System\Windows\Forms\Internals\ScaleHelper.cs (3)
220
/// Creates a scaled version of the given non system <see cref="
Font
"/> to the Windows Accessibility Text Size setting (also
223
internal static
Font
? ScaleToSystemTextSize(
Font
? font)
System\Windows\Forms\SystemDrawingExtensions.cs (1)
14
internal static HFONT ToHFONT(this
Font
font) => (HFONT)font.ToHfont();
System.Windows.Forms.Primitives.Tests (17)
Interop\User32\SystemParametersInfoWTests.cs (12)
18
Font
captionFont =
Font
.FromLogFont(data.lfCaptionFont);
21
Font
menuFont =
Font
.FromLogFont(data.lfMenuFont);
24
Font
messageFont =
Font
.FromLogFont(data.lfMessageFont);
27
Font
smCaptionFont =
Font
.FromLogFont(data.lfSmCaptionFont);
30
Font
statusFont =
Font
.FromLogFont(data.lfStatusFont);
33
static void AreEqual(
Font
expected,
Font
actual)
System\Windows\Forms\Automation\UiaTextRangeTests.cs (5)
531
using
Font
font = new("Segoe UI", 9, FontStyle.Regular);
618
using
Font
font = new("Arial", 9f, FontStyle.Regular);
711
using
Font
font = new("Arial", 9f, FontStyle.Regular);
793
using
Font
font = new("Arial", 9f, FontStyle.Regular);
1200
using
Font
font = new("Arial", fontSize, FontStyle.Regular);
System.Windows.Forms.Tests (329)
CheckedListBoxTests.cs (2)
413
public void CheckedListBox_OnDrawItem_Invoke_Success(
Font
font, Rectangle rect, int index, DrawItemState state, Color foreColor, Color backColor)
428
public void CheckedListBox_OnDrawItem_InvokeWithHandle_Success(
Font
font, Rectangle rect, int index, DrawItemState state, Color foreColor, Color backColor)
SerializableTypesTests.cs (2)
161
using (
Font
font = new(FontFamily.GenericSansSerif, 9f))
208
using (
Font
font = new(FontFamily.GenericSansSerif, 9f))
System\Windows\Forms\AmbientPropertiesTests.cs (1)
54
public void Font_Set_GetReturnsExpected(
Font
value)
System\Windows\Forms\ApplicationTests.cs (11)
197
Font
customFont = (
Font
)SystemFonts.CaptionFont.Clone();
220
Font
font = new(new FontFamily("Arial"), 12f);
221
Font
scaled = new(new FontFamily("Arial"), 16f);
258
Font
font = applicationTestAccessor.s_defaultFont;
270
using
Font
sysFont = SystemFonts.CaptionFont;
281
using
Font
fakeSysFont = sysFont.WithSize(sysFont.Size * 1.25f);
305
Font
font = applicationTestAccessor.s_defaultFont;
310
using
Font
customFont = new(new FontFamily("Arial"), 12f);
639
private static void AreFontEqual(
Font
expected,
Font
actual)
System\Windows\Forms\AxHostTests.cs (14)
516
public void AxHost_Font_Set_GetReturnsExpected(
Font
value)
1446
using
Font
font = new("Arial", 10);
1459
Font
result = SubAxHost.GetFontFromIFont(iFont);
1475
using
Font
font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10);
1488
Font
result = SubAxHost.GetFontFromIFont(iFont);
1509
using
Font
font = new("Arial", 10, unit);
1522
using
Font
font = new("Arial", 10);
1534
Font
result = SubAxHost.GetFontFromIFont(iFont);
1544
using
Font
font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10);
1555
Font
result = SubAxHost.GetFontFromIFont(iFont);
1570
using
Font
font = new("Arial", 10, unit);
3226
public static new
Font
GetFontFromIFont(object font) => AxHost.GetFontFromIFont(font);
3228
public static new object GetIFontDispFromFont(
Font
font) => AxHost.GetIFontDispFromFont(font);
3230
public static new object GetIFontFromFont(
Font
font) => AxHost.GetIFontFromFont(font);
System\Windows\Forms\ButtonTests.cs (4)
668
public void Button_Font_Set_GetReturnsExpected(
Font
value)
689
using
Font
font = new("Arial", 100f);
719
using
Font
font1 = new("Arial", 8.25f);
730
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\ComboBoxTests.cs (3)
986
public void ComboBox_Font_Set_GetReturnsExpected(
Font
value)
1017
using
Font
font1 = new("Arial", 8.25f);
1028
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (5)
42
using
Font
? font = (
Font
?)converter.ConvertNativeToManaged((VARIANT)(IUnknown*)iFont, s_stubDescriptor);
74
using
Font
? font = (
Font
?)converter.ConvertNativeToManaged((VARIANT)(IUnknown*)iFont, s_stubDescriptor);
77
using
Font
newFont = new(font.Name, 20.0f);
System\Windows\Forms\ContainerControlTests.cs (4)
406
public void ContainerControl_Font_Set_GetReturnsExpected(
Font
value)
425
public void ContainerControl_Font_SetWithAutoScaleModeFont_GetReturnsExpected(
Font
value)
460
using
Font
font1 = new("Arial", 8.25f);
471
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\Control.ActiveXFontMarshallerTests.cs (3)
22
using
Font
font = new("Arial", 11.0f, GraphicsUnit.Point);
30
using
Font
outFont = (
Font
)s_marshaler.MarshalNativeToManaged(native);
System\Windows\Forms\ControlPaintTests.cs (2)
1914
string s,
Font
font, Color color,
1962
string s,
Font
font, Color color,
System\Windows\Forms\ControlTests.ControlCollection.cs (8)
649
Font
font = new("Arial", 8.25f);
799
Font
font = new("Arial", 8.25f);
952
Font
font = new("Arial", 8.25f);
1025
Font
font = new("Arial", 8.25f);
2352
Font
font = new("Arial", 8.25f);
2496
Font
font = new("Arial", 8.25f);
2628
Font
font = new("Arial", 8.25f);
2692
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.cs (1)
493
Font
font = Control.DefaultFont;
System\Windows\Forms\ControlTests.Handlers.cs (3)
1784
using
Font
childFont1 = new("Arial", 1);
1785
using
Font
childFont2 = new("Arial", 2);
4488
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Methods.cs (1)
6438
using
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Properties.cs (27)
4797
using
Font
font1 = new("Arial", 8.25f);
4798
using
Font
font2 = new("Arial", 8.5f);
4817
using
Font
font1 = new("Arial", 8.25f);
4818
using
Font
font2 = new("Arial", 8.5f);
4836
public void Control_Font_Set_GetReturnsExpected(
Font
value)
4855
Font
font = new("Arial", 8.25f);
4862
public void Control_Font_SetWithFontHeight_GetReturnsExpected(
Font
value, int expectedFontHeight)
4882
Font
font = new("Arial", 8.25f);
4889
public void Control_Font_SetNonNullOldValueWithFontHeight_GetReturnsExpected(
Font
value, int expectedFontHeight)
4911
public void Control_Font_SetWithNonNullOldValue_GetReturnsExpected(
Font
value)
4941
public void Control_Font_SetWithHandle_GetReturnsExpected(bool userPaint,
Font
value, int expectedInvalidatedCallCount)
4984
public void Control_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint,
Font
value)
5033
using
Font
font1 = new("Arial", 8.25f);
5044
using
var
font2 = SystemFonts.DialogFont;
5096
using
Font
font1 = new("Arial", 8.25f);
5115
using
var
font2 = SystemFonts.DialogFont;
5149
using
Font
childFont1 = new("Arial", 1);
5150
using
Font
childFont2 = new("Arial", 1);
5189
using
Font
font1 = new("Arial", 8.25f);
5208
using
var
font2 = SystemFonts.DialogFont;
5246
using
Font
font = new("Arial", 8.25f);
5271
using
Font
font = new("Arial", 8.25f);
10718
Font
font1 = SystemFonts.CaptionFont;
10719
Font
font2 = SystemFonts.DialogFont;
10892
Font
font1 = SystemFonts.MenuFont;
10893
Font
font2 = SystemFonts.DialogFont;
10954
Font
controlFont = SystemFonts.StatusFont;
System\Windows\Forms\DataGridViewCellStyleTests.cs (3)
265
public void DataGridViewCellStyle_Font_Set_GetReturnsExpected(
Font
value)
838
Font
font = SystemFonts.DefaultFont;
1119
Font
font = SystemFonts.DefaultFont;
System\Windows\Forms\DataGridViewRowTests.cs (4)
2021
var
oldApplicationDefaultFont = Application.DefaultFont;
2022
using
Font
font = new("Times New Roman", 12);
2056
Font
font1 = SystemFonts.DefaultFont;
2057
Font
font2 = SystemFonts.MenuFont;
System\Windows\Forms\DataGridViewTests.cs (7)
2320
using
Font
formFont1 = new("Times New Roman", 12F, FontStyle.Regular);
2326
using
Font
customFont1 = new("Tahoma", 8.25F, FontStyle.Regular);
2327
using
Font
customFont2 = new("Consolas", 14F, FontStyle.Italic);
2328
using
Font
customFont3 = new("Arial", 9F, FontStyle.Bold);
2369
using
Font
formFont2 = new("Arial Black", 10F, FontStyle.Italic);
3507
using
Font
font1 = new("Arial", 12);
3508
using
Font
font2 = new("Times New Roman", 14);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
104
using
Font
formFont1 = new("Times New Roman", 12F, FontStyle.Regular);
111
using
Font
customCellStyleFont = new("Tahoma", 8.25F, FontStyle.Regular);
112
using
Font
customColumnHeaderFont = new("Consolas", 14F, FontStyle.Italic);
113
using
Font
customRowHeaderFont = new("Arial", 9F, FontStyle.Bold);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (6)
548
using
Font
font = new("Arial", 8.25f);
733
public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_ApplyCellStyleToEditingDataGridViewTextBoxEditingControl_Invoke_Success(DataGridViewCellStyle dataGridViewCellStyle,
Font
expectedFont, Color expectedBackColor, Color expectedForeColor, bool expectedWordWrap, HorizontalAlignment expectedTextAlign, bool expectedRepositionOnValueChange)
735
using
Font
oldFont = new("Arial", 8.25f);
757
using
Font
font = new("Arial", 8.25f);
942
public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_ApplyCellStyleToEditingDataGridViewTextBoxEditingControl_InvokeWithDataGridView_Success(DataGridViewCellStyle dataGridViewCellStyle,
Font
expectedFont, Color expectedBackColor, Color expectedEditingPanelBackColor, Color expectedForeColor, bool expectedWordWrap, HorizontalAlignment expectedTextAlign, bool expectedRepositionOnValueChange)
945
using
Font
oldFont = new("Arial", 8.25f);
System\Windows\Forms\DateTimePickerTests.cs (2)
284
using (
Font
expectedFont = new("Arial", 8.25f))
290
using (
Font
differentFont = new("Times New Roman", 10f))
System\Windows\Forms\DrawItemEventArgsTests.cs (2)
22
public void DrawItemEventArgs_Ctor_Graphics_Font_Rectangle_Int_DrawItemState(
Font
font, Rectangle rect, int index, DrawItemState state, Color expectedForeColor, Color expectedBackColor)
47
public void DrawItemEventArgs_Ctor_Graphics_Font_Rectangle_Int_DrawItemState_Color_Color(
Font
font, Rectangle rect, int index, DrawItemState state, Color foreColor, Color backColor)
System\Windows\Forms\DrawListViewColumnHeaderEventArgsTests.cs (3)
21
public void DrawListViewColumnHeaderEventArgs_Ctor_Graphics_Rectangle_Int_ColumnHeader_ListViewItemStates_Color_Color_Font(Rectangle bounds, int columnIndex, ColumnHeader header, ListViewItemStates state, Color foreColor, Color backColor,
Font
font)
73
public void DrawListViewColumnHeaderEventArgs_DrawBackground_Invoke_Success(Rectangle bounds, ColumnHeader header, ListViewItemStates state, Color foreColor, Color backColor,
Font
font)
111
public void DrawListViewColumnHeaderEventArgs_DrawText_NullHeader_Success(Rectangle bounds, int columnIndex, ListViewItemStates state, Color foreColor, Color backColor,
Font
font)
System\Windows\Forms\DrawToolTipEventArgsTests.cs (5)
20
public void Ctor_Graphics_IWin32Window_Control_Rectangle_String_Color_Color_Font(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor,
Font
font)
45
public void DrawBackground_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor,
Font
font)
55
public void DrawText_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor,
Font
font)
65
public void DrawText_InvokeTextFormatFlags_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor,
Font
font)
75
public void DrawBorder_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor,
Font
font)
System\Windows\Forms\FontCacheTests.cs (2)
13
Font
[] fonts = new
Font
[10];
System\Windows\Forms\FontDialogTests.cs (14)
229
using
Font
font = new("Arial", 8.25f);
241
using
Font
font = new("Arial", 8.25f);
247
Font
result = dialog.Font;
259
using
Font
font = new("Arial", 8.25f);
265
Font
result = dialog.Font;
277
using
Font
font = new("Arial", 8.25f);
291
Font
font = new("Arial", 8.25f);
297
public void FontDialog_Font_Set_GetReturnsExpected(
Font
value)
312
public void FontDialog_Font_SetWithCustomOldValue_GetReturnsExpected(
Font
value)
314
using
Font
font = new("Arial", 8.25f);
335
using
Font
font = new("Arial", 8.25f);
352
using
Font
font = new("Arial", 8.25f);
583
using
Font
font = new("Arial", 8.25f);
697
using
Font
font = new("Arial", 8.25f);
System\Windows\Forms\GroupBoxTests.cs (5)
576
using
Font
font = new("Arial", 8.25f);
589
using
Font
font = new("Arial", 8.25f);
603
var
originalFont = groupBox.Font;
604
using
Font
newFont = new(originalFont.FontFamily, originalFont.Size + 5, originalFont.Style);
611
Font
updatedCachedFont = accessor.Dynamic._cachedFont;
System\Windows\Forms\ListBoxTests.cs (6)
1051
public void ListBox_Font_Set_GetReturnsExpected(bool integralHeight,
Font
value)
1075
public void ListBox_Font_SetWithItems_GetReturnsExpected(bool integralHeight,
Font
value)
1111
public void ListBox_Font_SetWithHandle_GetReturnsExpected(bool integralHeight,
Font
value, int expectedInvalidatedCallCount1, int expectedInvalidatedCallCount2)
1157
public void ListBox_Font_SetWithItemsWithHandle_GetReturnsExpected(bool integralHeight,
Font
value, int expectedInvalidatedCallCount1, int expectedInvalidatedCallCount2)
1210
using
Font
font1 = new("Arial", 8.25f);
1221
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\ListViewItemConverterTests.cs (10)
192
new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(
Font
) },
198
new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(
Font
) },
204
new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(
Font
) },
210
new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
216
new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
222
new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
230
new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
236
new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(
Font
) },
242
new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
248
new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(
Font
) },
System\Windows\Forms\ListViewItemTests.cs (7)
52
public void ListViewItem_Ctor_StringArray_String_Color_Color_Font_ListViewGroup(string[] subItems, string imageKey, Color foreColor, Color backColor,
Font
font, ListViewGroup group, string expectedImageKey, Color expectedForeColor, Color expectedBackColor, string expectedText)
90
public void ListViewItem_Ctor_StringArray_Int_Color_Color_Font_ListViewGroup(string[] subItems, int imageIndex, Color foreColor, Color backColor,
Font
font, ListViewGroup group, Color expectedForeColor, Color expectedBackColor, string expectedText)
128
public void ListViewItem_Ctor_StringArray_String_Color_Color_Font(string[] subItems, string imageKey, Color foreColor, Color backColor,
Font
font, string expectedImageKey, Color expectedForeColor, Color expectedBackColor, string expectedText)
166
public void ListViewItem_Ctor_StringArray_Int_Color_Color_Font(string[] subItems, int imageIndex, Color foreColor, Color backColor,
Font
font, Color expectedForeColor, Color expectedBackColor, string expectedText)
962
public void ListViewItem_Font_GetWithOwner_ReturnsExpected(
Font
value)
980
public void ListViewItem_Font_Set_GetReturnsExpected(
Font
value)
996
public void ListViewItem_Font_SetWithOwner_GetReturnsExpected(
Font
value)
System\Windows\Forms\ListViewSubItemCollectionTests.cs (2)
264
public void ListViewSubItemCollection_Add_String_Color_Color_Font_Success(string text, Color foreColor, Color backColor,
Font
font, Color expectedForeColor, Color expectedBackColor, string expectedText)
394
public void ListViewSubItemCollection_AddRange_StringArrayWithStyles_Success(Color foreColor, Color backColor,
Font
font, Color expectedForeColor, Color expectedBackColor)
System\Windows\Forms\ListViewSubItemConverterTests.cs (1)
61
new Type[] { typeof(ListViewItem), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
System\Windows\Forms\ListViewSubItemTests.cs (4)
66
public void ListViewSubItem_Ctor_ListViewItem_String_Color_Color_Font(ListViewItem owner, string text, Color foreColor, Color backColor,
Font
font, Color expectedForeColor, Color expectedBackColor, string expectedText)
271
public void ListViewSubItem_Font_Set_GetReturnsExpected(
Font
value)
286
public void ListViewSubItem_Font_SetWithListViewItemWithListView_GetReturnsExpected(
Font
value)
310
public void ListViewSubItem_Font_SetWithListViewItem_GetReturnsExpected(
Font
value)
System\Windows\Forms\OwnerDrawPropertyBagTests.cs (1)
42
public void OwnerDrawPropertyBag_Font_Set_GetReturnsExpected(
Font
value)
System\Windows\Forms\PictureBoxTests.cs (3)
469
public void PictureBox_Font_Set_GetReturnsExpected(
Font
value)
500
using
Font
font1 = new("Arial", 8.25f);
511
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\ProgressBarTests.cs (3)
474
public void ProgressBar_Font_Set_GetReturnsExpected(
Font
value)
505
using
Font
font1 = new("Arial", 8.25f);
516
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\RichTextBoxTests.cs (29)
1331
public void RichTextBox_Font_Set_GetReturnsExpected(
Font
value)
1350
public void RichTextBox_Font_SetWithText_GetReturnsExpected(
Font
value)
1370
public void RichTextBox_Font_SetWithNonNullOldValue_GetReturnsExpected(
Font
value)
1372
using
Font
oldValue = new("Arial", 1);
1392
public void RichTextBox_Font_SetWithNonNullOldValueWithText_GetReturnsExpected(
Font
value)
1394
using
Font
oldValue = new("Arial", 1);
1424
public void RichTextBox_Font_SetWithHandle_GetReturnsExpected(bool userPaint,
Font
value, int expectedInvalidatedCallCount)
1458
public void RichTextBox_Font_SetWithTextWithHandle_GetReturnsExpected(bool userPaint,
Font
value, int expectedInvalidatedCallCount)
1504
public void RichTextBox_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint,
Font
value)
1506
using
Font
oldValue = new("Arial", 1);
1542
public void RichTextBox_Font_SetWithNonNullOldValueWithTextWithHandle_GetReturnsExpected(bool userPaint,
Font
value)
1544
using
Font
oldValue = new("Arial", 1);
1604
using (
Font
font = new(familyName, emSize, style, unit, gdiCharSet))
1647
using
Font
font1 = new("Arial", 8.25f);
1658
using
var
font2 = SystemFonts.DialogFont;
4660
Font
result1 = control.SelectionFont;
4665
Font
result2 = control.SelectionFont;
4683
Font
result1 = control.SelectionFont;
4691
Font
result2 = control.SelectionFont;
4754
Font
font = control.SelectionFont;
4822
using
Font
value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize);
4827
Font
result1 = control.SelectionFont;
4837
Font
result2 = control.SelectionFont;
4849
using
Font
value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize);
4860
Font
result1 = control.SelectionFont;
4873
Font
result2 = control.SelectionFont;
4891
public void RichTextBox_SelectionFont_SetCantCreateHandle_GetReturnsExpected(
Font
value)
4906
public void RichTextBox_SelectionFont_SetDisposed_ThrowsObjectDisposedException(
Font
value)
4925
public unsafe void RichTextBox_SelectionFont_GetCharFormat_Success(
Font
value, int expectedYHeight, int expectedEffects)
System\Windows\Forms\ScrollBarTests.cs (3)
482
public void ScrollBar_Font_Set_GetReturnsExpected(
Font
value)
513
using
Font
font1 = new("Arial", 8.25f);
524
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\SplitterTests.cs (3)
734
public void Splitter_Font_Set_GetReturnsExpected(
Font
value)
765
using
Font
font1 = new("Arial", 8.25f);
776
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\SystemInformationTests.cs (2)
445
Font
font = SystemInformation.MenuFont;
845
Font
font = SystemInformation.GetMenuFontForDpi(dpi);
System\Windows\Forms\TextRendererTests.cs (14)
33
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColor_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Point pt, Color foreColor)
67
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorColor_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Point pt, Color foreColor, Color backColor)
104
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Point pt, Color foreColor, TextFormatFlags flags)
145
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Point pt, Color foreColor, Color backColor, TextFormatFlags flags)
177
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColor_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Rectangle bounds, Color foreColor)
213
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorColor_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Rectangle rectangle, Color foreColor, Color backColor)
253
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Rectangle rectangle, Color foreColor, TextFormatFlags flags)
297
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Rectangle rectangle, Color foreColor, Color backColor, TextFormatFlags flags)
402
public void TextRenderer_MeasureText_InvokeStringFont_ReturnsExpected(string text,
Font
font)
426
public void TextRenderer_MeasureText_InvokeStringFontSize_ReturnsExpected(string text,
Font
font, Size proposedSize)
458
public void TextRenderer_MeasureText_InvokeStringFontSizeTextFormatFlags_ReturnsExpected(string text,
Font
font, Size proposedSize, TextFormatFlags flags)
470
public void TextRenderer_MeasureText_InvokeIDeviceContextStringFont_ReturnsExpected(string text,
Font
font)
485
public void TextRenderer_MeasureText_InvokeIDeviceContextStringFontSize_ReturnsExpected(string text,
Font
font, Size proposedSize)
500
public void TextRenderer_MeasureText_InvokeIDeviceContextStringFontSizeTextFormatFlags_ReturnsExpected(string text,
Font
font, Size proposedSize, TextFormatFlags flags)
System\Windows\Forms\ToolStripButtonTests.cs (3)
1273
using
Font
font = new("Arial", 8.25f);
1364
using
Font
font = new("Arial", 8.25f);
1463
using
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripControlHostTests.cs (5)
615
using
Font
value = new("Arial", 8.25f);
964
public void ToolStripControlHost_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value)
991
using
Font
font = new("Arial", 8.25f);
1003
using
Font
font = new("Arial", 8.25f);
1043
using
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripDropDownTests.cs (13)
1483
using
Font
font1 = new("Arial", 8.25f);
1484
using
Font
font2 = new("Arial", 8.5f);
1504
using
Font
font1 = new("Arial", 8.25f);
1505
using
Font
font2 = new("Arial", 8.5f);
1524
public void ToolStripDropDown_Font_Set_GetReturnsExpected(
Font
value)
1555
using
Font
font1 = new("Arial", 8.25f);
1566
using
var
font2 = SystemFonts.DialogFont;
1602
using
Font
font1 = new("Arial", 8.25f);
1617
using
var
font2 = SystemFonts.DialogFont;
1643
using
Font
childFont1 = new("Arial", 1);
1644
using
Font
childFont2 = new("Arial", 1);
1667
using
Font
font1 = new("Arial", 8.25f);
1682
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\ToolStripItemTests.cs (10)
2932
using
Font
font = new("Arial", 8.25f);
2950
using
Font
font = new("Arial", 8.25f);
2973
public void ToolStripItem_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value)
3003
public void ToolStripItem_Font_SetWithOwner_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value, int expectedOwnerLayoutCallCount)
3044
public void ToolStripItem_Font_SetWithOwnerWithHandle_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value, int expectedOwnerLayoutCallCount)
3097
public void ToolStripItem_Font_SetWithParent_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value)
3131
public void ToolStripItem_Font_SetWithParentWithHandle_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value)
3182
using
Font
font = new("Arial", 8.25f);
3211
using
Font
font = new("Arial", 8.25f);
14117
using
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (2)
19
public void Ctor_ToolStripItem_String_Rectangle_Color_Font_TextFormatFlags(ToolStripItem item, string text, Rectangle textRectangle, Color textColor,
Font
textFont, TextFormatFlags format)
45
public void Ctor_ToolStripItem_String_Rectangle_Color_Font_ContentAlignment(ToolStripItem item, string text, Rectangle textRectangle, Color textColor,
Font
textFont, ContentAlignment textAlign, TextFormatFlags expectedTextFormat)
System\Windows\Forms\ToolStripLabelTests.cs (4)
177
((
Font
)accessor._linkFont).Should().BeNull();
178
((
Font
)accessor._hoverLinkFont).Should().BeNull();
190
((
Font
)accessor._linkFont).Should().BeNull();
191
((
Font
)accessor._hoverLinkFont).Should().BeNull();
System\Windows\Forms\ToolStripRendererTests.cs (2)
310
public void ToolStripRenderer_DrawItemText_Invoke_CallsRenderItemText(ToolStripItem item, string text, Rectangle textRectangle, Color textColor,
Font
textFont, TextFormatFlags format)
839
public void ToolStripRenderer_OnRenderItemText_Invoke_Nop(ToolStripItem item, string text, Rectangle textRectangle, Color textColor,
Font
textFont, TextFormatFlags format)
System\Windows\Forms\ToolStripSeparatorTests.cs (1)
318
public void ToolStripSeparator_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value)
System\Windows\Forms\ToolStripTests.cs (17)
1399
using
Font
font1 = new("Arial", 8.25f);
1400
using
Font
font2 = new("Arial", 8.5f);
1420
using
Font
font1 = new("Arial", 8.25f);
1421
using
Font
font2 = new("Arial", 8.5f);
1440
public void ToolStrip_Font_Set_GetReturnsExpected(
Font
value)
1471
using
Font
font1 = new("Arial", 8.25f);
1482
using
var
font2 = SystemFonts.DialogFont;
1518
using
Font
font1 = new("Arial", 8.25f);
1533
using
var
font2 = SystemFonts.DialogFont;
1559
using
Font
childFont1 = new("Arial", 1);
1560
using
Font
childFont2 = new("Arial", 1);
1583
using
Font
font1 = new("Arial", 8.25f);
1598
using
var
font2 = SystemFonts.DialogFont;
1625
using
Font
font = new("Microsoft Sans Serif", 8.25f);
1645
using
Font
font = new("Microsoft Sans Serif", 8.25f);
5309
using
Font
childFont1 = new("Arial", 1);
5310
using
Font
childFont2 = new("Arial", 2);
System\Windows\Forms\TreeNodeTests.cs (9)
2799
public void TreeNode_NodeFont_Set_GetReturnsExpected(
Font
value)
2814
public void TreeNode_NodeFont_SetWithTreeView_GetReturnsExpected(
Font
value)
2838
public void TreeNode_NodeFont_SetWithTreeViewWithHandle_GetReturnsExpected(
Font
value, int expectedInvalidatedCallCount)
2869
public void TreeNode_NodeFont_SetWithCustomOldValue_GetReturnsExpected(
Font
value)
2871
using
Font
oldValue = new("Arial", 1);
2887
public void TreeNode_NodeFont_SetWithCustomOldValueWithTreeView_GetReturnsExpected(
Font
value)
2890
using
Font
oldValue = new("Arial", 1);
2915
public void TreeNode_NodeFont_SetWithCustomOldValueWithTreeViewWithHandle_GetReturnsExpected(
Font
value, int expectedInvalidatedCallCount)
2918
using
Font
oldValue = new("Arial", 1);
System\Windows\Forms\TreeViewTests.cs (3)
2702
Font
font = new(FontFamily.GenericSansSerif, 100);
2710
Font
smallFont = new(FontFamily.GenericSansSerif, 2);
2721
public void ItemHeight_Get_ReturnsExpected(
Font
font, bool checkBoxes, TreeViewDrawMode drawMode, int expectedHeight)
System\Windows\Forms\VisualStyles\VisualStyleRendererTests.cs (1)
573
using
Font
font = renderer.GetFont(graphics, FontProperty.TextFont);
Text\FontMetrics.cs (5)
18
using
Font
font = new(family, size);
37
using
Font
font = new(family, size);
58
using
Font
font = new(family, size);
76
using
Font
font = new(family, size);
133
using
Font
font = new(family, size);
TextBoxBaseTests.cs (15)
869
public void TextBoxBase_Font_Set_GetReturnsExpected(
Font
value)
888
public void TextBoxBase_Font_SetWithText_GetReturnsExpected(
Font
value)
908
public void TextBoxBase_Font_SetWithNonNullOldValue_GetReturnsExpected(
Font
value)
910
using
Font
oldValue = new("Arial", 1);
930
public void TextBoxBase_Font_SetWithNonNullOldValueWithText_GetReturnsExpected(
Font
value)
932
using
Font
oldValue = new("Arial", 1);
962
public void TextBoxBase_Font_SetWithHandle_GetReturnsExpected(bool userPaint,
Font
value, int expectedInvalidatedCallCount)
996
public void TextBoxBase_Font_SetWithTextWithHandle_GetReturnsExpected(bool userPaint,
Font
value, int expectedInvalidatedCallCount)
1042
public void TextBoxBase_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint,
Font
value)
1044
using
Font
oldValue = new("Arial", 1);
1080
public void TextBoxBase_Font_SetWithNonNullOldValueWithTextWithHandle_GetReturnsExpected(bool userPaint,
Font
value)
1082
using
Font
oldValue = new("Arial", 1);
1131
using
Font
font1 = new("Arial", 8.25f);
1142
using
var
font2 = SystemFonts.DialogFont;
1278
using
Font
font = new("Arial", 8.25f);
TrackBarTests.cs (3)
623
public void TrackBar_Font_Set_GetReturnsExpected(
Font
value)
654
using
Font
font1 = new("Arial", 8.25f);
665
using
var
font2 = SystemFonts.DialogFont;
System.Windows.Forms.TestUtilities (2)
CommonTestHelperEx.cs (2)
44
public static TheoryData<
Font
> GetFontTheoryData()
46
TheoryData<
Font
> data = new()
System.Windows.Forms.UI.IntegrationTests (1)
Dpi\ToolStripItemTests.Dpi.cs (1)
45
using
Font
initialFont = toolStrip.Font = new("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
WindowsFormsIntegration (5)
System\Windows\Integration\Convert.cs (3)
211
internal static double SystemDrawingFontToSystemWindowsFontSize(SD.
Font
font)
227
internal static FontWeight ToSystemWindowsFontWeight(SD.
Font
sdFont)
232
internal static FontStyle ToSystemWindowsFontStyle(SD.
Font
sdFont)
System\Windows\Integration\ElementHostPropertyMap.cs (2)
131
SD.
Font
wfFont = value as SD.
Font
;
WinFormsControlsTest (2)
DataGridViewTest.cs (1)
11
private static readonly
Font
[] s_fonts =
MenuStripAndCheckedListBox.cs (1)
38
Font
f = menuStrip1.Font;