363 instantiations of Font
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)
229
Font columnHeaderFont = new System.Drawing.
Font
(Font, System.Drawing.FontStyle.Bold);
MS\Internal\Documents\SigningDialog.cs (1)
262
_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 (15)
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\FocusableLabel.cs (2)
42
Font = new
Font
(Font, FontStyle.Underline);
52
Font = new
Font
(Font, FontStyle.Regular);
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)
2058
=>
new
(
System.Windows.Forms.Design (11)
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\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (1)
868
using Font boldFont =
new
(_selectedItemName.Font, FontStyle.Bold);
System.Windows.Forms.Design.Tests (3)
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (2)
18
Font expectedFont = new
Font
("Arial", 12.0f);
23
contextMenuStrip.Font = new
Font
("Times New Roman", 10.0f, FontStyle.Italic);
System\Windows\Forms\Design\DataGridViewAddColumnDialogTests.cs (1)
31
using Font expectedFont =
new
("Arial", 12);
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 (191)
CheckedListBoxTests.cs (1)
410
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)
163
using (Font font =
new
(FontFamily.GenericSansSerif, 9f))
210
using (Font font =
new
(FontFamily.GenericSansSerif, 9f))
356
NodeFont = new
Font
(FontFamily.GenericSansSerif, 9f)
System\Windows\Forms\ApplicationTests.cs (3)
222
Font font =
new
(new FontFamily("Arial"), 12f);
223
Font scaled =
new
(new FontFamily("Arial"), 16f);
312
using Font customFont =
new
(new FontFamily("Arial"), 12f);
System\Windows\Forms\AxHostTests.cs (6)
1448
using Font font =
new
("Arial", 10);
1477
using Font font =
new
("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10);
1511
using Font font =
new
("Arial", 10, unit);
1524
using Font font =
new
("Arial", 10);
1546
using Font font =
new
("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10);
1572
using Font font =
new
("Arial", 10, unit);
System\Windows\Forms\ButtonTests.cs (2)
691
using Font font =
new
("Arial", 100f);
721
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\ClipboardTests.cs (1)
1073
using Font font =
new
("Microsoft Sans Serif", emSize: 10);
System\Windows\Forms\ComboBoxTests.cs (1)
1019
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (1)
75
using Font newFont =
new
(font.Name, 20.0f);
System\Windows\Forms\ContainerControlTests.cs (1)
462
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\Control.ActiveXFontMarshallerTests.cs (1)
20
using Font font =
new
("Arial", 11.0f, GraphicsUnit.Point);
System\Windows\Forms\ControlTests.ControlCollection.cs (8)
651
Font font =
new
("Arial", 8.25f);
801
Font font =
new
("Arial", 8.25f);
954
Font font =
new
("Arial", 8.25f);
1027
Font font =
new
("Arial", 8.25f);
2354
Font font =
new
("Arial", 8.25f);
2498
Font font =
new
("Arial", 8.25f);
2630
Font font =
new
("Arial", 8.25f);
2694
Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ControlTests.Handlers.cs (3)
1786
using Font childFont1 =
new
("Arial", 1);
1787
using Font childFont2 =
new
("Arial", 2);
4490
Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ControlTests.Methods.cs (1)
6407
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ControlTests.Properties.cs (18)
4799
using Font font1 =
new
("Arial", 8.25f);
4800
using Font font2 =
new
("Arial", 8.5f);
4819
using Font font1 =
new
("Arial", 8.25f);
4820
using Font font2 =
new
("Arial", 8.5f);
4857
Font font =
new
("Arial", 8.25f);
4884
Font font =
new
("Arial", 8.25f);
4896
Font = new
Font
("Arial", 1)
4917
Font = new
Font
("Arial", 1)
4936
yield return new object[] { userPaint, new
Font
("Arial", 8.25f), 1 };
4979
yield return new object[] { userPaint, new
Font
("Arial", 8.25f) };
4990
Font = new
Font
("Arial", 1)
5035
using Font font1 =
new
("Arial", 8.25f);
5098
using Font font1 =
new
("Arial", 8.25f);
5151
using Font childFont1 =
new
("Arial", 1);
5152
using Font childFont2 =
new
("Arial", 1);
5191
using Font font1 =
new
("Arial", 8.25f);
5248
using Font font =
new
("Arial", 8.25f);
5273
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\DataGridViewRowTests.cs (1)
2024
using Font font =
new
("Times New Roman", 12);
System\Windows\Forms\DataGridViewTests.cs (7)
2322
using Font formFont1 =
new
("Times New Roman", 12F, FontStyle.Regular);
2328
using Font customFont1 =
new
("Tahoma", 8.25F, FontStyle.Regular);
2329
using Font customFont2 =
new
("Consolas", 14F, FontStyle.Italic);
2330
using Font customFont3 =
new
("Arial", 9F, FontStyle.Bold);
2371
using Font formFont2 =
new
("Arial Black", 10F, FontStyle.Italic);
3509
using Font font1 =
new
("Arial", 12);
3510
using Font font2 =
new
("Times New Roman", 14);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
106
using Font formFont1 =
new
("Times New Roman", 12F, FontStyle.Regular);
113
using Font customCellStyleFont =
new
("Tahoma", 8.25F, FontStyle.Regular);
114
using Font customColumnHeaderFont =
new
("Consolas", 14F, FontStyle.Italic);
115
using Font customRowHeaderFont =
new
("Arial", 9F, FontStyle.Bold);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (4)
550
using Font font =
new
("Arial", 8.25f);
737
using Font oldFont =
new
("Arial", 8.25f);
759
using Font font =
new
("Arial", 8.25f);
947
using Font oldFont =
new
("Arial", 8.25f);
System\Windows\Forms\DataObjectTests.cs (3)
2908
using Font value =
new
("Arial", 10);
2991
Font font =
new
("Consolas", emSize: 10);
3035
result.Font =
new
(fontFamily, size);
System\Windows\Forms\DateTimePickerTests.cs (2)
286
using (Font expectedFont =
new
("Arial", 8.25f))
292
using (Font differentFont =
new
("Times New Roman", 10f))
System\Windows\Forms\FontCacheTests.cs (1)
18
fonts[i] = new
Font
("Arial", i + 6);
System\Windows\Forms\FontDialogTests.cs (10)
231
using Font font =
new
("Arial", 8.25f);
243
using Font font =
new
("Arial", 8.25f);
261
using Font font =
new
("Arial", 8.25f);
279
using Font font =
new
("Arial", 8.25f);
293
Font font =
new
("Arial", 8.25f);
316
using Font font =
new
("Arial", 8.25f);
337
using Font font =
new
("Arial", 8.25f);
354
using Font font =
new
("Arial", 8.25f);
585
using Font font =
new
("Arial", 8.25f);
699
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\GroupBoxTests.cs (3)
578
using Font font =
new
("Arial", 8.25f);
591
using Font font =
new
("Arial", 8.25f);
606
using Font newFont =
new
(originalFont.FontFamily, originalFont.Size + 5, originalFont.Style);
System\Windows\Forms\LinkUtilitiesTests.cs (2)
37
using Font baseFont =
new
("Arial", 12);
54
using Font baseFont =
new
("Arial", 12);
System\Windows\Forms\ListBoxTests.cs (6)
1047
yield return new object[] { integralHeight, new
Font
("Arial", 8.25f) };
1107
yield return new object[] { true, new
Font
("Arial", 8.25f), 1, 1 };
1108
yield return new object[] { false, new
Font
("Arial", 8.25f), 1, 2 };
1153
yield return new object[] { true, new
Font
("Arial", 8.25f), 1, 1 };
1154
yield return new object[] { false, new
Font
("Arial", 8.25f), 2, 3 };
1212
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\Ole\BinaryFormatUtilitiesTests.cs (1)
95
using Font value =
new
("Microsoft Sans Serif", emSize: 10);
System\Windows\Forms\PictureBoxTests.cs (1)
502
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\ProgressBarTests.cs (1)
507
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\RichTextBoxTests.cs (19)
1374
using Font oldValue =
new
("Arial", 1);
1396
using Font oldValue =
new
("Arial", 1);
1419
yield return new object[] { userPaint, new
Font
("Arial", 8.25f), 1 };
1499
yield return new object[] { userPaint, new
Font
("Arial", 8.25f) };
1508
using Font oldValue =
new
("Arial", 1);
1546
using Font oldValue =
new
("Arial", 1);
1606
using (Font font =
new
(familyName, emSize, style, unit, gdiCharSet))
1649
using Font font1 =
new
("Arial", 8.25f);
4824
using Font value = hasStyle ? new
Font
(fontName, fontSize, fontStyle, units, gdiCharSet) : new
Font
(fontName, fontSize);
4851
using Font value = hasStyle ? new
Font
(fontName, fontSize, fontStyle, units, gdiCharSet) : new
Font
(fontName, fontSize);
4888
yield return new object[] { new
Font
("Arial", 8.25f) };
4917
yield return new object[] { new
Font
("Arial", 8.25f), 165, 0 };
4918
yield return new object[] { new
Font
("Arial", 8.25f, FontStyle.Bold), 165, CFE_EFFECTS.CFE_BOLD };
4919
yield return new object[] { new
Font
("Arial", 8.25f, FontStyle.Italic), 165, CFE_EFFECTS.CFE_ITALIC };
4920
yield return new object[] { new
Font
("Arial", 8.25f, FontStyle.Strikeout), 165, CFE_EFFECTS.CFE_STRIKEOUT };
4921
yield return new object[] { new
Font
("Arial", 8.25f, FontStyle.Underline), 165, CFE_EFFECTS.CFE_UNDERLINE };
4922
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)
515
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\SplitterTests.cs (1)
767
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\ToolStripButtonTests.cs (3)
1275
using Font font =
new
("Arial", 8.25f);
1366
using Font font =
new
("Arial", 8.25f);
1465
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ToolStripControlHostTests.cs (5)
617
using Font value =
new
("Arial", 8.25f);
960
yield return new object[] { displayStyle, new
Font
("Arial", 8.25f) };
993
using Font font =
new
("Arial", 8.25f);
1005
using Font font =
new
("Arial", 8.25f);
1045
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ToolStripDropDownTests.cs (9)
1485
using Font font1 =
new
("Arial", 8.25f);
1486
using Font font2 =
new
("Arial", 8.5f);
1506
using Font font1 =
new
("Arial", 8.25f);
1507
using Font font2 =
new
("Arial", 8.5f);
1557
using Font font1 =
new
("Arial", 8.25f);
1604
using Font font1 =
new
("Arial", 8.25f);
1645
using Font childFont1 =
new
("Arial", 1);
1646
using Font childFont2 =
new
("Arial", 1);
1669
using Font font1 =
new
("Arial", 8.25f);
System\Windows\Forms\ToolStripItemTests.cs (15)
2934
using Font font =
new
("Arial", 8.25f);
2952
using Font font =
new
("Arial", 8.25f);
2969
yield return new object[] { displayStyle, new
Font
("Arial", 8.25f) };
2997
yield return new object[] { ToolStripItemDisplayStyle.None, new
Font
("Arial", 8.25f), 0 };
2998
yield return new object[] { ToolStripItemDisplayStyle.Text, new
Font
("Arial", 8.25f), 1 };
2999
yield return new object[] { ToolStripItemDisplayStyle.Image, new
Font
("Arial", 8.25f), 0 };
3000
yield return new object[] { ToolStripItemDisplayStyle.ImageAndText, new
Font
("Arial", 8.25f), 1 };
3184
using Font font =
new
("Arial", 8.25f);
3213
using Font font =
new
("Arial", 8.25f);
12265
item.Font = new
Font
("Arial", 8.25f);
12303
item.Font = new
Font
("Arial", 8.25f);
12364
item.Font = new
Font
("Arial", 8.25f);
12406
item.Font = new
Font
("Arial", 8.25f);
12456
item.Font = new
Font
("Arial", 8.25f);
14119
using Font font =
new
("Arial", 8.25f);
System\Windows\Forms\ToolStripLabelTests.cs (5)
170
accessor._linkFont = new
Font
("Arial", 10);
171
accessor._hoverLinkFont = new
Font
("Arial", 10, FontStyle.Underline);
183
accessor._linkFont = new
Font
("Arial", 10);
184
accessor._hoverLinkFont = new
Font
("Arial", 10, FontStyle.Underline);
186
_toolStripLabel.Font = new
Font
("Times New Roman", 12);
System\Windows\Forms\ToolStripMenuItemTests.cs (1)
285
Font = new
Font
("Arial", 12),
System\Windows\Forms\ToolStripSeparatorTests.cs (1)
314
yield return new object[] { displayStyle, new
Font
("Arial", 8.25f) };
System\Windows\Forms\ToolStripTests.cs (13)
1401
using Font font1 =
new
("Arial", 8.25f);
1402
using Font font2 =
new
("Arial", 8.5f);
1422
using Font font1 =
new
("Arial", 8.25f);
1423
using Font font2 =
new
("Arial", 8.5f);
1473
using Font font1 =
new
("Arial", 8.25f);
1520
using Font font1 =
new
("Arial", 8.25f);
1561
using Font childFont1 =
new
("Arial", 1);
1562
using Font childFont2 =
new
("Arial", 1);
1585
using Font font1 =
new
("Arial", 8.25f);
1627
using Font font =
new
("Microsoft Sans Serif", 8.25f);
1647
using Font font =
new
("Microsoft Sans Serif", 8.25f);
5311
using Font childFont1 =
new
("Arial", 1);
5312
using Font childFont2 =
new
("Arial", 2);
System\Windows\Forms\ToolStripTextBoxTests.cs (1)
190
_toolStripTextBox.Font = new
Font
("Arial", 8.25f);
System\Windows\Forms\TreeNodeTests.cs (5)
2835
yield return new object[] { new
Font
("Arial", 8.25f), 1 };
2873
using Font oldValue =
new
("Arial", 1);
2892
using Font oldValue =
new
("Arial", 1);
2912
yield return new object[] { new
Font
("Arial", 8.25f), 1 };
2920
using Font oldValue =
new
("Arial", 1);
System\Windows\Forms\TreeViewTests.cs (2)
2704
Font font =
new
(FontFamily.GenericSansSerif, 100);
2712
Font smallFont =
new
(FontFamily.GenericSansSerif, 2);
Text\FontMetrics.cs (5)
20
using Font font =
new
(family, size);
39
using Font font =
new
(family, size);
60
using Font font =
new
(family, size);
78
using Font font =
new
(family, size);
135
using Font font =
new
(family, size);
TextBoxBaseTests.cs (8)
912
using Font oldValue =
new
("Arial", 1);
934
using Font oldValue =
new
("Arial", 1);
957
yield return new object[] { userPaint, new
Font
("Arial", 8.25f), 1 };
1037
yield return new object[] { userPaint, new
Font
("Arial", 8.25f) };
1046
using Font oldValue =
new
("Arial", 1);
1084
using Font oldValue =
new
("Arial", 1);
1133
using Font font1 =
new
("Arial", 8.25f);
1280
using Font font =
new
("Arial", 8.25f);
TrackBarTests.cs (1)
656
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);
TestPassApp (1)
PrintingControls.cs (1)
22
Font font =
new
("Times New Roman", 30);
WindowsFormsIntegration (4)
System\Windows\Integration\WindowsFormsHostPropertyMap.cs (4)
141
adapter.Font = new SD.
Font
(familySource, adapter.Font.Size, adapter.Font.Style);
172
adapter.Font = new SD.
Font
(CurrentFontFamily, CurrentFontSize, style);
193
adapter.Font = new SD.
Font
(CurrentFontFamily, CurrentFontSize, style);
209
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);
863 references to Font
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\ApplicationServices\ApplyApplicationDefaultsEventArgs.vb (1)
49
Public Property Font As
Font
PresentationUI (1)
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
229
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.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 (335)
System\Drawing\Design\UITypeEditor.cs (1)
55
[typeof(
Font
)] = $"System.Drawing.Design.FontEditor, {(Assemblies.SystemDrawingDesign)}",
System\Windows\Forms\ActiveX\AxHost.cs (10)
65
private static ConditionalWeakTable<
Font
, object>? s_fontTable;
339
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!;
1351
/// Sets the default <see cref="
Font
"/> for process.
1368
public static void SetDefaultFont(
Font
font)
1397
Font
newSystemFont = SystemFonts.GetFontByName(s_defaultFont.SystemFontName)!;
1410
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)
174
private static
Font
? s_defaultFont;
279
private
Font
? _scaledControlFont;
287
private Dictionary<int,
Font
>? _dpiFonts;
1558
public static
Font
DefaultFont
1803
public virtual
Font
Font
1811
Font
? previous = Properties.GetValueOrDefault<
Font
>(s_fontProperty);
1819
Font
currentFont = Font;
1860
internal
Font
GetScaledFont(
Font
font, int newDpi, int oldDpi)
1866
_dpiFonts ??= new Dictionary<int,
Font
>
1871
if (_dpiFonts.TryGetValue(newDpi, out
Font
? scaledFont))
1891
foreach (
Font
font in _dpiFonts.Values)
1918
if (TryGetExplicitlySetFont(out
Font
? font))
1937
if (Properties.TryGetValue(s_currentAmbientFontProperty, out
Font
? currentAmbient) && currentAmbient == ambientFont)
1965
if (TryGetExplicitlySetFont(out
Font
? font))
2909
internal
Font
? ScaledControlFont
2947
Font
? oldFont = null;
4154
Font
oldFont = Font;
5467
private
Font
GetCurrentFontAndDpi(out int fontDpi)
5477
if (TryGetExplicitlySetFont(out
Font
? font))
7345
Font
localFont = GetCurrentFontAndDpi(out int fontDpi);
7356
Font
fontForDpi = GetScaledFont(localFont, _deviceDpi, fontDpi);
10682
private protected bool TryGetExplicitlySetFont([NotNullWhen(true)] out
Font
? font) =>
10690
private protected void SetScaledFont(
Font
scaledFont, bool raiseOnFontChangedEvent = true)
11473
Font
localFont = GetCurrentFontAndDpi(out int fontDpi);
12522
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,
3958
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)
280
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)
62
private
Font
? _defaultFont;
516
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))
2320
private
Font
? GetOwnerFont() => Owner?.Font;
3186
Font
f = Font;
3635
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)
23
private static
Font
? s_defaultFont;
24
private static readonly ConcurrentDictionary<int,
Font
> s_defaultFontCache = new();
50
internal static
Font
DefaultFont
59
Font
? sysFont;
66
if (!s_defaultFontCache.TryGetValue(dpi, out
Font
? retFont))
90
Font
? retFont = s_defaultFont;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
866
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)
217
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\Unsupported\DataGrid\DataGrid.cs (2)
104
public
Font
CaptionFont
264
public
Font
HeaderFont
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGridTableStyle.cs (1)
140
public
Font
HeaderFont
System\Windows\Forms\Controls\Unsupported\StatusBar\StatusBar.cs (1)
71
public override Drawing.
Font
Font
System\Windows\Forms\Controls\Unsupported\StatusBar\StatusBarDrawItemEventArgs.cs (2)
25
Font
font,
38
Font
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)
1399
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)
1943
Font
font,
1975
Font
font,
1992
Font
font,
2057
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)
2328
Font
font;
2331
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 (37)
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\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (2)
640
Font
measureFont = Font;
868
using
Font
boldFont = new(_selectedItemName.Font, FontStyle.Bold);
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 (3)
EnsureEditorsTests.cs (1)
52
[InlineData(typeof(
Font
), typeof(FontEditor))]
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (1)
18
Font
expectedFont = new Font("Arial", 12.0f);
System\Windows\Forms\Design\DataGridViewAddColumnDialogTests.cs (1)
31
using
Font
expectedFont = new("Arial", 12);
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 (357)
CheckedListBoxTests.cs (2)
415
public void CheckedListBox_OnDrawItem_Invoke_Success(
Font
font, Rectangle rect, int index, DrawItemState state, Color foreColor, Color backColor)
430
public void CheckedListBox_OnDrawItem_InvokeWithHandle_Success(
Font
font, Rectangle rect, int index, DrawItemState state, Color foreColor, Color backColor)
SerializableTypesTests.cs (2)
163
using (
Font
font = new(FontFamily.GenericSansSerif, 9f))
210
using (
Font
font = new(FontFamily.GenericSansSerif, 9f))
System\Windows\Forms\AmbientPropertiesTests.cs (1)
56
public void Font_Set_GetReturnsExpected(
Font
value)
System\Windows\Forms\ApplicationTests.cs (11)
199
Font
customFont = (
Font
)SystemFonts.CaptionFont.Clone();
222
Font
font = new(new FontFamily("Arial"), 12f);
223
Font
scaled = new(new FontFamily("Arial"), 16f);
260
Font
font = applicationTestAccessor.s_defaultFont;
272
using
Font
sysFont = SystemFonts.CaptionFont;
283
using
Font
fakeSysFont = sysFont.WithSize(sysFont.Size * 1.25f);
307
Font
font = applicationTestAccessor.s_defaultFont;
312
using
Font
customFont = new(new FontFamily("Arial"), 12f);
641
private static void AreFontEqual(
Font
expected,
Font
actual)
System\Windows\Forms\AxHostTests.cs (14)
518
public void AxHost_Font_Set_GetReturnsExpected(
Font
value)
1448
using
Font
font = new("Arial", 10);
1461
Font
result = SubAxHost.GetFontFromIFont(iFont);
1477
using
Font
font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10);
1490
Font
result = SubAxHost.GetFontFromIFont(iFont);
1511
using
Font
font = new("Arial", 10, unit);
1524
using
Font
font = new("Arial", 10);
1536
Font
result = SubAxHost.GetFontFromIFont(iFont);
1546
using
Font
font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10);
1557
Font
result = SubAxHost.GetFontFromIFont(iFont);
1572
using
Font
font = new("Arial", 10, unit);
3228
public static new
Font
GetFontFromIFont(object font) => AxHost.GetFontFromIFont(font);
3230
public static new object GetIFontDispFromFont(
Font
font) => AxHost.GetIFontDispFromFont(font);
3232
public static new object GetIFontFromFont(
Font
font) => AxHost.GetIFontFromFont(font);
System\Windows\Forms\ButtonTests.cs (4)
670
public void Button_Font_Set_GetReturnsExpected(
Font
value)
691
using
Font
font = new("Arial", 100f);
721
using
Font
font1 = new("Arial", 8.25f);
732
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\ClipboardTests.cs (3)
1073
using
Font
font = new("Microsoft Sans Serif", emSize: 10);
1075
Action a1 = () => JsonSerializer.Deserialize<
Font
>(serialized);
1080
Clipboard.TryGetData(format, out
Font
? result).Should().BeFalse();
System\Windows\Forms\ComboBoxTests.cs (3)
988
public void ComboBox_Font_Set_GetReturnsExpected(
Font
value)
1019
using
Font
font1 = new("Arial", 8.25f);
1030
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (5)
40
using
Font
? font = (
Font
?)converter.ConvertNativeToManaged((VARIANT)(IUnknown*)iFont, s_stubDescriptor);
72
using
Font
? font = (
Font
?)converter.ConvertNativeToManaged((VARIANT)(IUnknown*)iFont, s_stubDescriptor);
75
using
Font
newFont = new(font.Name, 20.0f);
System\Windows\Forms\ContainerControlTests.cs (4)
408
public void ContainerControl_Font_Set_GetReturnsExpected(
Font
value)
427
public void ContainerControl_Font_SetWithAutoScaleModeFont_GetReturnsExpected(
Font
value)
462
using
Font
font1 = new("Arial", 8.25f);
473
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\Control.ActiveXFontMarshallerTests.cs (3)
20
using
Font
font = new("Arial", 11.0f, GraphicsUnit.Point);
28
using
Font
outFont = (
Font
)s_marshaler.MarshalNativeToManaged(native);
System\Windows\Forms\ControlPaintTests.cs (2)
1916
string s,
Font
font, Color color,
1964
string s,
Font
font, Color color,
System\Windows\Forms\ControlTests.ControlCollection.cs (8)
651
Font
font = new("Arial", 8.25f);
801
Font
font = new("Arial", 8.25f);
954
Font
font = new("Arial", 8.25f);
1027
Font
font = new("Arial", 8.25f);
2354
Font
font = new("Arial", 8.25f);
2498
Font
font = new("Arial", 8.25f);
2630
Font
font = new("Arial", 8.25f);
2694
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.cs (1)
495
Font
font = Control.DefaultFont;
System\Windows\Forms\ControlTests.Handlers.cs (3)
1786
using
Font
childFont1 = new("Arial", 1);
1787
using
Font
childFont2 = new("Arial", 2);
4490
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Methods.cs (1)
6407
using
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Properties.cs (27)
4799
using
Font
font1 = new("Arial", 8.25f);
4800
using
Font
font2 = new("Arial", 8.5f);
4819
using
Font
font1 = new("Arial", 8.25f);
4820
using
Font
font2 = new("Arial", 8.5f);
4838
public void Control_Font_Set_GetReturnsExpected(
Font
value)
4857
Font
font = new("Arial", 8.25f);
4864
public void Control_Font_SetWithFontHeight_GetReturnsExpected(
Font
value, int expectedFontHeight)
4884
Font
font = new("Arial", 8.25f);
4891
public void Control_Font_SetNonNullOldValueWithFontHeight_GetReturnsExpected(
Font
value, int expectedFontHeight)
4913
public void Control_Font_SetWithNonNullOldValue_GetReturnsExpected(
Font
value)
4943
public void Control_Font_SetWithHandle_GetReturnsExpected(bool userPaint,
Font
value, int expectedInvalidatedCallCount)
4986
public void Control_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint,
Font
value)
5035
using
Font
font1 = new("Arial", 8.25f);
5046
using
var
font2 = SystemFonts.DialogFont;
5098
using
Font
font1 = new("Arial", 8.25f);
5117
using
var
font2 = SystemFonts.DialogFont;
5151
using
Font
childFont1 = new("Arial", 1);
5152
using
Font
childFont2 = new("Arial", 1);
5191
using
Font
font1 = new("Arial", 8.25f);
5210
using
var
font2 = SystemFonts.DialogFont;
5248
using
Font
font = new("Arial", 8.25f);
5273
using
Font
font = new("Arial", 8.25f);
10720
Font
font1 = SystemFonts.CaptionFont;
10721
Font
font2 = SystemFonts.DialogFont;
10894
Font
font1 = SystemFonts.MenuFont;
10895
Font
font2 = SystemFonts.DialogFont;
10956
Font
controlFont = SystemFonts.StatusFont;
System\Windows\Forms\DataGridViewCellStyleTests.cs (3)
267
public void DataGridViewCellStyle_Font_Set_GetReturnsExpected(
Font
value)
840
Font
font = SystemFonts.DefaultFont;
1121
Font
font = SystemFonts.DefaultFont;
System\Windows\Forms\DataGridViewRowTests.cs (4)
2023
var
oldApplicationDefaultFont = Application.DefaultFont;
2024
using
Font
font = new("Times New Roman", 12);
2058
Font
font1 = SystemFonts.DefaultFont;
2059
Font
font2 = SystemFonts.MenuFont;
System\Windows\Forms\DataGridViewTests.cs (7)
2322
using
Font
formFont1 = new("Times New Roman", 12F, FontStyle.Regular);
2328
using
Font
customFont1 = new("Tahoma", 8.25F, FontStyle.Regular);
2329
using
Font
customFont2 = new("Consolas", 14F, FontStyle.Italic);
2330
using
Font
customFont3 = new("Arial", 9F, FontStyle.Bold);
2371
using
Font
formFont2 = new("Arial Black", 10F, FontStyle.Italic);
3509
using
Font
font1 = new("Arial", 12);
3510
using
Font
font2 = new("Times New Roman", 14);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
106
using
Font
formFont1 = new("Times New Roman", 12F, FontStyle.Regular);
113
using
Font
customCellStyleFont = new("Tahoma", 8.25F, FontStyle.Regular);
114
using
Font
customColumnHeaderFont = new("Consolas", 14F, FontStyle.Italic);
115
using
Font
customRowHeaderFont = new("Arial", 9F, FontStyle.Bold);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (6)
550
using
Font
font = new("Arial", 8.25f);
735
public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_ApplyCellStyleToEditingDataGridViewTextBoxEditingControl_Invoke_Success(DataGridViewCellStyle dataGridViewCellStyle,
Font
expectedFont, Color expectedBackColor, Color expectedForeColor, bool expectedWordWrap, HorizontalAlignment expectedTextAlign, bool expectedRepositionOnValueChange)
737
using
Font
oldFont = new("Arial", 8.25f);
759
using
Font
font = new("Arial", 8.25f);
944
public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_ApplyCellStyleToEditingDataGridViewTextBoxEditingControl_InvokeWithDataGridView_Success(DataGridViewCellStyle dataGridViewCellStyle,
Font
expectedFont, Color expectedBackColor, Color expectedEditingPanelBackColor, Color expectedForeColor, bool expectedWordWrap, HorizontalAlignment expectedTextAlign, bool expectedRepositionOnValueChange)
947
using
Font
oldFont = new("Arial", 8.25f);
System\Windows\Forms\DataObjectExtensionsTests.cs (1)
91
dataObject.TryGetData(DataFormats.Serializable, autoConvert, out
Font
? font).Should().BeFalse();
System\Windows\Forms\DataObjectTests.cs (7)
2908
using
Font
value = new("Arial", 10);
2991
Font
font = new("Consolas", emSize: 10);
3016
public
Font
Font { get; set; }
3059
case nameof(
Font
.FontFamily):
3062
case nameof(
Font
.Size):
3079
writer.WriteString(nameof(
Font
.FontFamily), value.Font.FontFamily.Name);
3080
writer.WriteNumber(nameof(
Font
.Size), value.Font.Size);
System\Windows\Forms\DateTimePickerTests.cs (2)
286
using (
Font
expectedFont = new("Arial", 8.25f))
292
using (
Font
differentFont = new("Times New Roman", 10f))
System\Windows\Forms\DrawItemEventArgsTests.cs (2)
24
public void DrawItemEventArgs_Ctor_Graphics_Font_Rectangle_Int_DrawItemState(
Font
font, Rectangle rect, int index, DrawItemState state, Color expectedForeColor, Color expectedBackColor)
49
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)
23
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)
75
public void DrawListViewColumnHeaderEventArgs_DrawBackground_Invoke_Success(Rectangle bounds, ColumnHeader header, ListViewItemStates state, Color foreColor, Color backColor,
Font
font)
113
public void DrawListViewColumnHeaderEventArgs_DrawText_NullHeader_Success(Rectangle bounds, int columnIndex, ListViewItemStates state, Color foreColor, Color backColor,
Font
font)
System\Windows\Forms\DrawToolTipEventArgsTests.cs (5)
22
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)
47
public void DrawBackground_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor,
Font
font)
57
public void DrawText_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor,
Font
font)
67
public void DrawText_InvokeTextFormatFlags_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor,
Font
font)
77
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)
15
Font
[] fonts = new
Font
[10];
System\Windows\Forms\FontDialogTests.cs (14)
231
using
Font
font = new("Arial", 8.25f);
243
using
Font
font = new("Arial", 8.25f);
249
Font
result = dialog.Font;
261
using
Font
font = new("Arial", 8.25f);
267
Font
result = dialog.Font;
279
using
Font
font = new("Arial", 8.25f);
293
Font
font = new("Arial", 8.25f);
299
public void FontDialog_Font_Set_GetReturnsExpected(
Font
value)
314
public void FontDialog_Font_SetWithCustomOldValue_GetReturnsExpected(
Font
value)
316
using
Font
font = new("Arial", 8.25f);
337
using
Font
font = new("Arial", 8.25f);
354
using
Font
font = new("Arial", 8.25f);
585
using
Font
font = new("Arial", 8.25f);
699
using
Font
font = new("Arial", 8.25f);
System\Windows\Forms\GroupBoxTests.cs (5)
578
using
Font
font = new("Arial", 8.25f);
591
using
Font
font = new("Arial", 8.25f);
605
var
originalFont = groupBox.Font;
606
using
Font
newFont = new(originalFont.FontFamily, originalFont.Size + 5, originalFont.Style);
613
Font
updatedCachedFont = accessor.Dynamic._cachedFont;
System\Windows\Forms\LinkUtilitiesTests.cs (10)
37
using
Font
baseFont = new("Arial", 12);
38
Font
? linkFont = null;
39
Font
? hoverLinkFont = null;
44
linkFont.Should().BeOfType<
Font
>();
45
hoverLinkFont.Should().BeOfType<
Font
>();
54
using
Font
baseFont = new("Arial", 12);
55
Font
? linkFont = null;
56
Font
? hoverLinkFont = null;
61
linkFont.Should().BeOfType<
Font
>();
62
hoverLinkFont.Should().BeOfType<
Font
>();
System\Windows\Forms\ListBoxTests.cs (6)
1053
public void ListBox_Font_Set_GetReturnsExpected(bool integralHeight,
Font
value)
1077
public void ListBox_Font_SetWithItems_GetReturnsExpected(bool integralHeight,
Font
value)
1113
public void ListBox_Font_SetWithHandle_GetReturnsExpected(bool integralHeight,
Font
value, int expectedInvalidatedCallCount1, int expectedInvalidatedCallCount2)
1159
public void ListBox_Font_SetWithItemsWithHandle_GetReturnsExpected(bool integralHeight,
Font
value, int expectedInvalidatedCallCount1, int expectedInvalidatedCallCount2)
1212
using
Font
font1 = new("Arial", 8.25f);
1223
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\ListViewItemConverterTests.cs (10)
194
new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(
Font
) },
200
new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(
Font
) },
206
new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(
Font
) },
212
new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
218
new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
224
new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
232
new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
238
new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(
Font
) },
244
new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
250
new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(
Font
) },
System\Windows\Forms\ListViewItemTests.cs (7)
54
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)
92
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)
130
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)
168
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)
964
public void ListViewItem_Font_GetWithOwner_ReturnsExpected(
Font
value)
982
public void ListViewItem_Font_Set_GetReturnsExpected(
Font
value)
998
public void ListViewItem_Font_SetWithOwner_GetReturnsExpected(
Font
value)
System\Windows\Forms\ListViewSubItemCollectionTests.cs (2)
266
public void ListViewSubItemCollection_Add_String_Color_Color_Font_Success(string text, Color foreColor, Color backColor,
Font
font, Color expectedForeColor, Color expectedBackColor, string expectedText)
396
public void ListViewSubItemCollection_AddRange_StringArrayWithStyles_Success(Color foreColor, Color backColor,
Font
font, Color expectedForeColor, Color expectedBackColor)
System\Windows\Forms\ListViewSubItemConverterTests.cs (1)
63
new Type[] { typeof(ListViewItem), typeof(string), typeof(Color), typeof(Color), typeof(
Font
) },
System\Windows\Forms\ListViewSubItemTests.cs (4)
68
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)
273
public void ListViewSubItem_Font_Set_GetReturnsExpected(
Font
value)
288
public void ListViewSubItem_Font_SetWithListViewItemWithListView_GetReturnsExpected(
Font
value)
312
public void ListViewSubItem_Font_SetWithListViewItem_GetReturnsExpected(
Font
value)
System\Windows\Forms\Ole\BinaryFormatUtilitiesTests.cs (7)
73
(typeof(
Font
).FullName, typeof(
Font
)),
95
using
Font
value = new("Microsoft Sans Serif", emSize: 10);
98
RoundTripOfType(value, FontResolver, out
Font
? result).Should().BeTrue();
99
result.Should().BeOfType<
Font
>().Which.Should().Be(value);
144
Font
? font = result.Should().BeOfType<
Font
>().Subject;
System\Windows\Forms\OwnerDrawPropertyBagTests.cs (1)
44
public void OwnerDrawPropertyBag_Font_Set_GetReturnsExpected(
Font
value)
System\Windows\Forms\PictureBoxTests.cs (3)
471
public void PictureBox_Font_Set_GetReturnsExpected(
Font
value)
502
using
Font
font1 = new("Arial", 8.25f);
513
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\ProgressBarTests.cs (3)
476
public void ProgressBar_Font_Set_GetReturnsExpected(
Font
value)
507
using
Font
font1 = new("Arial", 8.25f);
518
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\RichTextBoxTests.cs (29)
1333
public void RichTextBox_Font_Set_GetReturnsExpected(
Font
value)
1352
public void RichTextBox_Font_SetWithText_GetReturnsExpected(
Font
value)
1372
public void RichTextBox_Font_SetWithNonNullOldValue_GetReturnsExpected(
Font
value)
1374
using
Font
oldValue = new("Arial", 1);
1394
public void RichTextBox_Font_SetWithNonNullOldValueWithText_GetReturnsExpected(
Font
value)
1396
using
Font
oldValue = new("Arial", 1);
1426
public void RichTextBox_Font_SetWithHandle_GetReturnsExpected(bool userPaint,
Font
value, int expectedInvalidatedCallCount)
1460
public void RichTextBox_Font_SetWithTextWithHandle_GetReturnsExpected(bool userPaint,
Font
value, int expectedInvalidatedCallCount)
1506
public void RichTextBox_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint,
Font
value)
1508
using
Font
oldValue = new("Arial", 1);
1544
public void RichTextBox_Font_SetWithNonNullOldValueWithTextWithHandle_GetReturnsExpected(bool userPaint,
Font
value)
1546
using
Font
oldValue = new("Arial", 1);
1606
using (
Font
font = new(familyName, emSize, style, unit, gdiCharSet))
1649
using
Font
font1 = new("Arial", 8.25f);
1660
using
var
font2 = SystemFonts.DialogFont;
4662
Font
result1 = control.SelectionFont;
4667
Font
result2 = control.SelectionFont;
4685
Font
result1 = control.SelectionFont;
4693
Font
result2 = control.SelectionFont;
4756
Font
font = control.SelectionFont;
4824
using
Font
value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize);
4829
Font
result1 = control.SelectionFont;
4839
Font
result2 = control.SelectionFont;
4851
using
Font
value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize);
4862
Font
result1 = control.SelectionFont;
4875
Font
result2 = control.SelectionFont;
4893
public void RichTextBox_SelectionFont_SetCantCreateHandle_GetReturnsExpected(
Font
value)
4908
public void RichTextBox_SelectionFont_SetDisposed_ThrowsObjectDisposedException(
Font
value)
4927
public unsafe void RichTextBox_SelectionFont_GetCharFormat_Success(
Font
value, int expectedYHeight, int expectedEffects)
System\Windows\Forms\ScrollBarTests.cs (3)
484
public void ScrollBar_Font_Set_GetReturnsExpected(
Font
value)
515
using
Font
font1 = new("Arial", 8.25f);
526
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\SplitterTests.cs (3)
736
public void Splitter_Font_Set_GetReturnsExpected(
Font
value)
767
using
Font
font1 = new("Arial", 8.25f);
778
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\SystemInformationTests.cs (2)
447
Font
font = SystemInformation.MenuFont;
847
Font
font = SystemInformation.GetMenuFontForDpi(dpi);
System\Windows\Forms\TextRendererTests.cs (14)
35
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColor_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Point pt, Color foreColor)
69
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorColor_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Point pt, Color foreColor, Color backColor)
106
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Point pt, Color foreColor, TextFormatFlags flags)
147
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Point pt, Color foreColor, Color backColor, TextFormatFlags flags)
179
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColor_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Rectangle bounds, Color foreColor)
215
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorColor_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Rectangle rectangle, Color foreColor, Color backColor)
255
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Rectangle rectangle, Color foreColor, TextFormatFlags flags)
299
public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text,
Font
font, Rectangle rectangle, Color foreColor, Color backColor, TextFormatFlags flags)
404
public void TextRenderer_MeasureText_InvokeStringFont_ReturnsExpected(string text,
Font
font)
428
public void TextRenderer_MeasureText_InvokeStringFontSize_ReturnsExpected(string text,
Font
font, Size proposedSize)
460
public void TextRenderer_MeasureText_InvokeStringFontSizeTextFormatFlags_ReturnsExpected(string text,
Font
font, Size proposedSize, TextFormatFlags flags)
472
public void TextRenderer_MeasureText_InvokeIDeviceContextStringFont_ReturnsExpected(string text,
Font
font)
487
public void TextRenderer_MeasureText_InvokeIDeviceContextStringFontSize_ReturnsExpected(string text,
Font
font, Size proposedSize)
502
public void TextRenderer_MeasureText_InvokeIDeviceContextStringFontSizeTextFormatFlags_ReturnsExpected(string text,
Font
font, Size proposedSize, TextFormatFlags flags)
System\Windows\Forms\ToolStripButtonTests.cs (3)
1275
using
Font
font = new("Arial", 8.25f);
1366
using
Font
font = new("Arial", 8.25f);
1465
using
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripControlHostTests.cs (5)
617
using
Font
value = new("Arial", 8.25f);
966
public void ToolStripControlHost_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value)
993
using
Font
font = new("Arial", 8.25f);
1005
using
Font
font = new("Arial", 8.25f);
1045
using
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripDropDownTests.cs (13)
1485
using
Font
font1 = new("Arial", 8.25f);
1486
using
Font
font2 = new("Arial", 8.5f);
1506
using
Font
font1 = new("Arial", 8.25f);
1507
using
Font
font2 = new("Arial", 8.5f);
1526
public void ToolStripDropDown_Font_Set_GetReturnsExpected(
Font
value)
1557
using
Font
font1 = new("Arial", 8.25f);
1568
using
var
font2 = SystemFonts.DialogFont;
1604
using
Font
font1 = new("Arial", 8.25f);
1619
using
var
font2 = SystemFonts.DialogFont;
1645
using
Font
childFont1 = new("Arial", 1);
1646
using
Font
childFont2 = new("Arial", 1);
1669
using
Font
font1 = new("Arial", 8.25f);
1684
using
var
font2 = SystemFonts.DialogFont;
System\Windows\Forms\ToolStripItemTests.cs (10)
2934
using
Font
font = new("Arial", 8.25f);
2952
using
Font
font = new("Arial", 8.25f);
2975
public void ToolStripItem_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value)
3005
public void ToolStripItem_Font_SetWithOwner_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value, int expectedOwnerLayoutCallCount)
3046
public void ToolStripItem_Font_SetWithOwnerWithHandle_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value, int expectedOwnerLayoutCallCount)
3099
public void ToolStripItem_Font_SetWithParent_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value)
3133
public void ToolStripItem_Font_SetWithParentWithHandle_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value)
3184
using
Font
font = new("Arial", 8.25f);
3213
using
Font
font = new("Arial", 8.25f);
14119
using
Font
font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (2)
21
public void Ctor_ToolStripItem_String_Rectangle_Color_Font_TextFormatFlags(ToolStripItem item, string text, Rectangle textRectangle, Color textColor,
Font
textFont, TextFormatFlags format)
47
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)
175
((
Font
)accessor._linkFont).Should().BeNull();
176
((
Font
)accessor._hoverLinkFont).Should().BeNull();
188
((
Font
)accessor._linkFont).Should().BeNull();
189
((
Font
)accessor._hoverLinkFont).Should().BeNull();
System\Windows\Forms\ToolStripRendererTests.cs (2)
312
public void ToolStripRenderer_DrawItemText_Invoke_CallsRenderItemText(ToolStripItem item, string text, Rectangle textRectangle, Color textColor,
Font
textFont, TextFormatFlags format)
841
public void ToolStripRenderer_OnRenderItemText_Invoke_Nop(ToolStripItem item, string text, Rectangle textRectangle, Color textColor,
Font
textFont, TextFormatFlags format)
System\Windows\Forms\ToolStripSeparatorTests.cs (1)
320
public void ToolStripSeparator_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle,
Font
value)
System\Windows\Forms\ToolStripTests.cs (17)
1401
using
Font
font1 = new("Arial", 8.25f);
1402
using
Font
font2 = new("Arial", 8.5f);
1422
using
Font
font1 = new("Arial", 8.25f);
1423
using
Font
font2 = new("Arial", 8.5f);
1442
public void ToolStrip_Font_Set_GetReturnsExpected(
Font
value)
1473
using
Font
font1 = new("Arial", 8.25f);
1484
using
var
font2 = SystemFonts.DialogFont;
1520
using
Font
font1 = new("Arial", 8.25f);
1535
using
var
font2 = SystemFonts.DialogFont;
1561
using
Font
childFont1 = new("Arial", 1);
1562
using
Font
childFont2 = new("Arial", 1);
1585
using
Font
font1 = new("Arial", 8.25f);
1600
using
var
font2 = SystemFonts.DialogFont;
1627
using
Font
font = new("Microsoft Sans Serif", 8.25f);
1647
using
Font
font = new("Microsoft Sans Serif", 8.25f);
5311
using
Font
childFont1 = new("Arial", 1);
5312
using
Font
childFont2 = new("Arial", 2);
System\Windows\Forms\TreeNodeTests.cs (9)
2801
public void TreeNode_NodeFont_Set_GetReturnsExpected(
Font
value)
2816
public void TreeNode_NodeFont_SetWithTreeView_GetReturnsExpected(
Font
value)
2840
public void TreeNode_NodeFont_SetWithTreeViewWithHandle_GetReturnsExpected(
Font
value, int expectedInvalidatedCallCount)
2871
public void TreeNode_NodeFont_SetWithCustomOldValue_GetReturnsExpected(
Font
value)
2873
using
Font
oldValue = new("Arial", 1);
2889
public void TreeNode_NodeFont_SetWithCustomOldValueWithTreeView_GetReturnsExpected(
Font
value)
2892
using
Font
oldValue = new("Arial", 1);
2917
public void TreeNode_NodeFont_SetWithCustomOldValueWithTreeViewWithHandle_GetReturnsExpected(
Font
value, int expectedInvalidatedCallCount)
2920
using
Font
oldValue = new("Arial", 1);
System\Windows\Forms\TreeViewTests.cs (3)
2704
Font
font = new(FontFamily.GenericSansSerif, 100);
2712
Font
smallFont = new(FontFamily.GenericSansSerif, 2);
2723
public void ItemHeight_Get_ReturnsExpected(
Font
font, bool checkBoxes, TreeViewDrawMode drawMode, int expectedHeight)
System\Windows\Forms\VisualStyles\VisualStyleRendererTests.cs (1)
575
using
Font
font = renderer.GetFont(graphics, FontProperty.TextFont);
Text\FontMetrics.cs (5)
20
using
Font
font = new(family, size);
39
using
Font
font = new(family, size);
60
using
Font
font = new(family, size);
78
using
Font
font = new(family, size);
135
using
Font
font = new(family, size);
TextBoxBaseTests.cs (15)
871
public void TextBoxBase_Font_Set_GetReturnsExpected(
Font
value)
890
public void TextBoxBase_Font_SetWithText_GetReturnsExpected(
Font
value)
910
public void TextBoxBase_Font_SetWithNonNullOldValue_GetReturnsExpected(
Font
value)
912
using
Font
oldValue = new("Arial", 1);
932
public void TextBoxBase_Font_SetWithNonNullOldValueWithText_GetReturnsExpected(
Font
value)
934
using
Font
oldValue = new("Arial", 1);
964
public void TextBoxBase_Font_SetWithHandle_GetReturnsExpected(bool userPaint,
Font
value, int expectedInvalidatedCallCount)
998
public void TextBoxBase_Font_SetWithTextWithHandle_GetReturnsExpected(bool userPaint,
Font
value, int expectedInvalidatedCallCount)
1044
public void TextBoxBase_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint,
Font
value)
1046
using
Font
oldValue = new("Arial", 1);
1082
public void TextBoxBase_Font_SetWithNonNullOldValueWithTextWithHandle_GetReturnsExpected(bool userPaint,
Font
value)
1084
using
Font
oldValue = new("Arial", 1);
1133
using
Font
font1 = new("Arial", 8.25f);
1144
using
var
font2 = SystemFonts.DialogFont;
1280
using
Font
font = new("Arial", 8.25f);
TrackBarTests.cs (3)
625
public void TrackBar_Font_Set_GetReturnsExpected(
Font
value)
656
using
Font
font1 = new("Arial", 8.25f);
667
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);
TestPassApp (1)
PrintingControls.cs (1)
22
Font
font = new("Times New Roman", 30);
WindowsFormsIntegration (5)
System\Windows\Integration\Convert.cs (3)
209
internal static double SystemDrawingFontToSystemWindowsFontSize(SD.
Font
font)
225
internal static FontWeight ToSystemWindowsFontWeight(SD.
Font
sdFont)
230
internal static FontStyle ToSystemWindowsFontStyle(SD.
Font
sdFont)
System\Windows\Integration\ElementHostPropertyMap.cs (2)
127
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;