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)
229Font 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); 2011using Font font = new(FontFamily.GenericSerif, 11.0f);
mono\System.Imaging\MetafileTest.cs (1)
286Font test_font = new(FontFamily.GenericMonospace, 12);
System\Drawing\FontConverterTests.cs (9)
100Font 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)
35using Font font1 = new(fontFamily, size); 36using Font font2 = new(fontFamily, size); 44using Font font1 = new(fontFamily1, 9); 45using Font font2 = new(fontFamily2, 9); 64using Font font = new(fontFamily, emSize); 79using Font font = new(fontFamily.Name, emSize); 106using Font font = new(fontFamily, emSize, style); 121using Font font = new(fontFamily.Name, emSize, style); 146using Font font = new(fontFamily, emSize, unit); 161using Font font = new(fontFamily.Name, emSize, unit); 188using Font font = new(fontFamily, emSize, style, unit); 203using Font font = new(fontFamily.Name, emSize, style, unit); 230using Font font = new(fontFamily, emSize, style, unit, gdiCharSet); 245using Font font = new(fontFamily.Name, emSize, style, unit, gdiCharSet); 272using Font font = new(fontFamily, emSize, style, unit, gdiCharSet, gdiVerticalFont); 287using Font font = new(fontFamily.Name, emSize, style, unit, gdiCharSet, gdiVerticalFont); 300using Font font = new($"@{family.Name}", 10); 308Assert.Throws<NullReferenceException>(() => new Font(null, FontStyle.Regular)); 315Font font = new(family, 10); 318using Font copy = new(font, FontStyle.Italic); 326AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10)); 327AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic)); 328AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, GraphicsUnit.Display)); 329AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display)); 330AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display, 10)); 331AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true)); 343AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10)); 344AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic)); 345AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, GraphicsUnit.Display)); 346AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, GraphicsUnit.Display)); 347AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, GraphicsUnit.Display, 10)); 348AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true)); 360AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize)); 361AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize)); 362AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic)); 363AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic)); 364AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, GraphicsUnit.Document)); 365AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, GraphicsUnit.Document)); 366AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic, GraphicsUnit.Document)); 367AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document)); 368AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic, GraphicsUnit.Document, 10)); 369AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document, 10)); 370AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic, GraphicsUnit.Document, 10, gdiVerticalFont: true)); 371AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document, 10, gdiVerticalFont: true)); 381AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, unit)); 382AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10, unit)); 383AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, unit)); 384AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10, FontStyle.Italic, unit)); 385AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, unit, 10)); 386AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10, FontStyle.Italic, unit, 10)); 387AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, unit, 10, gdiVerticalFont: true)); 388AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10, FontStyle.Italic, unit, 10, gdiVerticalFont: true)); 395using Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 411Font font = new(family, 10); 420Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 423yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true), false }; 424yield return new object[] { font.Clone(), new Font(family, 9, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true), false }; 425yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Italic, GraphicsUnit.Millimeter, 10, gdiVerticalFont: true), false }; 426yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 9, gdiVerticalFont: true), false }; 427yield return new object[] { font.Clone(), new Font(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: false), false }; 429yield return new object[] { new Font(family, 10), new(), false }; 430yield return new object[] { new Font(family, 10), null, false }; 490using Font font = new(family, 10); 501using Font font = new(family, 10); 517using Font font = new(family, 10); 525using Font font = new(family, 10); 533using Font font = new(family, 10); 547Font font = new(family, 10); 686using Font font = new(family, 10, unit); 705using Font font = new(family, 10, fontStyle, GraphicsUnit.Point, gdiCharSet, gdiVerticalFont); 735using Font font = new(family, 10); 763using Font font = new(family, 10); 774using Font font = new(family, 10); 782using Font font = new(family, 10); 814using Font font = new(family, 10); 827using Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 842Font font = new(family, 10); 852using Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 879using Font font1 = new(family1, 1, FontStyle.Bold, GraphicsUnit.Point); 882using 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); 3795return new Font(
System\Windows\Forms\Controls\Labels\FocusableLabel.cs (2)
42Font = new Font(Font, FontStyle.Underline); 52Font = new Font(Font, FontStyle.Regular);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
530using Font alwaysUnderlined = new Font(Font, Font.Style | FontStyle.Underline);
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (3)
222hoverLinkFont = new Font(f, style); 237hoverLinkFont = new Font(f, hoverStyle); 249linkFont = new Font(f, linkStyle);
System\Windows\Forms\Controls\ListView\ListView.cs (2)
2607_odCacheFont = new Font(_odCacheFont, FontStyle.Bold); 2794subItemFont = 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)
1304public Font GetBoldFont() => _boldFont ??= new Font(Font, FontStyle.Bold);
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (2)
144result = new Font(result.FontFamily, MinSize, result.Style, GraphicsUnit.Point); 149result = 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)
37private static readonly Font s_addressFont = new("Microsoft Sans Serif", 8.0f); 38private static readonly Font s_hexDumpFont = new("Courier New", 8.0f);
System\ComponentModel\Design\DesignerActionPanel.HeaderLine.cs (1)
16protected 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)
305replaceFont = new Font(fallBackFontName, base.Font.Size, base.Font.Style);
System\Drawing\Design\FontNameEditor.cs (1)
72using Font font = new(fontFamily, fontSize, fontStyle, GraphicsUnit.Pixel);
System\Windows\Forms\Design\ControlDesigner.cs (1)
2258using (Font errorFont = new(
System\Windows\Forms\Design\SplitterPanelDesigner.cs (1)
191using Font drawFont = new("Arial", 8);
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
334label.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)
868using Font boldFont = new(_selectedItemName.Font, FontStyle.Bold);
System.Windows.Forms.Design.Tests (3)
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (2)
18Font expectedFont = new Font("Arial", 12.0f); 23contextMenuStrip.Font = new Font("Times New Roman", 10.0f, FontStyle.Italic);
System\Windows\Forms\Design\DataGridViewAddColumnDialogTests.cs (1)
31using 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)
531using Font font = new("Segoe UI", 9, FontStyle.Regular); 618using Font font = new("Arial", 9f, FontStyle.Regular); 711using Font font = new("Arial", 9f, FontStyle.Regular); 793using Font font = new("Arial", 9f, FontStyle.Regular); 1200using Font font = new("Arial", fontSize, FontStyle.Regular);
System.Windows.Forms.Tests (191)
CheckedListBoxTests.cs (1)
410yield return new object[] { new Font("Arial", 8.25f), new Rectangle(10, 20, 30, 40), 1, DrawItemState.Default, Color.Red, Color.Blue };
SerializableTypesTests.cs (3)
163using (Font font = new(FontFamily.GenericSansSerif, 9f)) 210using (Font font = new(FontFamily.GenericSansSerif, 9f)) 356NodeFont = new Font(FontFamily.GenericSansSerif, 9f)
System\Windows\Forms\ApplicationTests.cs (3)
222Font font = new(new FontFamily("Arial"), 12f); 223Font scaled = new(new FontFamily("Arial"), 16f); 312using Font customFont = new(new FontFamily("Arial"), 12f);
System\Windows\Forms\AxHostTests.cs (6)
1448using Font font = new("Arial", 10); 1477using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1511using Font font = new("Arial", 10, unit); 1524using Font font = new("Arial", 10); 1546using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1572using Font font = new("Arial", 10, unit);
System\Windows\Forms\ButtonTests.cs (2)
691using Font font = new("Arial", 100f); 721using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\ClipboardTests.cs (1)
1073using Font font = new("Microsoft Sans Serif", emSize: 10);
System\Windows\Forms\ComboBoxTests.cs (1)
1019using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (1)
75using Font newFont = new(font.Name, 20.0f);
System\Windows\Forms\ContainerControlTests.cs (1)
462using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\Control.ActiveXFontMarshallerTests.cs (1)
20using Font font = new("Arial", 11.0f, GraphicsUnit.Point);
System\Windows\Forms\ControlTests.ControlCollection.cs (8)
651Font font = new("Arial", 8.25f); 801Font font = new("Arial", 8.25f); 954Font font = new("Arial", 8.25f); 1027Font font = new("Arial", 8.25f); 2354Font font = new("Arial", 8.25f); 2498Font font = new("Arial", 8.25f); 2630Font font = new("Arial", 8.25f); 2694Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Handlers.cs (3)
1786using Font childFont1 = new("Arial", 1); 1787using Font childFont2 = new("Arial", 2); 4490Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Methods.cs (1)
6407using Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Properties.cs (18)
4799using Font font1 = new("Arial", 8.25f); 4800using Font font2 = new("Arial", 8.5f); 4819using Font font1 = new("Arial", 8.25f); 4820using Font font2 = new("Arial", 8.5f); 4857Font font = new("Arial", 8.25f); 4884Font font = new("Arial", 8.25f); 4896Font = new Font("Arial", 1) 4917Font = new Font("Arial", 1) 4936yield return new object[] { userPaint, new Font("Arial", 8.25f), 1 }; 4979yield return new object[] { userPaint, new Font("Arial", 8.25f) }; 4990Font = new Font("Arial", 1) 5035using Font font1 = new("Arial", 8.25f); 5098using Font font1 = new("Arial", 8.25f); 5151using Font childFont1 = new("Arial", 1); 5152using Font childFont2 = new("Arial", 1); 5191using Font font1 = new("Arial", 8.25f); 5248using Font font = new("Arial", 8.25f); 5273using Font font = new("Arial", 8.25f);
System\Windows\Forms\DataGridViewRowTests.cs (1)
2024using Font font = new("Times New Roman", 12);
System\Windows\Forms\DataGridViewTests.cs (7)
2322using Font formFont1 = new("Times New Roman", 12F, FontStyle.Regular); 2328using Font customFont1 = new("Tahoma", 8.25F, FontStyle.Regular); 2329using Font customFont2 = new("Consolas", 14F, FontStyle.Italic); 2330using Font customFont3 = new("Arial", 9F, FontStyle.Bold); 2371using Font formFont2 = new("Arial Black", 10F, FontStyle.Italic); 3509using Font font1 = new("Arial", 12); 3510using Font font2 = new("Times New Roman", 14);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
106using Font formFont1 = new("Times New Roman", 12F, FontStyle.Regular); 113using Font customCellStyleFont = new("Tahoma", 8.25F, FontStyle.Regular); 114using Font customColumnHeaderFont = new("Consolas", 14F, FontStyle.Italic); 115using Font customRowHeaderFont = new("Arial", 9F, FontStyle.Bold);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (4)
550using Font font = new("Arial", 8.25f); 737using Font oldFont = new("Arial", 8.25f); 759using Font font = new("Arial", 8.25f); 947using Font oldFont = new("Arial", 8.25f);
System\Windows\Forms\DataObjectTests.cs (3)
2908using Font value = new("Arial", 10); 2991Font font = new("Consolas", emSize: 10); 3035result.Font = new(fontFamily, size);
System\Windows\Forms\DateTimePickerTests.cs (2)
286using (Font expectedFont = new("Arial", 8.25f)) 292using (Font differentFont = new("Times New Roman", 10f))
System\Windows\Forms\FontCacheTests.cs (1)
18fonts[i] = new Font("Arial", i + 6);
System\Windows\Forms\FontDialogTests.cs (10)
231using Font font = new("Arial", 8.25f); 243using Font font = new("Arial", 8.25f); 261using Font font = new("Arial", 8.25f); 279using Font font = new("Arial", 8.25f); 293Font font = new("Arial", 8.25f); 316using Font font = new("Arial", 8.25f); 337using Font font = new("Arial", 8.25f); 354using Font font = new("Arial", 8.25f); 585using Font font = new("Arial", 8.25f); 699using Font font = new("Arial", 8.25f);
System\Windows\Forms\GroupBoxTests.cs (3)
578using Font font = new("Arial", 8.25f); 591using Font font = new("Arial", 8.25f); 606using Font newFont = new(originalFont.FontFamily, originalFont.Size + 5, originalFont.Style);
System\Windows\Forms\LinkUtilitiesTests.cs (2)
37using Font baseFont = new("Arial", 12); 54using Font baseFont = new("Arial", 12);
System\Windows\Forms\ListBoxTests.cs (6)
1047yield return new object[] { integralHeight, new Font("Arial", 8.25f) }; 1107yield return new object[] { true, new Font("Arial", 8.25f), 1, 1 }; 1108yield return new object[] { false, new Font("Arial", 8.25f), 1, 2 }; 1153yield return new object[] { true, new Font("Arial", 8.25f), 1, 1 }; 1154yield return new object[] { false, new Font("Arial", 8.25f), 2, 3 }; 1212using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\Ole\BinaryFormatUtilitiesTests.cs (1)
95using Font value = new("Microsoft Sans Serif", emSize: 10);
System\Windows\Forms\PictureBoxTests.cs (1)
502using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\ProgressBarTests.cs (1)
507using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\RichTextBoxTests.cs (19)
1374using Font oldValue = new("Arial", 1); 1396using Font oldValue = new("Arial", 1); 1419yield return new object[] { userPaint, new Font("Arial", 8.25f), 1 }; 1499yield return new object[] { userPaint, new Font("Arial", 8.25f) }; 1508using Font oldValue = new("Arial", 1); 1546using Font oldValue = new("Arial", 1); 1606using (Font font = new(familyName, emSize, style, unit, gdiCharSet)) 1649using Font font1 = new("Arial", 8.25f); 4824using Font value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize); 4851using Font value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize); 4888yield return new object[] { new Font("Arial", 8.25f) }; 4917yield return new object[] { new Font("Arial", 8.25f), 165, 0 }; 4918yield return new object[] { new Font("Arial", 8.25f, FontStyle.Bold), 165, CFE_EFFECTS.CFE_BOLD }; 4919yield return new object[] { new Font("Arial", 8.25f, FontStyle.Italic), 165, CFE_EFFECTS.CFE_ITALIC }; 4920yield return new object[] { new Font("Arial", 8.25f, FontStyle.Strikeout), 165, CFE_EFFECTS.CFE_STRIKEOUT }; 4921yield return new object[] { new Font("Arial", 8.25f, FontStyle.Underline), 165, CFE_EFFECTS.CFE_UNDERLINE }; 4922yield 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)
515using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\SplitterTests.cs (1)
767using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\ToolStripButtonTests.cs (3)
1275using Font font = new("Arial", 8.25f); 1366using Font font = new("Arial", 8.25f); 1465using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripControlHostTests.cs (5)
617using Font value = new("Arial", 8.25f); 960yield return new object[] { displayStyle, new Font("Arial", 8.25f) }; 993using Font font = new("Arial", 8.25f); 1005using Font font = new("Arial", 8.25f); 1045using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripDropDownTests.cs (9)
1485using Font font1 = new("Arial", 8.25f); 1486using Font font2 = new("Arial", 8.5f); 1506using Font font1 = new("Arial", 8.25f); 1507using Font font2 = new("Arial", 8.5f); 1557using Font font1 = new("Arial", 8.25f); 1604using Font font1 = new("Arial", 8.25f); 1645using Font childFont1 = new("Arial", 1); 1646using Font childFont2 = new("Arial", 1); 1669using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\ToolStripItemTests.cs (15)
2934using Font font = new("Arial", 8.25f); 2952using Font font = new("Arial", 8.25f); 2969yield return new object[] { displayStyle, new Font("Arial", 8.25f) }; 2997yield return new object[] { ToolStripItemDisplayStyle.None, new Font("Arial", 8.25f), 0 }; 2998yield return new object[] { ToolStripItemDisplayStyle.Text, new Font("Arial", 8.25f), 1 }; 2999yield return new object[] { ToolStripItemDisplayStyle.Image, new Font("Arial", 8.25f), 0 }; 3000yield return new object[] { ToolStripItemDisplayStyle.ImageAndText, new Font("Arial", 8.25f), 1 }; 3184using Font font = new("Arial", 8.25f); 3213using Font font = new("Arial", 8.25f); 12265item.Font = new Font("Arial", 8.25f); 12303item.Font = new Font("Arial", 8.25f); 12364item.Font = new Font("Arial", 8.25f); 12406item.Font = new Font("Arial", 8.25f); 12456item.Font = new Font("Arial", 8.25f); 14119using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripLabelTests.cs (5)
170accessor._linkFont = new Font("Arial", 10); 171accessor._hoverLinkFont = new Font("Arial", 10, FontStyle.Underline); 183accessor._linkFont = new Font("Arial", 10); 184accessor._hoverLinkFont = new Font("Arial", 10, FontStyle.Underline); 186_toolStripLabel.Font = new Font("Times New Roman", 12);
System\Windows\Forms\ToolStripMenuItemTests.cs (1)
285Font = new Font("Arial", 12),
System\Windows\Forms\ToolStripSeparatorTests.cs (1)
314yield return new object[] { displayStyle, new Font("Arial", 8.25f) };
System\Windows\Forms\ToolStripTests.cs (13)
1401using Font font1 = new("Arial", 8.25f); 1402using Font font2 = new("Arial", 8.5f); 1422using Font font1 = new("Arial", 8.25f); 1423using Font font2 = new("Arial", 8.5f); 1473using Font font1 = new("Arial", 8.25f); 1520using Font font1 = new("Arial", 8.25f); 1561using Font childFont1 = new("Arial", 1); 1562using Font childFont2 = new("Arial", 1); 1585using Font font1 = new("Arial", 8.25f); 1627using Font font = new("Microsoft Sans Serif", 8.25f); 1647using Font font = new("Microsoft Sans Serif", 8.25f); 5311using Font childFont1 = new("Arial", 1); 5312using 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)
2835yield return new object[] { new Font("Arial", 8.25f), 1 }; 2873using Font oldValue = new("Arial", 1); 2892using Font oldValue = new("Arial", 1); 2912yield return new object[] { new Font("Arial", 8.25f), 1 }; 2920using Font oldValue = new("Arial", 1);
System\Windows\Forms\TreeViewTests.cs (2)
2704Font font = new(FontFamily.GenericSansSerif, 100); 2712Font smallFont = new(FontFamily.GenericSansSerif, 2);
Text\FontMetrics.cs (5)
20using Font font = new(family, size); 39using Font font = new(family, size); 60using Font font = new(family, size); 78using Font font = new(family, size); 135using Font font = new(family, size);
TextBoxBaseTests.cs (8)
912using Font oldValue = new("Arial", 1); 934using Font oldValue = new("Arial", 1); 957yield return new object[] { userPaint, new Font("Arial", 8.25f), 1 }; 1037yield return new object[] { userPaint, new Font("Arial", 8.25f) }; 1046using Font oldValue = new("Arial", 1); 1084using Font oldValue = new("Arial", 1); 1133using Font font1 = new("Arial", 8.25f); 1280using Font font = new("Arial", 8.25f);
TrackBarTests.cs (1)
656using Font font1 = new("Arial", 8.25f);
System.Windows.Forms.UI.IntegrationTests (1)
Dpi\ToolStripItemTests.Dpi.cs (1)
45using Font initialFont = toolStrip.Font = new("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
TestPassApp (1)
PrintingControls.cs (1)
22Font font = new("Times New Roman", 30);
WindowsFormsIntegration (4)
System\Windows\Integration\WindowsFormsHostPropertyMap.cs (4)
141adapter.Font = new SD.Font(familySource, adapter.Font.Size, adapter.Font.Style); 172adapter.Font = new SD.Font(CurrentFontFamily, CurrentFontSize, style); 193adapter.Font = new SD.Font(CurrentFontFamily, CurrentFontSize, style); 209adapter.Font = new SD.Font(CurrentFontFamily, (float)pointSize, CurrentFontStyle);
WinFormsControlsTest (36)
ChartControl.cs (1)
40chart4.Series[0].Font = new Font("Trebuchet MS", 8, FontStyle.Bold);
ChartControl.Designer.cs (16)
110chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 114chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 133legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 172title1.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); 195chartArea2.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 201chartArea2.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 246title2.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); 269chartArea3.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 272chartArea3.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 284legend3.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 308title3.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold); 329chartArea4.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 336chartArea4.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 352legend4.Font = new System.Drawing.Font("Trebuchet MS", 8F, System.Drawing.FontStyle.Bold); 365series7.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); 402title4.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.FontStyle.Bold);
DataGridViewInVirtualModeTest.Designer.cs (1)
87this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
DataGridViewTest.cs (5)
13new Font("Tahoma", 12F, FontStyle.Regular), 14new Font("Consolas", 14F, FontStyle.Italic), 15new Font("Arial", 9F, FontStyle.Bold), 16new Font("Microsoft Sans Serif", 11F, FontStyle.Regular) 93Font = new Font("Tahoma", (float)numericUpDown1.Value, FontStyle.Regular);
DataGridViewTest.Designer.cs (5)
58dataGridViewCellStyle1.Font = new System.Drawing.Font("Cascadia Code", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 76dataGridViewCellStyle3.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 148this.changeFontButton.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 196this.resetFontButton.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 216this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
DragDrop.Designer.cs (2)
86textBox.Font = new Font("Segoe UI", 14.25F); 97richTextBox.Font = new Font("Segoe UI", 14.25F);
ErrorProviderTest.Designer.cs (2)
59this.label1.Font = new System.Drawing.Font("Calibri", 12F, FontStyle.Bold); 89this.label2.Font = new System.Drawing.Font("Calibri", 12F, FontStyle.Bold);
MenuStripAndCheckedListBox.cs (1)
39menuStrip1.Font = new Font(f.FontFamily, f.Size * factor, f.Style);
MultipleControls.Designer.cs (1)
109this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
ScalingBeforeChanges.cs (1)
100Font = new Font(Font.FontFamily, Font.Size * factorY, Font.Style);
ToolStripTests.Designer.cs (1)
138this.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)
49Public Property Font As Font
PresentationUI (1)
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
229Font 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)
42private readonly Font _font; 2011using Font font = new(FontFamily.GenericSerif, 11.0f);
mono\System.Imaging\MetafileTest.cs (1)
286Font test_font = new(FontFamily.GenericMonospace, 12);
System\Drawing\FontConverterTests.cs (18)
49Font font = (Font)converter.ConvertFrom(input); 78Font font = (Font)converter.ConvertFrom(string.Empty); 88nameof(Font.Name), 89nameof(Font.Size), 90nameof(Font.Unit), 91nameof(Font.Bold), 92nameof(Font.GdiCharSet), 93nameof(Font.GdiVerticalFont), 94nameof(Font.Italic), 95nameof(Font.Strikeout), 96nameof(Font.Underline), 100Font font = new($"Courier New", 8.25f, FontStyle.Regular, GraphicsUnit.Point); 116public void ConvertToInstanceDescriptor(Font font, int expectedArguments) 123using Font newFont = (Font)descriptor.Invoke(); 137public static TheoryData<Font, int> InstanceDescriptorTestData => new()
System\Drawing\FontTests.cs (62)
35using Font font1 = new(fontFamily, size); 36using Font font2 = new(fontFamily, size); 44using Font font1 = new(fontFamily1, 9); 45using Font font2 = new(fontFamily2, 9); 64using Font font = new(fontFamily, emSize); 79using Font font = new(fontFamily.Name, emSize); 106using Font font = new(fontFamily, emSize, style); 121using Font font = new(fontFamily.Name, emSize, style); 146using Font font = new(fontFamily, emSize, unit); 161using Font font = new(fontFamily.Name, emSize, unit); 188using Font font = new(fontFamily, emSize, style, unit); 203using Font font = new(fontFamily.Name, emSize, style, unit); 230using Font font = new(fontFamily, emSize, style, unit, gdiCharSet); 245using Font font = new(fontFamily.Name, emSize, style, unit, gdiCharSet); 272using Font font = new(fontFamily, emSize, style, unit, gdiCharSet, gdiVerticalFont); 287using Font font = new(fontFamily.Name, emSize, style, unit, gdiCharSet, gdiVerticalFont); 300using Font font = new($"@{family.Name}", 10); 315Font font = new(family, 10); 318using Font copy = new(font, FontStyle.Italic); 395using Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 396Font clone = Assert.IsType<Font>(font.Clone()); 411Font font = new(family, 10); 420Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 435public void Equals_Other_ReturnsExpected(Font font, object other, bool expected) 451if (other is Font otherFont && !ReferenceEquals(font, otherFont)) 461AssertExtensions.Throws<ArgumentException>(null, () => Font.FromHdc(IntPtr.Zero)); 472AssertExtensions.Throws<ArgumentException>(null, () => Font.FromHdc(hdc)); 483AssertExtensions.Throws<ArgumentException>(null, () => Font.FromHfont(IntPtr.Zero)); 490using Font font = new(family, 10); 501using Font font = new(family, 10); 517using Font font = new(family, 10); 525using Font font = new(family, 10); 533using Font font = new(family, 10); 547Font font = new(family, 10); 584using Font font = Font.FromLogFont(logFont); 598AssertExtensions.Throws<ArgumentException>(null, () => Font.FromLogFont(null)); 599AssertExtensions.Throws<ArgumentException>(null, () => Font.FromLogFont(null, hdc)); 603AssertExtensions.Throws<ArgumentNullException>("lf", () => Font.FromLogFont(null)); 604AssertExtensions.Throws<ArgumentNullException>("lf", () => Font.FromLogFont(null, hdc)); 622AssertExtensions.Throws<ArgumentException>(null, () => Font.FromLogFont(logFont)); 623AssertExtensions.Throws<ArgumentException>(null, () => Font.FromLogFont(logFont, hdc)); 645using Font font = Font.FromLogFont(logFont); 686using Font font = new(family, 10, unit); 705using Font font = new(family, 10, fontStyle, GraphicsUnit.Point, gdiCharSet, gdiVerticalFont); 735using Font font = new(family, 10); 763using Font font = new(family, 10); 774using Font font = new(family, 10); 782using Font font = new(family, 10); 814using Font font = new(family, 10); 819Font newFont = Font.FromHfont(hfont); 827using Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 832Font newFont = Font.FromHfont(hfont); 842Font font = new(family, 10); 852using Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 856private static void VerifyFont(Font font, string expectedName, float expectedEmSize, FontStyle expectedStyle, GraphicsUnit expectedUnit, byte expectedGdiCharset, bool expectedGdiVerticalFont) 879using Font font1 = new(family1, 1, FontStyle.Bold, GraphicsUnit.Point); 882using Font font2 = new(family2, 1, FontStyle.Bold, GraphicsUnit.Point);
System\Drawing\SystemFontsTests.cs (7)
22public void SystemFont_Get_ReturnsExpected(Func<Font> getFont) 24using Font font = getFont(); 25using Font otherFont = getFont(); 75public void SystemFont_Get_ReturnsExpected_WindowsNames(Func<Font> getFont, string systemFontName, string windowsFontName) 77using Font font = getFont(); 78using Font otherFont = getFont(); 79using Font fontFromName = SystemFonts.GetFontByName(systemFontName);
System\Drawing\Text\PrivateFontCollectionTests.cs (1)
131AssertExtensions.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)
65private static ConditionalWeakTable<Font, object>? s_fontTable; 339public override Font Font 3599private static FONTDESC GetFONTDESCFromFont(Font font) 3650protected static object? GetIFontFromFont(Font? font) 3669private protected static IFont* GetIFontPointerFromFont(Font? font) 3699protected static Font? GetFontFromIFont(object? font) 3709Font f = Font.FromHfont(oleFont.hFont); 3724protected static object? GetIFontDispFromFont(Font? font) 3749protected static Font? GetFontFromIFontDisp(object? font)
System\Windows\Forms\ActiveX\Control.ActiveXFontMarshaler.cs (2)
32Font font = (Font)obj;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (4)
44private Font? ActiveXAmbientFont 200internal Font? AmbientFont 226return (Font?)property.Value; 1376prop.Value = Font.FromHfont(pQaContainer->pFont->hFont);
System\Windows\Forms\AmbientProperties.cs (1)
28public Font? Font { get; set; }
System\Windows\Forms\Application.cs (7)
28private static Font? s_defaultFont; 32private static Font? s_defaultFontScaled; 347internal static Font DefaultFont => s_defaultFontScaled ?? s_defaultFont!; 1351/// Sets the default <see cref="Font"/> for process. 1368public static void SetDefaultFont(Font font) 1397Font newSystemFont = SystemFonts.GetFontByName(s_defaultFont.SystemFontName)!; 1410Font? font = ScaleHelper.ScaleToSystemTextSize(s_defaultFont);
System\Windows\Forms\ComponentModel\COM2Interop\COM2FontConverter.cs (6)
17private Font? _lastFont; 21public override Type ManagedType => typeof(Font); 53using Font font = Font.FromHfont(_lastHandle); 77_lastFont = (Font)managedValue; 106private static void ApplyFontSettings(Font source, IFont* target, out bool targetChanged)
System\Windows\Forms\Control.cs (27)
174private static Font? s_defaultFont; 279private Font? _scaledControlFont; 287private Dictionary<int, Font>? _dpiFonts; 1558public static Font DefaultFont 1803public virtual Font Font 1811Font? previous = Properties.GetValueOrDefault<Font>(s_fontProperty); 1819Font currentFont = Font; 1860internal Font GetScaledFont(Font font, int newDpi, int oldDpi) 1866_dpiFonts ??= new Dictionary<int, Font> 1871if (_dpiFonts.TryGetValue(newDpi, out Font? scaledFont)) 1891foreach (Font font in _dpiFonts.Values) 1918if (TryGetExplicitlySetFont(out Font? font)) 1937if (Properties.TryGetValue(s_currentAmbientFontProperty, out Font? currentAmbient) && currentAmbient == ambientFont) 1965if (TryGetExplicitlySetFont(out Font? font)) 2909internal Font? ScaledControlFont 2947Font? oldFont = null; 4154Font oldFont = Font; 5467private Font GetCurrentFontAndDpi(out int fontDpi) 5477if (TryGetExplicitlySetFont(out Font? font)) 7345Font localFont = GetCurrentFontAndDpi(out int fontDpi); 7356Font fontForDpi = GetScaledFont(localFont, _deviceDpi, fontDpi); 10682private protected bool TryGetExplicitlySetFont([NotNullWhen(true)] out Font? font) => 10690private protected void SetScaledFont(Font scaledFont, bool raiseOnFontChangedEvent = true) 11473Font localFont = GetCurrentFontAndDpi(out int fontDpi); 12522Font font = SystemFonts.MessageBoxFont!;
System\Windows\Forms\Control.FontHandleWrapper.cs (2)
11/// Wrapper for a <see cref="Drawing.Font"/>'s <see cref="HFONT"/>. 17internal FontHandleWrapper(Font font) => _handle = (HFONT)font.ToHfont();
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
559Font font,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (1)
30public Font Font { get; set; } = null!;
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (1)
302Font font,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (1)
154Font font,
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
135Font 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)"/> 129public 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)"/> 142public 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)"/> 202Font? font, 224Font? font, 236Font? 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)"/> 89Font? font, 101/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/> 107Font? font, 117Font? font, 155/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/> 161Font? font, 185Font? 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)" /> 93Font? font, 102/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" /> 108Font? font, 121Font? font, 155/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" /> 161Font? font, 185Font? font, 208Font? font,
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (4)
58public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, ComboBoxState state) 66public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, ComboBoxState state) 74public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, TextFormatFlags flags, ComboBoxState state) 86public 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)
2616public override Font Font
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (6)
2522Font font, 2536Font font, 2561Font font, 2607Font font, 2627Font font, 3958internal static bool TextFitsInBounds(Graphics graphics, string text, Font font, Size maxBounds, TextFormatFlags flags)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (3)
143public Font? Font 145get => Properties.GetValueOrDefault<Font>(s_propFont); 148Font? previous = Properties.AddOrRemoveValue(s_propFont, value);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (4)
951Font? getLinkFont = null; 952Font? getHoverFont = null; 956using Font linkFont = getLinkFont; 957using Font hoverFont = getHoverFont;
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (1)
318Font font)
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (2)
95private Font? _calendarFont; 205public Font CalendarFont
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
22private Font? _cachedFont;
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (8)
77public static void DrawGroupBox(Graphics g, Rectangle bounds, string? groupBoxText, Font? font, GroupBoxState state) 87Font? font, 99Font? font, 108Font? font, 129Font? font, 139Font? font, 170Font? font, 276Font? font,
System\Windows\Forms\Controls\Labels\LinkLabel.cs (6)
34private Font? _linkFont; 35private Font? _hoverLinkFont; 530using Font alwaysUnderlined = new Font(Font, Font.Style | FontStyle.Underline); 1227Font linkFont, 1228Font hoverLinkFont, 1259Font font = (linkState & LinkState.Hover) == LinkState.Hover ? hoverLinkFont : linkFont;
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (4)
163Font baseFont, 165[AllowNull] ref Font linkFont, 166[AllowNull] ref Font hoverLinkFont, 198Font f = baseFont;
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
588Font font = Font;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (1)
430public override Font Font
System\Windows\Forms\Controls\ListView\DrawListViewColumnHeaderEventArgs.cs (2)
26Font? font) 76public Font? Font { get; }
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (1)
138Font font = ItemIndex == -1 ? Item!.Font : SubItem!.Font;
System\Windows\Forms\Controls\ListView\ListView.cs (4)
108private Font _odCacheFont; 2783Font? subItemFont = null; 5997Font font = GetListHeaderFont(); 6311private Font GetListHeaderFont()
System\Windows\Forms\Controls\ListView\ListViewItem.cs (7)
106public ListViewItem(string[]? items, int imageIndex, Color foreColor, Color backColor, Font? font) 162public ListViewItem(string[]? items, int imageIndex, Color foreColor, Color backColor, Font? font, ListViewGroup? group) 197public ListViewItem(string[]? items, string? imageKey, Color foreColor, Color backColor, Font? font) 235public ListViewItem(string[]? items, string? imageKey, Color foreColor, Color backColor, Font? font, ListViewGroup? group) 388public Font Font 1222Font = (Font)info.GetValue(nameof(Font), typeof(Font))!;
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.cs (2)
46public ListViewSubItem(ListViewItem? owner, string? text, Color foreColor, Color backColor, Font font) 141public Font Font
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.SubItemStyle.cs (1)
16public Font? font; // Do NOT rename (binary serialization).
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (2)
125public ListViewSubItem Add(string? text, Color foreColor, Color backColor, Font font) 167public void AddRange(string[] items, Color foreColor, Color backColor, Font font)
System\Windows\Forms\Controls\ListView\ListViewItemConverter.cs (2)
90typeof(Font) 110typeof(Font)
System\Windows\Forms\Controls\ListView\ListViewSubItemConverter.cs (1)
41typeof(Font)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
280public override Font Font
System\Windows\Forms\Controls\ProgressBar\ProgressBar.cs (1)
193public override Font Font
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.MeasureTextHelper.cs (4)
15public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text, Font font) 18public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text, Font font, int width) 21public static SizeF MeasureTextSimple(PropertyGrid owner, Graphics g, string? text, Font font, SizeF size) 31public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text, Font font, SizeF size)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CategoryGridEntry.cs (1)
117Font font = GetFont(boldFont: bold);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.CacheItems.cs (2)
13public Font? LastLabelFont; 17public Font? LastValueFont;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (4)
1187protected int GetLabelTextWidth(string? text, Graphics graphics, Font font) 1210public int GetValueTextWidth(string text, Graphics graphics, Font font) 1483protected Font GetFont(bool boldFont) 1535Font font = GetFont(boldFont: bold);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (3)
55private Font? _boldFont; 1302public Font GetBaseFont() => Font; 1304public Font GetBoldFont() => _boldFont ??= new Font(Font, FontStyle.Bold);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (5)
389public override Font Font 409Font? font = GetCharFormatFont(selectionOnly: false); 938public Font? SelectionFont 2161private Font? GetCharFormatFont(bool selectionOnly) 2728private unsafe void SetCharFormatFont(bool selectionOnly, Font value)
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
159public override Font Font
System\Windows\Forms\Controls\TabControl\TabRenderer.cs (5)
54public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, TabItemState state) 62public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, bool focused, TabItemState state) 72public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, TextFormatFlags flags, bool focused, TabItemState state) 111public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, Image image, Rectangle imageRectangle, bool focused, TabItemState state) 121public 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)
51public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText, Font? font, TextBoxState state) 59public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText, Font? font, Rectangle textBounds, TextBoxState state) 67public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText, Font? font, TextFormatFlags flags, TextBoxState state) 78public 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)
62private Font? _defaultFont; 516public override Font Font 3746if (item.TryGetExplicitlySetFont(out Font? local))
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
189public override Font Font
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (2)
355public override Font Font 610Font originalFont = Font;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
787Font currentFont = childItem.Font;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (6)
145internal Font _defaultFont = ToolStripManager.DefaultFont; 904public virtual Font Font 908if (TryGetExplicitlySetFont(out Font? font)) 2320private Font? GetOwnerFont() => Owner?.Font; 3186Font f = Font; 3635internal bool TryGetExplicitlySetFont([NotNullWhen(true)] out Font? local) => Properties.TryGetValue(s_fontProperty, out local);
System\Windows\Forms\Controls\ToolStrips\ToolStripItemTextRenderEventArgs.cs (3)
25Font? textFont, 48Font? textFont, 86public Font? TextFont { get; set; }
System\Windows\Forms\Controls\ToolStrips\ToolStripLabel.cs (3)
23private Font? _hoverLinkFont; 24private Font? _linkFont; 355Font font = Font;
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (6)
23private static Font? s_defaultFont; 24private static readonly ConcurrentDictionary<int, Font> s_defaultFontCache = new(); 50internal static Font DefaultFont 59Font? sysFont; 66if (!s_defaultFontCache.TryGetValue(dpi, out Font? retFont)) 90Font? retFont = s_defaultFont;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
866Font? textFont = e.TextFont;
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
105public override Font Font
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.ToolStripTextBoxControl.cs (1)
95public override Font Font
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (1)
217public override Font Font
System\Windows\Forms\Controls\TreeView\TreeNode.cs (2)
729public Font? NodeFont 742Font? oldfont = NodeFont;
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
2840Font font = node.NodeFont ?? node.TreeView.Font;
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGrid.cs (2)
104public Font CaptionFont 264public Font HeaderFont
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGridTableStyle.cs (1)
140public Font HeaderFont
System\Windows\Forms\Controls\Unsupported\StatusBar\StatusBar.cs (1)
71public override Drawing.Font Font
System\Windows\Forms\Controls\Unsupported\StatusBar\StatusBarDrawItemEventArgs.cs (2)
25Font font, 38Font font,
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
1252public override Font Font
System\Windows\Forms\Design\ComponentEditorForm.cs (2)
169Font? uiFont = DefaultFont; 172uiFont = (Font?)uiService.Styles["DialogFont"];
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (5)
26private Font? _font; 135public Font Font 139Font? result = _font ?? Control.DefaultFont; 466using Font fontInWorldUnits = Font.FromLogFont(in lf, dc);
System\Windows\Forms\Form.cs (2)
3725public static SizeF GetAutoScaleSize(Font font) 4536Font fontForDpi = GetScaledFont(Font, deviceDpiNew, deviceDpiOld);
System\Windows\Forms\Help\Help.cs (1)
88Font font = SystemFonts.StatusFont ?? SystemFonts.DefaultFont;
System\Windows\Forms\Layout\Containers\ContainerControl.cs (1)
1399Font fontForDpi = GetScaledFont(Font, deviceDpiNew, deviceDpiOld);
System\Windows\Forms\Layout\LayoutUtils.cs (1)
43public static Size OldGetLargestStringSizeInCollection(Font? font, ICollection? objects)
System\Windows\Forms\Layout\LayoutUtils.MeasureTextCache.cs (3)
29public Size GetTextSize(string? text, Font? font, Size proposedConstraints, TextFormatFlags flags) 99public bool TextRequiresWordBreak(string? text, Font? font, Size size, TextFormatFlags flags) 108private Size GetUnconstrainedSize(string? text, Font? font, TextFormatFlags flags)
System\Windows\Forms\OwnerDrawPropertyBag.cs (2)
22if (entry.Name == nameof(Font) && entry.Value is Font font) 41public Font? Font { get; set; }
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
637public override Font Font
System\Windows\Forms\Rendering\ControlPaint.cs (5)
1943Font font, 1975Font font, 1992Font font, 2057internal static Font FontInPoints(Font font)
System\Windows\Forms\Rendering\DrawItemEventArgs.cs (5)
31public DrawItemEventArgs(Graphics graphics, Font? font, Rectangle rect, int index, DrawItemState state) 41Font? font, 58Font? font, 67Font? font, 90public 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. 22internal sealed partial class FontCache : RefCountedCache<HFONT, FontCache.Data, (Font Font, FONT_QUALITY Quality)> 36public CacheEntry GetEntry(Font font, FONT_QUALITY quality = FONT_QUALITY.DEFAULT_QUALITY) => GetEntry((font, quality)); 38public override CacheEntry GetEntry((Font Font, FONT_QUALITY Quality) key) 46protected override CacheEntry CreateEntry((Font Font, FONT_QUALITY Quality) key, bool cached) 49protected 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)
18public WeakReference<Font> Font { get; } 24public Data(Font font, FONT_QUALITY quality) 26Font = new WeakReference<Font>(font); 66private static unsafe HFONT FromFont(Font font, FONT_QUALITY quality = FONT_QUALITY.DEFAULT_QUALITY)
System\Windows\Forms\Rendering\GdiCache.cs (1)
91public static FontCache.Scope GetHFONTScope(Font? font, FONT_QUALITY quality = FONT_QUALITY.DEFAULT_QUALITY)
System\Windows\Forms\Rendering\TextRenderer.cs (55)
25public 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> 37public static void DrawText(IDeviceContext dc, ReadOnlySpan<char> text, Font font, Point pt, Color foreColor) 43Font? font, 54/// <param name="font">The <see cref="Font"/> to apply to the drawn text.</param> 62Font font, 71Font? font, 83/// <param name="font">The <see cref="Font"/> to apply to the drawn text.</param> 94Font? font, 110Font? font, 123/// <param name="font">The <see cref="Font"/> to apply to the drawn text.</param> 135Font? font, 149public 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> 164Font? font, 172Font? font, 184/// <param name="font">The <see cref="Font"/> to apply to the drawn text.</param> 192Font? font, 201Font? font, 213/// <param name="font">The <see cref="Font"/> to apply to the drawn text.</param> 224Font? font, 240Font? font, 253/// <param name="font">The <see cref="Font"/> to apply to the drawn text.</param> 265Font? font, 282Font? font, 292Font? font, 315Font? font, 324Font? font, 348Font? font, 358Font? font, 381public 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)"/>. 401public static Size MeasureText(ReadOnlySpan<char> text, Font? font) 404public static Size MeasureText(string? text, Font? font, Size proposedSize) 412/// <param name="font">The <see cref="Font"/> to apply to the measured text.</param> 418public static Size MeasureText(ReadOnlySpan<char> text, Font? font, Size proposedSize) 421public 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> 439public static Size MeasureText(ReadOnlySpan<char> text, Font? font, Size proposedSize, TextFormatFlags flags) 442public static Size MeasureText(IDeviceContext dc, string? text, Font? font) 456public static Size MeasureText(IDeviceContext dc, ReadOnlySpan<char> text, Font? font) 459public 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> 475public static Size MeasureText(IDeviceContext dc, ReadOnlySpan<char> text, Font? font, Size proposedSize) 481Font? font, 492/// <param name="font">The <see cref="Font"/> to apply to the measured text.</param> 506Font? font, 513Font? font, 529Font? font, 650/// <inheritdoc cref="GdiCache.GetHFONTScope(Font?, FONT_QUALITY)"/> 658private static FontCache.Scope GetFontOrHdcHFONT(Font? font, FONT_QUALITY quality, HDC hdc)
System\Windows\Forms\Scrolling\ScrollBar.cs (1)
170public override Font Font
System\Windows\Forms\SystemInformation.cs (4)
134public static Font MenuFont => GetMenuFontHelper(0, useDpi: false); 139public static Font GetMenuFontForDpi(int dpi) 142private static unsafe Font GetMenuFontHelper(uint dpi, bool useDpi) 156return Font.FromLogFont(Unsafe.AsRef<LOGFONT>((LOGFONT*)&data.lfMenuFont));
System\Windows\Forms\ToolTip\DrawToolTipEventArgs.cs (2)
27Font? font) 67public Font? Font { get; }
System\Windows\Forms\ToolTip\ToolTip.cs (2)
2328Font font; 2331font = Font.FromHfont(PInvokeCore.SendMessage(this, PInvokeCore.WM_GETFONT));
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (2)
530public Font? GetFont(IDeviceContext dc, FontProperty prop) 547return Font.FromLogFont(logfont);
System.Windows.Forms.Design (37)
System\ComponentModel\Design\ByteViewer.cs (5)
37private static readonly Font s_addressFont = new("Microsoft Sans Serif", 8.0f); 38private static readonly Font s_hexDumpFont = new("Courier New", 8.0f); 124Font font = s_addressFont; 193Font font = s_hexDumpFont; 205Font font = s_hexDumpFont;
System\ComponentModel\Design\DesignerActionPanel.cs (1)
65Font = (Font)uiService.Styles["DialogFont"]!;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (1)
447public DropDownHolder(Control hostedControl, Control parentControl, Color borderColor, Font font, EditorPropertyLine parent)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (1)
18public FlyoutDialog(Control hostedControl, Control parentControl, Color borderColor, Font font)
System\ComponentModel\Design\DesignerActionPanel.HeaderLine.cs (1)
16protected override Font GetFont() => new(ActionPanel.Font, FontStyle.Bold);
System\ComponentModel\Design\DesignerActionPanel.TextLine.cs (1)
58protected virtual Font GetFont()
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (3)
22private readonly Dictionary<int, Font?> _fallbackFonts; 250public override Font Font 295if (!_fallbackFonts.TryGetValue(planeNumber, out Font? replaceFont))
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
259Font font = Font;
System\Drawing\Design\CursorEditor.CursorUI.cs (1)
65Font font = e.Font!;
System\Drawing\Design\FontEditor.cs (1)
33if (value is Font fontValue)
System\Drawing\Design\FontNameEditor.cs (1)
72using Font font = new(fontFamily, fontSize, fontStyle, GraphicsUnit.Pixel);
System\Windows\Forms\Design\BaseContextMenuStrip.cs (2)
125_selectionMenuItem.DropDown.Font = (Font)uis.Styles["DialogFont"]!; 239Font = (Font)uis.Styles["DialogFont"]!;
System\Windows\Forms\Design\ComponentTray.cs (3)
157Font = (Font)uiService.Styles["DialogFont"]; 1425Font = (Font)uiService.Styles["DialogFont"]; 1961public override Font Font
System\Windows\Forms\Design\ControlDesigner.cs (1)
2258using (Font errorFont = new(
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (2)
55Font uiFont = DefaultFont; 58uiFont = (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)
797if (font is not Font uiFont)
System\Windows\Forms\Design\SplitterPanelDesigner.cs (1)
191using Font drawFont = new("Arial", 8);
System\Windows\Forms\Design\TabOrder.cs (3)
26private readonly Font _tabFont; 48_tabFont = uisvc is not null && uisvc.Styles["DialogFont"] is Font dialogFont ? dialogFont : DefaultFont; 194Font font = _tabFont;
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (2)
640Font measureFont = Font; 868using Font boldFont = new(_selectedItemName.Font, FontStyle.Bold);
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
393contextMenu.Font = (Font)uis.Styles["DialogFont"];
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (3)
82item.DropDown.Font = (Font)uis.Styles["DialogFont"]; 172Font 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)
18Font expectedFont = new Font("Arial", 12.0f);
System\Windows\Forms\Design\DataGridViewAddColumnDialogTests.cs (1)
31using Font expectedFont = new("Arial", 12);
System.Windows.Forms.Primitives (9)
System\Drawing\FontExtensions.cs (2)
11public static LOGFONTW ToLogicalFont(this Font font) 17public 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"/> 20public 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 223internal static Font? ScaleToSystemTextSize(Font? font)
System\Windows\Forms\SystemDrawingExtensions.cs (1)
14internal static HFONT ToHFONT(this Font font) => (HFONT)font.ToHfont();
System.Windows.Forms.Primitives.Tests (17)
Interop\User32\SystemParametersInfoWTests.cs (12)
18Font captionFont = Font.FromLogFont(data.lfCaptionFont); 21Font menuFont = Font.FromLogFont(data.lfMenuFont); 24Font messageFont = Font.FromLogFont(data.lfMessageFont); 27Font smCaptionFont = Font.FromLogFont(data.lfSmCaptionFont); 30Font statusFont = Font.FromLogFont(data.lfStatusFont); 33static void AreEqual(Font expected, Font actual)
System\Windows\Forms\Automation\UiaTextRangeTests.cs (5)
531using Font font = new("Segoe UI", 9, FontStyle.Regular); 618using Font font = new("Arial", 9f, FontStyle.Regular); 711using Font font = new("Arial", 9f, FontStyle.Regular); 793using Font font = new("Arial", 9f, FontStyle.Regular); 1200using Font font = new("Arial", fontSize, FontStyle.Regular);
System.Windows.Forms.Tests (357)
CheckedListBoxTests.cs (2)
415public void CheckedListBox_OnDrawItem_Invoke_Success(Font font, Rectangle rect, int index, DrawItemState state, Color foreColor, Color backColor) 430public void CheckedListBox_OnDrawItem_InvokeWithHandle_Success(Font font, Rectangle rect, int index, DrawItemState state, Color foreColor, Color backColor)
SerializableTypesTests.cs (2)
163using (Font font = new(FontFamily.GenericSansSerif, 9f)) 210using (Font font = new(FontFamily.GenericSansSerif, 9f))
System\Windows\Forms\AmbientPropertiesTests.cs (1)
56public void Font_Set_GetReturnsExpected(Font value)
System\Windows\Forms\ApplicationTests.cs (11)
199Font customFont = (Font)SystemFonts.CaptionFont.Clone(); 222Font font = new(new FontFamily("Arial"), 12f); 223Font scaled = new(new FontFamily("Arial"), 16f); 260Font font = applicationTestAccessor.s_defaultFont; 272using Font sysFont = SystemFonts.CaptionFont; 283using Font fakeSysFont = sysFont.WithSize(sysFont.Size * 1.25f); 307Font font = applicationTestAccessor.s_defaultFont; 312using Font customFont = new(new FontFamily("Arial"), 12f); 641private static void AreFontEqual(Font expected, Font actual)
System\Windows\Forms\AxHostTests.cs (14)
518public void AxHost_Font_Set_GetReturnsExpected(Font value) 1448using Font font = new("Arial", 10); 1461Font result = SubAxHost.GetFontFromIFont(iFont); 1477using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1490Font result = SubAxHost.GetFontFromIFont(iFont); 1511using Font font = new("Arial", 10, unit); 1524using Font font = new("Arial", 10); 1536Font result = SubAxHost.GetFontFromIFont(iFont); 1546using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1557Font result = SubAxHost.GetFontFromIFont(iFont); 1572using Font font = new("Arial", 10, unit); 3228public static new Font GetFontFromIFont(object font) => AxHost.GetFontFromIFont(font); 3230public static new object GetIFontDispFromFont(Font font) => AxHost.GetIFontDispFromFont(font); 3232public static new object GetIFontFromFont(Font font) => AxHost.GetIFontFromFont(font);
System\Windows\Forms\ButtonTests.cs (4)
670public void Button_Font_Set_GetReturnsExpected(Font value) 691using Font font = new("Arial", 100f); 721using Font font1 = new("Arial", 8.25f); 732using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\ClipboardTests.cs (3)
1073using Font font = new("Microsoft Sans Serif", emSize: 10); 1075Action a1 = () => JsonSerializer.Deserialize<Font>(serialized); 1080Clipboard.TryGetData(format, out Font? result).Should().BeFalse();
System\Windows\Forms\ComboBoxTests.cs (3)
988public void ComboBox_Font_Set_GetReturnsExpected(Font value) 1019using Font font1 = new("Arial", 8.25f); 1030using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (5)
40using Font? font = (Font?)converter.ConvertNativeToManaged((VARIANT)(IUnknown*)iFont, s_stubDescriptor); 72using Font? font = (Font?)converter.ConvertNativeToManaged((VARIANT)(IUnknown*)iFont, s_stubDescriptor); 75using Font newFont = new(font.Name, 20.0f);
System\Windows\Forms\ContainerControlTests.cs (4)
408public void ContainerControl_Font_Set_GetReturnsExpected(Font value) 427public void ContainerControl_Font_SetWithAutoScaleModeFont_GetReturnsExpected(Font value) 462using Font font1 = new("Arial", 8.25f); 473using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\Control.ActiveXFontMarshallerTests.cs (3)
20using Font font = new("Arial", 11.0f, GraphicsUnit.Point); 28using Font outFont = (Font)s_marshaler.MarshalNativeToManaged(native);
System\Windows\Forms\ControlPaintTests.cs (2)
1916string s, Font font, Color color, 1964string s, Font font, Color color,
System\Windows\Forms\ControlTests.ControlCollection.cs (8)
651Font font = new("Arial", 8.25f); 801Font font = new("Arial", 8.25f); 954Font font = new("Arial", 8.25f); 1027Font font = new("Arial", 8.25f); 2354Font font = new("Arial", 8.25f); 2498Font font = new("Arial", 8.25f); 2630Font font = new("Arial", 8.25f); 2694Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.cs (1)
495Font font = Control.DefaultFont;
System\Windows\Forms\ControlTests.Handlers.cs (3)
1786using Font childFont1 = new("Arial", 1); 1787using Font childFont2 = new("Arial", 2); 4490Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Methods.cs (1)
6407using Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Properties.cs (27)
4799using Font font1 = new("Arial", 8.25f); 4800using Font font2 = new("Arial", 8.5f); 4819using Font font1 = new("Arial", 8.25f); 4820using Font font2 = new("Arial", 8.5f); 4838public void Control_Font_Set_GetReturnsExpected(Font value) 4857Font font = new("Arial", 8.25f); 4864public void Control_Font_SetWithFontHeight_GetReturnsExpected(Font value, int expectedFontHeight) 4884Font font = new("Arial", 8.25f); 4891public void Control_Font_SetNonNullOldValueWithFontHeight_GetReturnsExpected(Font value, int expectedFontHeight) 4913public void Control_Font_SetWithNonNullOldValue_GetReturnsExpected(Font value) 4943public void Control_Font_SetWithHandle_GetReturnsExpected(bool userPaint, Font value, int expectedInvalidatedCallCount) 4986public void Control_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint, Font value) 5035using Font font1 = new("Arial", 8.25f); 5046using var font2 = SystemFonts.DialogFont; 5098using Font font1 = new("Arial", 8.25f); 5117using var font2 = SystemFonts.DialogFont; 5151using Font childFont1 = new("Arial", 1); 5152using Font childFont2 = new("Arial", 1); 5191using Font font1 = new("Arial", 8.25f); 5210using var font2 = SystemFonts.DialogFont; 5248using Font font = new("Arial", 8.25f); 5273using Font font = new("Arial", 8.25f); 10720Font font1 = SystemFonts.CaptionFont; 10721Font font2 = SystemFonts.DialogFont; 10894Font font1 = SystemFonts.MenuFont; 10895Font font2 = SystemFonts.DialogFont; 10956Font controlFont = SystemFonts.StatusFont;
System\Windows\Forms\DataGridViewCellStyleTests.cs (3)
267public void DataGridViewCellStyle_Font_Set_GetReturnsExpected(Font value) 840Font font = SystemFonts.DefaultFont; 1121Font font = SystemFonts.DefaultFont;
System\Windows\Forms\DataGridViewRowTests.cs (4)
2023var oldApplicationDefaultFont = Application.DefaultFont; 2024using Font font = new("Times New Roman", 12); 2058Font font1 = SystemFonts.DefaultFont; 2059Font font2 = SystemFonts.MenuFont;
System\Windows\Forms\DataGridViewTests.cs (7)
2322using Font formFont1 = new("Times New Roman", 12F, FontStyle.Regular); 2328using Font customFont1 = new("Tahoma", 8.25F, FontStyle.Regular); 2329using Font customFont2 = new("Consolas", 14F, FontStyle.Italic); 2330using Font customFont3 = new("Arial", 9F, FontStyle.Bold); 2371using Font formFont2 = new("Arial Black", 10F, FontStyle.Italic); 3509using Font font1 = new("Arial", 12); 3510using Font font2 = new("Times New Roman", 14);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
106using Font formFont1 = new("Times New Roman", 12F, FontStyle.Regular); 113using Font customCellStyleFont = new("Tahoma", 8.25F, FontStyle.Regular); 114using Font customColumnHeaderFont = new("Consolas", 14F, FontStyle.Italic); 115using Font customRowHeaderFont = new("Arial", 9F, FontStyle.Bold);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (6)
550using Font font = new("Arial", 8.25f); 735public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_ApplyCellStyleToEditingDataGridViewTextBoxEditingControl_Invoke_Success(DataGridViewCellStyle dataGridViewCellStyle, Font expectedFont, Color expectedBackColor, Color expectedForeColor, bool expectedWordWrap, HorizontalAlignment expectedTextAlign, bool expectedRepositionOnValueChange) 737using Font oldFont = new("Arial", 8.25f); 759using Font font = new("Arial", 8.25f); 944public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_ApplyCellStyleToEditingDataGridViewTextBoxEditingControl_InvokeWithDataGridView_Success(DataGridViewCellStyle dataGridViewCellStyle, Font expectedFont, Color expectedBackColor, Color expectedEditingPanelBackColor, Color expectedForeColor, bool expectedWordWrap, HorizontalAlignment expectedTextAlign, bool expectedRepositionOnValueChange) 947using Font oldFont = new("Arial", 8.25f);
System\Windows\Forms\DataObjectExtensionsTests.cs (1)
91dataObject.TryGetData(DataFormats.Serializable, autoConvert, out Font? font).Should().BeFalse();
System\Windows\Forms\DataObjectTests.cs (7)
2908using Font value = new("Arial", 10); 2991Font font = new("Consolas", emSize: 10); 3016public Font Font { get; set; } 3059case nameof(Font.FontFamily): 3062case nameof(Font.Size): 3079writer.WriteString(nameof(Font.FontFamily), value.Font.FontFamily.Name); 3080writer.WriteNumber(nameof(Font.Size), value.Font.Size);
System\Windows\Forms\DateTimePickerTests.cs (2)
286using (Font expectedFont = new("Arial", 8.25f)) 292using (Font differentFont = new("Times New Roman", 10f))
System\Windows\Forms\DrawItemEventArgsTests.cs (2)
24public void DrawItemEventArgs_Ctor_Graphics_Font_Rectangle_Int_DrawItemState(Font font, Rectangle rect, int index, DrawItemState state, Color expectedForeColor, Color expectedBackColor) 49public 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)
23public 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) 75public void DrawListViewColumnHeaderEventArgs_DrawBackground_Invoke_Success(Rectangle bounds, ColumnHeader header, ListViewItemStates state, Color foreColor, Color backColor, Font font) 113public void DrawListViewColumnHeaderEventArgs_DrawText_NullHeader_Success(Rectangle bounds, int columnIndex, ListViewItemStates state, Color foreColor, Color backColor, Font font)
System\Windows\Forms\DrawToolTipEventArgsTests.cs (5)
22public void Ctor_Graphics_IWin32Window_Control_Rectangle_String_Color_Color_Font(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor, Font font) 47public void DrawBackground_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor, Font font) 57public void DrawText_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor, Font font) 67public void DrawText_InvokeTextFormatFlags_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor, Font font) 77public void DrawBorder_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor, Font font)
System\Windows\Forms\FontCacheTests.cs (2)
15Font[] fonts = new Font[10];
System\Windows\Forms\FontDialogTests.cs (14)
231using Font font = new("Arial", 8.25f); 243using Font font = new("Arial", 8.25f); 249Font result = dialog.Font; 261using Font font = new("Arial", 8.25f); 267Font result = dialog.Font; 279using Font font = new("Arial", 8.25f); 293Font font = new("Arial", 8.25f); 299public void FontDialog_Font_Set_GetReturnsExpected(Font value) 314public void FontDialog_Font_SetWithCustomOldValue_GetReturnsExpected(Font value) 316using Font font = new("Arial", 8.25f); 337using Font font = new("Arial", 8.25f); 354using Font font = new("Arial", 8.25f); 585using Font font = new("Arial", 8.25f); 699using Font font = new("Arial", 8.25f);
System\Windows\Forms\GroupBoxTests.cs (5)
578using Font font = new("Arial", 8.25f); 591using Font font = new("Arial", 8.25f); 605var originalFont = groupBox.Font; 606using Font newFont = new(originalFont.FontFamily, originalFont.Size + 5, originalFont.Style); 613Font updatedCachedFont = accessor.Dynamic._cachedFont;
System\Windows\Forms\LinkUtilitiesTests.cs (10)
37using Font baseFont = new("Arial", 12); 38Font? linkFont = null; 39Font? hoverLinkFont = null; 44linkFont.Should().BeOfType<Font>(); 45hoverLinkFont.Should().BeOfType<Font>(); 54using Font baseFont = new("Arial", 12); 55Font? linkFont = null; 56Font? hoverLinkFont = null; 61linkFont.Should().BeOfType<Font>(); 62hoverLinkFont.Should().BeOfType<Font>();
System\Windows\Forms\ListBoxTests.cs (6)
1053public void ListBox_Font_Set_GetReturnsExpected(bool integralHeight, Font value) 1077public void ListBox_Font_SetWithItems_GetReturnsExpected(bool integralHeight, Font value) 1113public void ListBox_Font_SetWithHandle_GetReturnsExpected(bool integralHeight, Font value, int expectedInvalidatedCallCount1, int expectedInvalidatedCallCount2) 1159public void ListBox_Font_SetWithItemsWithHandle_GetReturnsExpected(bool integralHeight, Font value, int expectedInvalidatedCallCount1, int expectedInvalidatedCallCount2) 1212using Font font1 = new("Arial", 8.25f); 1223using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\ListViewItemConverterTests.cs (10)
194new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 200new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 206new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 212new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 218new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 224new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 232new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 238new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 244new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 250new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) },
System\Windows\Forms\ListViewItemTests.cs (7)
54public 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) 92public 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) 130public 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) 168public void ListViewItem_Ctor_StringArray_Int_Color_Color_Font(string[] subItems, int imageIndex, Color foreColor, Color backColor, Font font, Color expectedForeColor, Color expectedBackColor, string expectedText) 964public void ListViewItem_Font_GetWithOwner_ReturnsExpected(Font value) 982public void ListViewItem_Font_Set_GetReturnsExpected(Font value) 998public void ListViewItem_Font_SetWithOwner_GetReturnsExpected(Font value)
System\Windows\Forms\ListViewSubItemCollectionTests.cs (2)
266public void ListViewSubItemCollection_Add_String_Color_Color_Font_Success(string text, Color foreColor, Color backColor, Font font, Color expectedForeColor, Color expectedBackColor, string expectedText) 396public void ListViewSubItemCollection_AddRange_StringArrayWithStyles_Success(Color foreColor, Color backColor, Font font, Color expectedForeColor, Color expectedBackColor)
System\Windows\Forms\ListViewSubItemConverterTests.cs (1)
63new Type[] { typeof(ListViewItem), typeof(string), typeof(Color), typeof(Color), typeof(Font) },
System\Windows\Forms\ListViewSubItemTests.cs (4)
68public void ListViewSubItem_Ctor_ListViewItem_String_Color_Color_Font(ListViewItem owner, string text, Color foreColor, Color backColor, Font font, Color expectedForeColor, Color expectedBackColor, string expectedText) 273public void ListViewSubItem_Font_Set_GetReturnsExpected(Font value) 288public void ListViewSubItem_Font_SetWithListViewItemWithListView_GetReturnsExpected(Font value) 312public void ListViewSubItem_Font_SetWithListViewItem_GetReturnsExpected(Font value)
System\Windows\Forms\Ole\BinaryFormatUtilitiesTests.cs (7)
73(typeof(Font).FullName, typeof(Font)), 95using Font value = new("Microsoft Sans Serif", emSize: 10); 98RoundTripOfType(value, FontResolver, out Font? result).Should().BeTrue(); 99result.Should().BeOfType<Font>().Which.Should().Be(value); 144Font? font = result.Should().BeOfType<Font>().Subject;
System\Windows\Forms\OwnerDrawPropertyBagTests.cs (1)
44public void OwnerDrawPropertyBag_Font_Set_GetReturnsExpected(Font value)
System\Windows\Forms\PictureBoxTests.cs (3)
471public void PictureBox_Font_Set_GetReturnsExpected(Font value) 502using Font font1 = new("Arial", 8.25f); 513using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\ProgressBarTests.cs (3)
476public void ProgressBar_Font_Set_GetReturnsExpected(Font value) 507using Font font1 = new("Arial", 8.25f); 518using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\RichTextBoxTests.cs (29)
1333public void RichTextBox_Font_Set_GetReturnsExpected(Font value) 1352public void RichTextBox_Font_SetWithText_GetReturnsExpected(Font value) 1372public void RichTextBox_Font_SetWithNonNullOldValue_GetReturnsExpected(Font value) 1374using Font oldValue = new("Arial", 1); 1394public void RichTextBox_Font_SetWithNonNullOldValueWithText_GetReturnsExpected(Font value) 1396using Font oldValue = new("Arial", 1); 1426public void RichTextBox_Font_SetWithHandle_GetReturnsExpected(bool userPaint, Font value, int expectedInvalidatedCallCount) 1460public void RichTextBox_Font_SetWithTextWithHandle_GetReturnsExpected(bool userPaint, Font value, int expectedInvalidatedCallCount) 1506public void RichTextBox_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint, Font value) 1508using Font oldValue = new("Arial", 1); 1544public void RichTextBox_Font_SetWithNonNullOldValueWithTextWithHandle_GetReturnsExpected(bool userPaint, Font value) 1546using Font oldValue = new("Arial", 1); 1606using (Font font = new(familyName, emSize, style, unit, gdiCharSet)) 1649using Font font1 = new("Arial", 8.25f); 1660using var font2 = SystemFonts.DialogFont; 4662Font result1 = control.SelectionFont; 4667Font result2 = control.SelectionFont; 4685Font result1 = control.SelectionFont; 4693Font result2 = control.SelectionFont; 4756Font font = control.SelectionFont; 4824using Font value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize); 4829Font result1 = control.SelectionFont; 4839Font result2 = control.SelectionFont; 4851using Font value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize); 4862Font result1 = control.SelectionFont; 4875Font result2 = control.SelectionFont; 4893public void RichTextBox_SelectionFont_SetCantCreateHandle_GetReturnsExpected(Font value) 4908public void RichTextBox_SelectionFont_SetDisposed_ThrowsObjectDisposedException(Font value) 4927public unsafe void RichTextBox_SelectionFont_GetCharFormat_Success(Font value, int expectedYHeight, int expectedEffects)
System\Windows\Forms\ScrollBarTests.cs (3)
484public void ScrollBar_Font_Set_GetReturnsExpected(Font value) 515using Font font1 = new("Arial", 8.25f); 526using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\SplitterTests.cs (3)
736public void Splitter_Font_Set_GetReturnsExpected(Font value) 767using Font font1 = new("Arial", 8.25f); 778using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\SystemInformationTests.cs (2)
447Font font = SystemInformation.MenuFont; 847Font font = SystemInformation.GetMenuFontForDpi(dpi);
System\Windows\Forms\TextRendererTests.cs (14)
35public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColor_Success(TextRenderingHint textRenderingHint, string text, Font font, Point pt, Color foreColor) 69public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorColor_Success(TextRenderingHint textRenderingHint, string text, Font font, Point pt, Color foreColor, Color backColor) 106public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text, Font font, Point pt, Color foreColor, TextFormatFlags flags) 147public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text, Font font, Point pt, Color foreColor, Color backColor, TextFormatFlags flags) 179public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColor_Success(TextRenderingHint textRenderingHint, string text, Font font, Rectangle bounds, Color foreColor) 215public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorColor_Success(TextRenderingHint textRenderingHint, string text, Font font, Rectangle rectangle, Color foreColor, Color backColor) 255public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text, Font font, Rectangle rectangle, Color foreColor, TextFormatFlags flags) 299public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text, Font font, Rectangle rectangle, Color foreColor, Color backColor, TextFormatFlags flags) 404public void TextRenderer_MeasureText_InvokeStringFont_ReturnsExpected(string text, Font font) 428public void TextRenderer_MeasureText_InvokeStringFontSize_ReturnsExpected(string text, Font font, Size proposedSize) 460public void TextRenderer_MeasureText_InvokeStringFontSizeTextFormatFlags_ReturnsExpected(string text, Font font, Size proposedSize, TextFormatFlags flags) 472public void TextRenderer_MeasureText_InvokeIDeviceContextStringFont_ReturnsExpected(string text, Font font) 487public void TextRenderer_MeasureText_InvokeIDeviceContextStringFontSize_ReturnsExpected(string text, Font font, Size proposedSize) 502public void TextRenderer_MeasureText_InvokeIDeviceContextStringFontSizeTextFormatFlags_ReturnsExpected(string text, Font font, Size proposedSize, TextFormatFlags flags)
System\Windows\Forms\ToolStripButtonTests.cs (3)
1275using Font font = new("Arial", 8.25f); 1366using Font font = new("Arial", 8.25f); 1465using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripControlHostTests.cs (5)
617using Font value = new("Arial", 8.25f); 966public void ToolStripControlHost_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value) 993using Font font = new("Arial", 8.25f); 1005using Font font = new("Arial", 8.25f); 1045using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripDropDownTests.cs (13)
1485using Font font1 = new("Arial", 8.25f); 1486using Font font2 = new("Arial", 8.5f); 1506using Font font1 = new("Arial", 8.25f); 1507using Font font2 = new("Arial", 8.5f); 1526public void ToolStripDropDown_Font_Set_GetReturnsExpected(Font value) 1557using Font font1 = new("Arial", 8.25f); 1568using var font2 = SystemFonts.DialogFont; 1604using Font font1 = new("Arial", 8.25f); 1619using var font2 = SystemFonts.DialogFont; 1645using Font childFont1 = new("Arial", 1); 1646using Font childFont2 = new("Arial", 1); 1669using Font font1 = new("Arial", 8.25f); 1684using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\ToolStripItemTests.cs (10)
2934using Font font = new("Arial", 8.25f); 2952using Font font = new("Arial", 8.25f); 2975public void ToolStripItem_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value) 3005public void ToolStripItem_Font_SetWithOwner_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value, int expectedOwnerLayoutCallCount) 3046public void ToolStripItem_Font_SetWithOwnerWithHandle_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value, int expectedOwnerLayoutCallCount) 3099public void ToolStripItem_Font_SetWithParent_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value) 3133public void ToolStripItem_Font_SetWithParentWithHandle_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value) 3184using Font font = new("Arial", 8.25f); 3213using Font font = new("Arial", 8.25f); 14119using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (2)
21public void Ctor_ToolStripItem_String_Rectangle_Color_Font_TextFormatFlags(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, TextFormatFlags format) 47public 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)
312public void ToolStripRenderer_DrawItemText_Invoke_CallsRenderItemText(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, TextFormatFlags format) 841public void ToolStripRenderer_OnRenderItemText_Invoke_Nop(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, TextFormatFlags format)
System\Windows\Forms\ToolStripSeparatorTests.cs (1)
320public void ToolStripSeparator_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value)
System\Windows\Forms\ToolStripTests.cs (17)
1401using Font font1 = new("Arial", 8.25f); 1402using Font font2 = new("Arial", 8.5f); 1422using Font font1 = new("Arial", 8.25f); 1423using Font font2 = new("Arial", 8.5f); 1442public void ToolStrip_Font_Set_GetReturnsExpected(Font value) 1473using Font font1 = new("Arial", 8.25f); 1484using var font2 = SystemFonts.DialogFont; 1520using Font font1 = new("Arial", 8.25f); 1535using var font2 = SystemFonts.DialogFont; 1561using Font childFont1 = new("Arial", 1); 1562using Font childFont2 = new("Arial", 1); 1585using Font font1 = new("Arial", 8.25f); 1600using var font2 = SystemFonts.DialogFont; 1627using Font font = new("Microsoft Sans Serif", 8.25f); 1647using Font font = new("Microsoft Sans Serif", 8.25f); 5311using Font childFont1 = new("Arial", 1); 5312using Font childFont2 = new("Arial", 2);
System\Windows\Forms\TreeNodeTests.cs (9)
2801public void TreeNode_NodeFont_Set_GetReturnsExpected(Font value) 2816public void TreeNode_NodeFont_SetWithTreeView_GetReturnsExpected(Font value) 2840public void TreeNode_NodeFont_SetWithTreeViewWithHandle_GetReturnsExpected(Font value, int expectedInvalidatedCallCount) 2871public void TreeNode_NodeFont_SetWithCustomOldValue_GetReturnsExpected(Font value) 2873using Font oldValue = new("Arial", 1); 2889public void TreeNode_NodeFont_SetWithCustomOldValueWithTreeView_GetReturnsExpected(Font value) 2892using Font oldValue = new("Arial", 1); 2917public void TreeNode_NodeFont_SetWithCustomOldValueWithTreeViewWithHandle_GetReturnsExpected(Font value, int expectedInvalidatedCallCount) 2920using Font oldValue = new("Arial", 1);
System\Windows\Forms\TreeViewTests.cs (3)
2704Font font = new(FontFamily.GenericSansSerif, 100); 2712Font smallFont = new(FontFamily.GenericSansSerif, 2); 2723public void ItemHeight_Get_ReturnsExpected(Font font, bool checkBoxes, TreeViewDrawMode drawMode, int expectedHeight)
System\Windows\Forms\VisualStyles\VisualStyleRendererTests.cs (1)
575using Font font = renderer.GetFont(graphics, FontProperty.TextFont);
Text\FontMetrics.cs (5)
20using Font font = new(family, size); 39using Font font = new(family, size); 60using Font font = new(family, size); 78using Font font = new(family, size); 135using Font font = new(family, size);
TextBoxBaseTests.cs (15)
871public void TextBoxBase_Font_Set_GetReturnsExpected(Font value) 890public void TextBoxBase_Font_SetWithText_GetReturnsExpected(Font value) 910public void TextBoxBase_Font_SetWithNonNullOldValue_GetReturnsExpected(Font value) 912using Font oldValue = new("Arial", 1); 932public void TextBoxBase_Font_SetWithNonNullOldValueWithText_GetReturnsExpected(Font value) 934using Font oldValue = new("Arial", 1); 964public void TextBoxBase_Font_SetWithHandle_GetReturnsExpected(bool userPaint, Font value, int expectedInvalidatedCallCount) 998public void TextBoxBase_Font_SetWithTextWithHandle_GetReturnsExpected(bool userPaint, Font value, int expectedInvalidatedCallCount) 1044public void TextBoxBase_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint, Font value) 1046using Font oldValue = new("Arial", 1); 1082public void TextBoxBase_Font_SetWithNonNullOldValueWithTextWithHandle_GetReturnsExpected(bool userPaint, Font value) 1084using Font oldValue = new("Arial", 1); 1133using Font font1 = new("Arial", 8.25f); 1144using var font2 = SystemFonts.DialogFont; 1280using Font font = new("Arial", 8.25f);
TrackBarTests.cs (3)
625public void TrackBar_Font_Set_GetReturnsExpected(Font value) 656using Font font1 = new("Arial", 8.25f); 667using var font2 = SystemFonts.DialogFont;
System.Windows.Forms.TestUtilities (2)
CommonTestHelperEx.cs (2)
44public static TheoryData<Font> GetFontTheoryData() 46TheoryData<Font> data = new()
System.Windows.Forms.UI.IntegrationTests (1)
Dpi\ToolStripItemTests.Dpi.cs (1)
45using Font initialFont = toolStrip.Font = new("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
TestPassApp (1)
PrintingControls.cs (1)
22Font font = new("Times New Roman", 30);
WindowsFormsIntegration (5)
System\Windows\Integration\Convert.cs (3)
209internal static double SystemDrawingFontToSystemWindowsFontSize(SD.Font font) 225internal static FontWeight ToSystemWindowsFontWeight(SD.Font sdFont) 230internal static FontStyle ToSystemWindowsFontStyle(SD.Font sdFont)
System\Windows\Integration\ElementHostPropertyMap.cs (2)
127SD.Font wfFont = value as SD.Font;
WinFormsControlsTest (2)
DataGridViewTest.cs (1)
11private static readonly Font[] s_fonts =
MenuStripAndCheckedListBox.cs (1)
38Font f = menuStrip1.Font;