352 instantiations of Font
Accessibility_Core_App (1)
PrintingControls.cs (1)
22Font font = new("Times New Roman", 30);
PresentationUI (3)
MS\Internal\Documents\RMEnrollmentPage1.Designer.cs (1)
150_instructionlabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
232Font columnHeaderFont = new System.Drawing.Font(Font, System.Drawing.FontStyle.Bold);
MS\Internal\Documents\SigningDialog.cs (1)
264_signerlabel.Font = new Font(System.Drawing.SystemFonts.DialogFont, System.Drawing.SystemFonts.DialogFont.Style | FontStyle.Bold);
System.Drawing.Common.Tests (92)
mono\System.Drawing\GraphicsTests.cs (2)
48_font = new Font("Arial", 12); 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 (13)
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\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)
2062=> new(
System.Windows.Forms.Design (10)
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.Tests (2)
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (2)
16Font expectedFont = new Font("Arial", 12.0f); 21contextMenuStrip.Font = new Font("Times New Roman", 10.0f, FontStyle.Italic);
System.Windows.Forms.Primitives (1)
System\Windows\Forms\FontExtensions.cs (1)
22: new(
System.Windows.Forms.Primitives.Tests (5)
System\Windows\Forms\Automation\UiaTextRangeTests.cs (5)
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 (184)
CheckedListBoxTests.cs (1)
408yield return new object[] { new Font("Arial", 8.25f), new Rectangle(10, 20, 30, 40), 1, DrawItemState.Default, Color.Red, Color.Blue };
SerializableTypesTests.cs (3)
161using (Font font = new(FontFamily.GenericSansSerif, 9f)) 208using (Font font = new(FontFamily.GenericSansSerif, 9f)) 354NodeFont = new Font(FontFamily.GenericSansSerif, 9f)
System\Windows\Forms\ApplicationTests.cs (3)
220Font font = new(new FontFamily("Arial"), 12f); 221Font scaled = new(new FontFamily("Arial"), 16f); 310using Font customFont = new(new FontFamily("Arial"), 12f);
System\Windows\Forms\AxHostTests.cs (6)
1446using Font font = new("Arial", 10); 1475using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1509using Font font = new("Arial", 10, unit); 1522using Font font = new("Arial", 10); 1544using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1570using Font font = new("Arial", 10, unit);
System\Windows\Forms\ButtonTests.cs (2)
689using Font font = new("Arial", 100f); 719using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\ComboBoxTests.cs (1)
1017using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (1)
77using Font newFont = new(font.Name, 20.0f);
System\Windows\Forms\ContainerControlTests.cs (1)
460using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\Control.ActiveXFontMarshallerTests.cs (1)
22using Font font = new("Arial", 11.0f, GraphicsUnit.Point);
System\Windows\Forms\ControlTests.ControlCollection.cs (8)
649Font font = new("Arial", 8.25f); 799Font font = new("Arial", 8.25f); 952Font font = new("Arial", 8.25f); 1025Font font = new("Arial", 8.25f); 2352Font font = new("Arial", 8.25f); 2496Font font = new("Arial", 8.25f); 2628Font font = new("Arial", 8.25f); 2692Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Handlers.cs (3)
1784using Font childFont1 = new("Arial", 1); 1785using Font childFont2 = new("Arial", 2); 4488Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Methods.cs (1)
6438using Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Properties.cs (18)
4797using Font font1 = new("Arial", 8.25f); 4798using Font font2 = new("Arial", 8.5f); 4817using Font font1 = new("Arial", 8.25f); 4818using Font font2 = new("Arial", 8.5f); 4855Font font = new("Arial", 8.25f); 4882Font font = new("Arial", 8.25f); 4894Font = new Font("Arial", 1) 4915Font = new Font("Arial", 1) 4934yield return new object[] { userPaint, new Font("Arial", 8.25f), 1 }; 4977yield return new object[] { userPaint, new Font("Arial", 8.25f) }; 4988Font = new Font("Arial", 1) 5033using Font font1 = new("Arial", 8.25f); 5096using Font font1 = new("Arial", 8.25f); 5149using Font childFont1 = new("Arial", 1); 5150using Font childFont2 = new("Arial", 1); 5189using Font font1 = new("Arial", 8.25f); 5246using Font font = new("Arial", 8.25f); 5271using Font font = new("Arial", 8.25f);
System\Windows\Forms\DataGridViewRowTests.cs (1)
2022using Font font = new("Times New Roman", 12);
System\Windows\Forms\DataGridViewTests.cs (7)
2320using Font formFont1 = new("Times New Roman", 12F, FontStyle.Regular); 2326using Font customFont1 = new("Tahoma", 8.25F, FontStyle.Regular); 2327using Font customFont2 = new("Consolas", 14F, FontStyle.Italic); 2328using Font customFont3 = new("Arial", 9F, FontStyle.Bold); 2369using Font formFont2 = new("Arial Black", 10F, FontStyle.Italic); 3507using Font font1 = new("Arial", 12); 3508using Font font2 = new("Times New Roman", 14);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
104using Font formFont1 = new("Times New Roman", 12F, FontStyle.Regular); 111using Font customCellStyleFont = new("Tahoma", 8.25F, FontStyle.Regular); 112using Font customColumnHeaderFont = new("Consolas", 14F, FontStyle.Italic); 113using Font customRowHeaderFont = new("Arial", 9F, FontStyle.Bold);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (4)
548using Font font = new("Arial", 8.25f); 735using Font oldFont = new("Arial", 8.25f); 757using Font font = new("Arial", 8.25f); 945using Font oldFont = new("Arial", 8.25f);
System\Windows\Forms\DateTimePickerTests.cs (2)
284using (Font expectedFont = new("Arial", 8.25f)) 290using (Font differentFont = new("Times New Roman", 10f))
System\Windows\Forms\FontCacheTests.cs (1)
16fonts[i] = new Font("Arial", i + 6);
System\Windows\Forms\FontDialogTests.cs (10)
229using Font font = new("Arial", 8.25f); 241using Font font = new("Arial", 8.25f); 259using Font font = new("Arial", 8.25f); 277using Font font = new("Arial", 8.25f); 291Font font = new("Arial", 8.25f); 314using Font font = new("Arial", 8.25f); 335using Font font = new("Arial", 8.25f); 352using Font font = new("Arial", 8.25f); 583using Font font = new("Arial", 8.25f); 697using Font font = new("Arial", 8.25f);
System\Windows\Forms\GroupBoxTests.cs (3)
576using Font font = new("Arial", 8.25f); 589using Font font = new("Arial", 8.25f); 604using Font newFont = new(originalFont.FontFamily, originalFont.Size + 5, originalFont.Style);
System\Windows\Forms\ListBoxTests.cs (6)
1045yield return new object[] { integralHeight, new Font("Arial", 8.25f) }; 1105yield return new object[] { true, new Font("Arial", 8.25f), 1, 1 }; 1106yield return new object[] { false, new Font("Arial", 8.25f), 1, 2 }; 1151yield return new object[] { true, new Font("Arial", 8.25f), 1, 1 }; 1152yield return new object[] { false, new Font("Arial", 8.25f), 2, 3 }; 1210using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\PictureBoxTests.cs (1)
500using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\ProgressBarTests.cs (1)
505using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\RichTextBoxTests.cs (19)
1372using Font oldValue = new("Arial", 1); 1394using Font oldValue = new("Arial", 1); 1417yield return new object[] { userPaint, new Font("Arial", 8.25f), 1 }; 1497yield return new object[] { userPaint, new Font("Arial", 8.25f) }; 1506using Font oldValue = new("Arial", 1); 1544using Font oldValue = new("Arial", 1); 1604using (Font font = new(familyName, emSize, style, unit, gdiCharSet)) 1647using Font font1 = new("Arial", 8.25f); 4822using Font value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize); 4849using Font value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize); 4886yield return new object[] { new Font("Arial", 8.25f) }; 4915yield return new object[] { new Font("Arial", 8.25f), 165, 0 }; 4916yield return new object[] { new Font("Arial", 8.25f, FontStyle.Bold), 165, CFE_EFFECTS.CFE_BOLD }; 4917yield return new object[] { new Font("Arial", 8.25f, FontStyle.Italic), 165, CFE_EFFECTS.CFE_ITALIC }; 4918yield return new object[] { new Font("Arial", 8.25f, FontStyle.Strikeout), 165, CFE_EFFECTS.CFE_STRIKEOUT }; 4919yield return new object[] { new Font("Arial", 8.25f, FontStyle.Underline), 165, CFE_EFFECTS.CFE_UNDERLINE }; 4920yield 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)
513using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\SplitterTests.cs (1)
765using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\ToolStripButtonTests.cs (3)
1273using Font font = new("Arial", 8.25f); 1364using Font font = new("Arial", 8.25f); 1463using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripControlHostTests.cs (5)
615using Font value = new("Arial", 8.25f); 958yield return new object[] { displayStyle, new Font("Arial", 8.25f) }; 991using Font font = new("Arial", 8.25f); 1003using Font font = new("Arial", 8.25f); 1043using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripDropDownTests.cs (9)
1483using Font font1 = new("Arial", 8.25f); 1484using Font font2 = new("Arial", 8.5f); 1504using Font font1 = new("Arial", 8.25f); 1505using Font font2 = new("Arial", 8.5f); 1555using Font font1 = new("Arial", 8.25f); 1602using Font font1 = new("Arial", 8.25f); 1643using Font childFont1 = new("Arial", 1); 1644using Font childFont2 = new("Arial", 1); 1667using Font font1 = new("Arial", 8.25f);
System\Windows\Forms\ToolStripItemTests.cs (15)
2932using Font font = new("Arial", 8.25f); 2950using Font font = new("Arial", 8.25f); 2967yield return new object[] { displayStyle, new Font("Arial", 8.25f) }; 2995yield return new object[] { ToolStripItemDisplayStyle.None, new Font("Arial", 8.25f), 0 }; 2996yield return new object[] { ToolStripItemDisplayStyle.Text, new Font("Arial", 8.25f), 1 }; 2997yield return new object[] { ToolStripItemDisplayStyle.Image, new Font("Arial", 8.25f), 0 }; 2998yield return new object[] { ToolStripItemDisplayStyle.ImageAndText, new Font("Arial", 8.25f), 1 }; 3182using Font font = new("Arial", 8.25f); 3211using Font font = new("Arial", 8.25f); 12263item.Font = new Font("Arial", 8.25f); 12301item.Font = new Font("Arial", 8.25f); 12362item.Font = new Font("Arial", 8.25f); 12404item.Font = new Font("Arial", 8.25f); 12454item.Font = new Font("Arial", 8.25f); 14117using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripLabelTests.cs (5)
172accessor._linkFont = new Font("Arial", 10); 173accessor._hoverLinkFont = new Font("Arial", 10, FontStyle.Underline); 185accessor._linkFont = new Font("Arial", 10); 186accessor._hoverLinkFont = new Font("Arial", 10, FontStyle.Underline); 188_toolStripLabel.Font = new Font("Times New Roman", 12);
System\Windows\Forms\ToolStripMenuItemTests.cs (1)
286Font = new Font("Arial", 12),
System\Windows\Forms\ToolStripSeparatorTests.cs (1)
312yield return new object[] { displayStyle, new Font("Arial", 8.25f) };
System\Windows\Forms\ToolStripTests.cs (13)
1399using Font font1 = new("Arial", 8.25f); 1400using Font font2 = new("Arial", 8.5f); 1420using Font font1 = new("Arial", 8.25f); 1421using Font font2 = new("Arial", 8.5f); 1471using Font font1 = new("Arial", 8.25f); 1518using Font font1 = new("Arial", 8.25f); 1559using Font childFont1 = new("Arial", 1); 1560using Font childFont2 = new("Arial", 1); 1583using Font font1 = new("Arial", 8.25f); 1625using Font font = new("Microsoft Sans Serif", 8.25f); 1645using Font font = new("Microsoft Sans Serif", 8.25f); 5309using Font childFont1 = new("Arial", 1); 5310using Font childFont2 = new("Arial", 2);
System\Windows\Forms\ToolStripTextBoxTests.cs (1)
188_toolStripTextBox.Font = new Font("Arial", 8.25f);
System\Windows\Forms\TreeNodeTests.cs (5)
2833yield return new object[] { new Font("Arial", 8.25f), 1 }; 2871using Font oldValue = new("Arial", 1); 2890using Font oldValue = new("Arial", 1); 2910yield return new object[] { new Font("Arial", 8.25f), 1 }; 2918using Font oldValue = new("Arial", 1);
System\Windows\Forms\TreeViewTests.cs (2)
2702Font font = new(FontFamily.GenericSansSerif, 100); 2710Font smallFont = new(FontFamily.GenericSansSerif, 2);
Text\FontMetrics.cs (5)
18using Font font = new(family, size); 37using Font font = new(family, size); 58using Font font = new(family, size); 76using Font font = new(family, size); 133using Font font = new(family, size);
TextBoxBaseTests.cs (8)
910using Font oldValue = new("Arial", 1); 932using Font oldValue = new("Arial", 1); 955yield return new object[] { userPaint, new Font("Arial", 8.25f), 1 }; 1035yield return new object[] { userPaint, new Font("Arial", 8.25f) }; 1044using Font oldValue = new("Arial", 1); 1082using Font oldValue = new("Arial", 1); 1131using Font font1 = new("Arial", 8.25f); 1278using Font font = new("Arial", 8.25f);
TrackBarTests.cs (1)
654using 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);
WindowsFormsIntegration (4)
System\Windows\Integration\WindowsFormsHostPropertyMap.cs (4)
142adapter.Font = new SD.Font(familySource, adapter.Font.Size, adapter.Font.Style); 173adapter.Font = new SD.Font(CurrentFontFamily, CurrentFontSize, style); 194adapter.Font = new SD.Font(CurrentFontFamily, CurrentFontSize, style); 210adapter.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);
854 references to Font
Accessibility_Core_App (1)
PrintingControls.cs (1)
22Font font = new("Times New Roman", 30);
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\ApplicationServices\ApplyApplicationDefaultsEventArgs.vb (1)
49Public Property Font As Font
PresentationUI (1)
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
232Font columnHeaderFont = new System.Drawing.Font(Font, System.Drawing.FontStyle.Bold);
System.Drawing (1)
System.Drawing.cs (1)
56[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Font))]
System.Drawing.Common (28)
Special\NotSupported.cs (28)
301public Font(System.Drawing.Font prototype, System.Drawing.FontStyle newStyle) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 351public static System.Drawing.Font FromHdc(System.IntPtr hdc) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 352public static System.Drawing.Font FromHfont(System.IntPtr hfont) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 353public static System.Drawing.Font FromLogFont(object lf) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 354public static System.Drawing.Font FromLogFont(object lf, System.IntPtr hdc) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 542public void DrawString(string? s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 543public void DrawString(string? s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 544public void DrawString(string? s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 545public void DrawString(string? s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 546public void DrawString(string? s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 547public void DrawString(string? s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 642public System.Drawing.Region[] MeasureCharacterRanges(string? text, System.Drawing.Font font, System.Drawing.RectangleF layoutRect, System.Drawing.StringFormat? stringFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 643public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 644public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, System.Drawing.PointF origin, System.Drawing.StringFormat? stringFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 645public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, System.Drawing.SizeF layoutArea) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 646public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, System.Drawing.SizeF layoutArea, System.Drawing.StringFormat? stringFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 647public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, System.Drawing.SizeF layoutArea, System.Drawing.StringFormat? stringFormat, out int charactersFitted, out int linesFilled) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 648public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, int width) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 649public System.Drawing.SizeF MeasureString(string? text, System.Drawing.Font font, int width, System.Drawing.StringFormat? format) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1267public static System.Drawing.Font? CaptionFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1268public static System.Drawing.Font DefaultFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1269public static System.Drawing.Font DialogFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1270public static System.Drawing.Font? IconTitleFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1271public static System.Drawing.Font? MenuFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1272public static System.Drawing.Font? MessageBoxFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1273public static System.Drawing.Font? SmallCaptionFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1274public static System.Drawing.Font? StatusFont { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 1275public static System.Drawing.Font? GetFontByName(string systemFontName) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
System.Drawing.Common.Tests (91)
mono\System.Drawing\GraphicsTests.cs (2)
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 (329)
System\Drawing\Design\UITypeEditor.cs (1)
55[typeof(Font)] = $"System.Drawing.Design.FontEditor, {AssemblyRef.SystemDrawingDesign}",
System\Windows\Forms\ActiveX\AxHost.cs (10)
64private static ConditionalWeakTable<Font, object>? s_fontTable; 338public 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!; 1347/// Sets the default <see cref="Font"/> for process. 1364public static void SetDefaultFont(Font font) 1393Font newSystemFont = SystemFonts.GetFontByName(s_defaultFont.SystemFontName)!; 1406Font? 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)
175private static Font? s_defaultFont; 280private Font? _scaledControlFont; 288private Dictionary<int, Font>? _dpiFonts; 1559public static Font DefaultFont 1804public virtual Font Font 1812Font? previous = Properties.GetValueOrDefault<Font>(s_fontProperty); 1820Font currentFont = Font; 1861internal Font GetScaledFont(Font font, int newDpi, int oldDpi) 1867_dpiFonts ??= new Dictionary<int, Font> 1872if (_dpiFonts.TryGetValue(newDpi, out Font? scaledFont)) 1892foreach (Font font in _dpiFonts.Values) 1919if (TryGetExplicitlySetFont(out Font? font)) 1938if (Properties.TryGetValue(s_currentAmbientFontProperty, out Font? currentAmbient) && currentAmbient == ambientFont) 1966if (TryGetExplicitlySetFont(out Font? font)) 2910internal Font? ScaledControlFont 2948Font? oldFont = null; 4155Font oldFont = Font; 5428private Font GetCurrentFontAndDpi(out int fontDpi) 5438if (TryGetExplicitlySetFont(out Font? font)) 7306Font localFont = GetCurrentFontAndDpi(out int fontDpi); 7317Font fontForDpi = GetScaledFont(localFont, _deviceDpi, fontDpi); 10643private protected bool TryGetExplicitlySetFont([NotNullWhen(true)] out Font? font) => 10651private protected void SetScaledFont(Font scaledFont, bool raiseOnFontChangedEvent = true) 11434Font localFont = GetCurrentFontAndDpi(out int fontDpi); 12484Font 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, 3954internal 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)
281public 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)
63private Font? _defaultFont; 517public 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)) 2318private Font? GetOwnerFont() => Owner?.Font; 3182Font f = Font; 3631internal 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)
24private static Font? s_defaultFont; 25private static readonly ConcurrentDictionary<int, Font> s_defaultFontCache = new(); 51internal static Font DefaultFont 60Font? sysFont; 67if (!s_defaultFontCache.TryGetValue(dpi, out Font? retFont)) 91Font? retFont = s_defaultFont;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
867Font? 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)
218public 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\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)
1400Font 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)
1947Font font, 1979Font font, 1996Font font, 2061internal 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)
2324Font font; 2327font = 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 (35)
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\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 (2)
EnsureEditorsTests.cs (1)
50[InlineData(typeof(Font), typeof(FontEditor))]
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (1)
16Font expectedFont = new Font("Arial", 12.0f);
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 (329)
CheckedListBoxTests.cs (2)
413public void CheckedListBox_OnDrawItem_Invoke_Success(Font font, Rectangle rect, int index, DrawItemState state, Color foreColor, Color backColor) 428public void CheckedListBox_OnDrawItem_InvokeWithHandle_Success(Font font, Rectangle rect, int index, DrawItemState state, Color foreColor, Color backColor)
SerializableTypesTests.cs (2)
161using (Font font = new(FontFamily.GenericSansSerif, 9f)) 208using (Font font = new(FontFamily.GenericSansSerif, 9f))
System\Windows\Forms\AmbientPropertiesTests.cs (1)
54public void Font_Set_GetReturnsExpected(Font value)
System\Windows\Forms\ApplicationTests.cs (11)
197Font customFont = (Font)SystemFonts.CaptionFont.Clone(); 220Font font = new(new FontFamily("Arial"), 12f); 221Font scaled = new(new FontFamily("Arial"), 16f); 258Font font = applicationTestAccessor.s_defaultFont; 270using Font sysFont = SystemFonts.CaptionFont; 281using Font fakeSysFont = sysFont.WithSize(sysFont.Size * 1.25f); 305Font font = applicationTestAccessor.s_defaultFont; 310using Font customFont = new(new FontFamily("Arial"), 12f); 639private static void AreFontEqual(Font expected, Font actual)
System\Windows\Forms\AxHostTests.cs (14)
516public void AxHost_Font_Set_GetReturnsExpected(Font value) 1446using Font font = new("Arial", 10); 1459Font result = SubAxHost.GetFontFromIFont(iFont); 1475using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1488Font result = SubAxHost.GetFontFromIFont(iFont); 1509using Font font = new("Arial", 10, unit); 1522using Font font = new("Arial", 10); 1534Font result = SubAxHost.GetFontFromIFont(iFont); 1544using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1555Font result = SubAxHost.GetFontFromIFont(iFont); 1570using Font font = new("Arial", 10, unit); 3226public static new Font GetFontFromIFont(object font) => AxHost.GetFontFromIFont(font); 3228public static new object GetIFontDispFromFont(Font font) => AxHost.GetIFontDispFromFont(font); 3230public static new object GetIFontFromFont(Font font) => AxHost.GetIFontFromFont(font);
System\Windows\Forms\ButtonTests.cs (4)
668public void Button_Font_Set_GetReturnsExpected(Font value) 689using Font font = new("Arial", 100f); 719using Font font1 = new("Arial", 8.25f); 730using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\ComboBoxTests.cs (3)
986public void ComboBox_Font_Set_GetReturnsExpected(Font value) 1017using Font font1 = new("Arial", 8.25f); 1028using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (5)
42using Font? font = (Font?)converter.ConvertNativeToManaged((VARIANT)(IUnknown*)iFont, s_stubDescriptor); 74using Font? font = (Font?)converter.ConvertNativeToManaged((VARIANT)(IUnknown*)iFont, s_stubDescriptor); 77using Font newFont = new(font.Name, 20.0f);
System\Windows\Forms\ContainerControlTests.cs (4)
406public void ContainerControl_Font_Set_GetReturnsExpected(Font value) 425public void ContainerControl_Font_SetWithAutoScaleModeFont_GetReturnsExpected(Font value) 460using Font font1 = new("Arial", 8.25f); 471using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\Control.ActiveXFontMarshallerTests.cs (3)
22using Font font = new("Arial", 11.0f, GraphicsUnit.Point); 30using Font outFont = (Font)s_marshaler.MarshalNativeToManaged(native);
System\Windows\Forms\ControlPaintTests.cs (2)
1914string s, Font font, Color color, 1962string s, Font font, Color color,
System\Windows\Forms\ControlTests.ControlCollection.cs (8)
649Font font = new("Arial", 8.25f); 799Font font = new("Arial", 8.25f); 952Font font = new("Arial", 8.25f); 1025Font font = new("Arial", 8.25f); 2352Font font = new("Arial", 8.25f); 2496Font font = new("Arial", 8.25f); 2628Font font = new("Arial", 8.25f); 2692Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.cs (1)
493Font font = Control.DefaultFont;
System\Windows\Forms\ControlTests.Handlers.cs (3)
1784using Font childFont1 = new("Arial", 1); 1785using Font childFont2 = new("Arial", 2); 4488Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Methods.cs (1)
6438using Font font = new("Arial", 8.25f);
System\Windows\Forms\ControlTests.Properties.cs (27)
4797using Font font1 = new("Arial", 8.25f); 4798using Font font2 = new("Arial", 8.5f); 4817using Font font1 = new("Arial", 8.25f); 4818using Font font2 = new("Arial", 8.5f); 4836public void Control_Font_Set_GetReturnsExpected(Font value) 4855Font font = new("Arial", 8.25f); 4862public void Control_Font_SetWithFontHeight_GetReturnsExpected(Font value, int expectedFontHeight) 4882Font font = new("Arial", 8.25f); 4889public void Control_Font_SetNonNullOldValueWithFontHeight_GetReturnsExpected(Font value, int expectedFontHeight) 4911public void Control_Font_SetWithNonNullOldValue_GetReturnsExpected(Font value) 4941public void Control_Font_SetWithHandle_GetReturnsExpected(bool userPaint, Font value, int expectedInvalidatedCallCount) 4984public void Control_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint, Font value) 5033using Font font1 = new("Arial", 8.25f); 5044using var font2 = SystemFonts.DialogFont; 5096using Font font1 = new("Arial", 8.25f); 5115using var font2 = SystemFonts.DialogFont; 5149using Font childFont1 = new("Arial", 1); 5150using Font childFont2 = new("Arial", 1); 5189using Font font1 = new("Arial", 8.25f); 5208using var font2 = SystemFonts.DialogFont; 5246using Font font = new("Arial", 8.25f); 5271using Font font = new("Arial", 8.25f); 10718Font font1 = SystemFonts.CaptionFont; 10719Font font2 = SystemFonts.DialogFont; 10892Font font1 = SystemFonts.MenuFont; 10893Font font2 = SystemFonts.DialogFont; 10954Font controlFont = SystemFonts.StatusFont;
System\Windows\Forms\DataGridViewCellStyleTests.cs (3)
265public void DataGridViewCellStyle_Font_Set_GetReturnsExpected(Font value) 838Font font = SystemFonts.DefaultFont; 1119Font font = SystemFonts.DefaultFont;
System\Windows\Forms\DataGridViewRowTests.cs (4)
2021var oldApplicationDefaultFont = Application.DefaultFont; 2022using Font font = new("Times New Roman", 12); 2056Font font1 = SystemFonts.DefaultFont; 2057Font font2 = SystemFonts.MenuFont;
System\Windows\Forms\DataGridViewTests.cs (7)
2320using Font formFont1 = new("Times New Roman", 12F, FontStyle.Regular); 2326using Font customFont1 = new("Tahoma", 8.25F, FontStyle.Regular); 2327using Font customFont2 = new("Consolas", 14F, FontStyle.Italic); 2328using Font customFont3 = new("Arial", 9F, FontStyle.Bold); 2369using Font formFont2 = new("Arial Black", 10F, FontStyle.Italic); 3507using Font font1 = new("Arial", 12); 3508using Font font2 = new("Times New Roman", 14);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
104using Font formFont1 = new("Times New Roman", 12F, FontStyle.Regular); 111using Font customCellStyleFont = new("Tahoma", 8.25F, FontStyle.Regular); 112using Font customColumnHeaderFont = new("Consolas", 14F, FontStyle.Italic); 113using Font customRowHeaderFont = new("Arial", 9F, FontStyle.Bold);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (6)
548using Font font = new("Arial", 8.25f); 733public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_ApplyCellStyleToEditingDataGridViewTextBoxEditingControl_Invoke_Success(DataGridViewCellStyle dataGridViewCellStyle, Font expectedFont, Color expectedBackColor, Color expectedForeColor, bool expectedWordWrap, HorizontalAlignment expectedTextAlign, bool expectedRepositionOnValueChange) 735using Font oldFont = new("Arial", 8.25f); 757using Font font = new("Arial", 8.25f); 942public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_ApplyCellStyleToEditingDataGridViewTextBoxEditingControl_InvokeWithDataGridView_Success(DataGridViewCellStyle dataGridViewCellStyle, Font expectedFont, Color expectedBackColor, Color expectedEditingPanelBackColor, Color expectedForeColor, bool expectedWordWrap, HorizontalAlignment expectedTextAlign, bool expectedRepositionOnValueChange) 945using Font oldFont = new("Arial", 8.25f);
System\Windows\Forms\DateTimePickerTests.cs (2)
284using (Font expectedFont = new("Arial", 8.25f)) 290using (Font differentFont = new("Times New Roman", 10f))
System\Windows\Forms\DrawItemEventArgsTests.cs (2)
22public void DrawItemEventArgs_Ctor_Graphics_Font_Rectangle_Int_DrawItemState(Font font, Rectangle rect, int index, DrawItemState state, Color expectedForeColor, Color expectedBackColor) 47public 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)
21public 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) 73public void DrawListViewColumnHeaderEventArgs_DrawBackground_Invoke_Success(Rectangle bounds, ColumnHeader header, ListViewItemStates state, Color foreColor, Color backColor, Font font) 111public void DrawListViewColumnHeaderEventArgs_DrawText_NullHeader_Success(Rectangle bounds, int columnIndex, ListViewItemStates state, Color foreColor, Color backColor, Font font)
System\Windows\Forms\DrawToolTipEventArgsTests.cs (5)
20public void Ctor_Graphics_IWin32Window_Control_Rectangle_String_Color_Color_Font(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor, Font font) 45public void DrawBackground_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor, Font font) 55public void DrawText_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor, Font font) 65public void DrawText_InvokeTextFormatFlags_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor, Font font) 75public void DrawBorder_Invoke_Success(IWin32Window associatedWindow, Control associatedControl, Rectangle bounds, string toolTipText, Color backColor, Color foreColor, Font font)
System\Windows\Forms\FontCacheTests.cs (2)
13Font[] fonts = new Font[10];
System\Windows\Forms\FontDialogTests.cs (14)
229using Font font = new("Arial", 8.25f); 241using Font font = new("Arial", 8.25f); 247Font result = dialog.Font; 259using Font font = new("Arial", 8.25f); 265Font result = dialog.Font; 277using Font font = new("Arial", 8.25f); 291Font font = new("Arial", 8.25f); 297public void FontDialog_Font_Set_GetReturnsExpected(Font value) 312public void FontDialog_Font_SetWithCustomOldValue_GetReturnsExpected(Font value) 314using Font font = new("Arial", 8.25f); 335using Font font = new("Arial", 8.25f); 352using Font font = new("Arial", 8.25f); 583using Font font = new("Arial", 8.25f); 697using Font font = new("Arial", 8.25f);
System\Windows\Forms\GroupBoxTests.cs (5)
576using Font font = new("Arial", 8.25f); 589using Font font = new("Arial", 8.25f); 603var originalFont = groupBox.Font; 604using Font newFont = new(originalFont.FontFamily, originalFont.Size + 5, originalFont.Style); 611Font updatedCachedFont = accessor.Dynamic._cachedFont;
System\Windows\Forms\ListBoxTests.cs (6)
1051public void ListBox_Font_Set_GetReturnsExpected(bool integralHeight, Font value) 1075public void ListBox_Font_SetWithItems_GetReturnsExpected(bool integralHeight, Font value) 1111public void ListBox_Font_SetWithHandle_GetReturnsExpected(bool integralHeight, Font value, int expectedInvalidatedCallCount1, int expectedInvalidatedCallCount2) 1157public void ListBox_Font_SetWithItemsWithHandle_GetReturnsExpected(bool integralHeight, Font value, int expectedInvalidatedCallCount1, int expectedInvalidatedCallCount2) 1210using Font font1 = new("Arial", 8.25f); 1221using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\ListViewItemConverterTests.cs (10)
192new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 198new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 204new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 210new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 216new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 222new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 230new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 236new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) }, 242new Type[] { typeof(string[]), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 248new Type[] { typeof(string[]), typeof(int), typeof(Color), typeof(Color), typeof(Font) },
System\Windows\Forms\ListViewItemTests.cs (7)
52public 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) 90public 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) 128public 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) 166public void ListViewItem_Ctor_StringArray_Int_Color_Color_Font(string[] subItems, int imageIndex, Color foreColor, Color backColor, Font font, Color expectedForeColor, Color expectedBackColor, string expectedText) 962public void ListViewItem_Font_GetWithOwner_ReturnsExpected(Font value) 980public void ListViewItem_Font_Set_GetReturnsExpected(Font value) 996public void ListViewItem_Font_SetWithOwner_GetReturnsExpected(Font value)
System\Windows\Forms\ListViewSubItemCollectionTests.cs (2)
264public void ListViewSubItemCollection_Add_String_Color_Color_Font_Success(string text, Color foreColor, Color backColor, Font font, Color expectedForeColor, Color expectedBackColor, string expectedText) 394public void ListViewSubItemCollection_AddRange_StringArrayWithStyles_Success(Color foreColor, Color backColor, Font font, Color expectedForeColor, Color expectedBackColor)
System\Windows\Forms\ListViewSubItemConverterTests.cs (1)
61new Type[] { typeof(ListViewItem), typeof(string), typeof(Color), typeof(Color), typeof(Font) },
System\Windows\Forms\ListViewSubItemTests.cs (4)
66public void ListViewSubItem_Ctor_ListViewItem_String_Color_Color_Font(ListViewItem owner, string text, Color foreColor, Color backColor, Font font, Color expectedForeColor, Color expectedBackColor, string expectedText) 271public void ListViewSubItem_Font_Set_GetReturnsExpected(Font value) 286public void ListViewSubItem_Font_SetWithListViewItemWithListView_GetReturnsExpected(Font value) 310public void ListViewSubItem_Font_SetWithListViewItem_GetReturnsExpected(Font value)
System\Windows\Forms\OwnerDrawPropertyBagTests.cs (1)
42public void OwnerDrawPropertyBag_Font_Set_GetReturnsExpected(Font value)
System\Windows\Forms\PictureBoxTests.cs (3)
469public void PictureBox_Font_Set_GetReturnsExpected(Font value) 500using Font font1 = new("Arial", 8.25f); 511using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\ProgressBarTests.cs (3)
474public void ProgressBar_Font_Set_GetReturnsExpected(Font value) 505using Font font1 = new("Arial", 8.25f); 516using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\RichTextBoxTests.cs (29)
1331public void RichTextBox_Font_Set_GetReturnsExpected(Font value) 1350public void RichTextBox_Font_SetWithText_GetReturnsExpected(Font value) 1370public void RichTextBox_Font_SetWithNonNullOldValue_GetReturnsExpected(Font value) 1372using Font oldValue = new("Arial", 1); 1392public void RichTextBox_Font_SetWithNonNullOldValueWithText_GetReturnsExpected(Font value) 1394using Font oldValue = new("Arial", 1); 1424public void RichTextBox_Font_SetWithHandle_GetReturnsExpected(bool userPaint, Font value, int expectedInvalidatedCallCount) 1458public void RichTextBox_Font_SetWithTextWithHandle_GetReturnsExpected(bool userPaint, Font value, int expectedInvalidatedCallCount) 1504public void RichTextBox_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint, Font value) 1506using Font oldValue = new("Arial", 1); 1542public void RichTextBox_Font_SetWithNonNullOldValueWithTextWithHandle_GetReturnsExpected(bool userPaint, Font value) 1544using Font oldValue = new("Arial", 1); 1604using (Font font = new(familyName, emSize, style, unit, gdiCharSet)) 1647using Font font1 = new("Arial", 8.25f); 1658using var font2 = SystemFonts.DialogFont; 4660Font result1 = control.SelectionFont; 4665Font result2 = control.SelectionFont; 4683Font result1 = control.SelectionFont; 4691Font result2 = control.SelectionFont; 4754Font font = control.SelectionFont; 4822using Font value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize); 4827Font result1 = control.SelectionFont; 4837Font result2 = control.SelectionFont; 4849using Font value = hasStyle ? new Font(fontName, fontSize, fontStyle, units, gdiCharSet) : new Font(fontName, fontSize); 4860Font result1 = control.SelectionFont; 4873Font result2 = control.SelectionFont; 4891public void RichTextBox_SelectionFont_SetCantCreateHandle_GetReturnsExpected(Font value) 4906public void RichTextBox_SelectionFont_SetDisposed_ThrowsObjectDisposedException(Font value) 4925public unsafe void RichTextBox_SelectionFont_GetCharFormat_Success(Font value, int expectedYHeight, int expectedEffects)
System\Windows\Forms\ScrollBarTests.cs (3)
482public void ScrollBar_Font_Set_GetReturnsExpected(Font value) 513using Font font1 = new("Arial", 8.25f); 524using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\SplitterTests.cs (3)
734public void Splitter_Font_Set_GetReturnsExpected(Font value) 765using Font font1 = new("Arial", 8.25f); 776using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\SystemInformationTests.cs (2)
445Font font = SystemInformation.MenuFont; 845Font font = SystemInformation.GetMenuFontForDpi(dpi);
System\Windows\Forms\TextRendererTests.cs (14)
33public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColor_Success(TextRenderingHint textRenderingHint, string text, Font font, Point pt, Color foreColor) 67public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorColor_Success(TextRenderingHint textRenderingHint, string text, Font font, Point pt, Color foreColor, Color backColor) 104public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text, Font font, Point pt, Color foreColor, TextFormatFlags flags) 145public void TextRenderer_DrawText_InvokeIDeviceContextStringFontPointColorColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text, Font font, Point pt, Color foreColor, Color backColor, TextFormatFlags flags) 177public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColor_Success(TextRenderingHint textRenderingHint, string text, Font font, Rectangle bounds, Color foreColor) 213public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorColor_Success(TextRenderingHint textRenderingHint, string text, Font font, Rectangle rectangle, Color foreColor, Color backColor) 253public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text, Font font, Rectangle rectangle, Color foreColor, TextFormatFlags flags) 297public void TextRenderer_DrawText_InvokeIDeviceContextStringFontRectangleColorColorTextFormatFlags_Success(TextRenderingHint textRenderingHint, string text, Font font, Rectangle rectangle, Color foreColor, Color backColor, TextFormatFlags flags) 402public void TextRenderer_MeasureText_InvokeStringFont_ReturnsExpected(string text, Font font) 426public void TextRenderer_MeasureText_InvokeStringFontSize_ReturnsExpected(string text, Font font, Size proposedSize) 458public void TextRenderer_MeasureText_InvokeStringFontSizeTextFormatFlags_ReturnsExpected(string text, Font font, Size proposedSize, TextFormatFlags flags) 470public void TextRenderer_MeasureText_InvokeIDeviceContextStringFont_ReturnsExpected(string text, Font font) 485public void TextRenderer_MeasureText_InvokeIDeviceContextStringFontSize_ReturnsExpected(string text, Font font, Size proposedSize) 500public void TextRenderer_MeasureText_InvokeIDeviceContextStringFontSizeTextFormatFlags_ReturnsExpected(string text, Font font, Size proposedSize, TextFormatFlags flags)
System\Windows\Forms\ToolStripButtonTests.cs (3)
1273using Font font = new("Arial", 8.25f); 1364using Font font = new("Arial", 8.25f); 1463using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripControlHostTests.cs (5)
615using Font value = new("Arial", 8.25f); 964public void ToolStripControlHost_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value) 991using Font font = new("Arial", 8.25f); 1003using Font font = new("Arial", 8.25f); 1043using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripDropDownTests.cs (13)
1483using Font font1 = new("Arial", 8.25f); 1484using Font font2 = new("Arial", 8.5f); 1504using Font font1 = new("Arial", 8.25f); 1505using Font font2 = new("Arial", 8.5f); 1524public void ToolStripDropDown_Font_Set_GetReturnsExpected(Font value) 1555using Font font1 = new("Arial", 8.25f); 1566using var font2 = SystemFonts.DialogFont; 1602using Font font1 = new("Arial", 8.25f); 1617using var font2 = SystemFonts.DialogFont; 1643using Font childFont1 = new("Arial", 1); 1644using Font childFont2 = new("Arial", 1); 1667using Font font1 = new("Arial", 8.25f); 1682using var font2 = SystemFonts.DialogFont;
System\Windows\Forms\ToolStripItemTests.cs (10)
2932using Font font = new("Arial", 8.25f); 2950using Font font = new("Arial", 8.25f); 2973public void ToolStripItem_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value) 3003public void ToolStripItem_Font_SetWithOwner_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value, int expectedOwnerLayoutCallCount) 3044public void ToolStripItem_Font_SetWithOwnerWithHandle_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value, int expectedOwnerLayoutCallCount) 3097public void ToolStripItem_Font_SetWithParent_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value) 3131public void ToolStripItem_Font_SetWithParentWithHandle_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value) 3182using Font font = new("Arial", 8.25f); 3211using Font font = new("Arial", 8.25f); 14117using Font font = new("Arial", 8.25f);
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (2)
19public void Ctor_ToolStripItem_String_Rectangle_Color_Font_TextFormatFlags(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, TextFormatFlags format) 45public void Ctor_ToolStripItem_String_Rectangle_Color_Font_ContentAlignment(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, ContentAlignment textAlign, TextFormatFlags expectedTextFormat)
System\Windows\Forms\ToolStripLabelTests.cs (4)
177((Font)accessor._linkFont).Should().BeNull(); 178((Font)accessor._hoverLinkFont).Should().BeNull(); 190((Font)accessor._linkFont).Should().BeNull(); 191((Font)accessor._hoverLinkFont).Should().BeNull();
System\Windows\Forms\ToolStripRendererTests.cs (2)
310public void ToolStripRenderer_DrawItemText_Invoke_CallsRenderItemText(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, TextFormatFlags format) 839public void ToolStripRenderer_OnRenderItemText_Invoke_Nop(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, TextFormatFlags format)
System\Windows\Forms\ToolStripSeparatorTests.cs (1)
318public void ToolStripSeparator_Font_Set_GetReturnsExpected(ToolStripItemDisplayStyle displayStyle, Font value)
System\Windows\Forms\ToolStripTests.cs (17)
1399using Font font1 = new("Arial", 8.25f); 1400using Font font2 = new("Arial", 8.5f); 1420using Font font1 = new("Arial", 8.25f); 1421using Font font2 = new("Arial", 8.5f); 1440public void ToolStrip_Font_Set_GetReturnsExpected(Font value) 1471using Font font1 = new("Arial", 8.25f); 1482using var font2 = SystemFonts.DialogFont; 1518using Font font1 = new("Arial", 8.25f); 1533using var font2 = SystemFonts.DialogFont; 1559using Font childFont1 = new("Arial", 1); 1560using Font childFont2 = new("Arial", 1); 1583using Font font1 = new("Arial", 8.25f); 1598using var font2 = SystemFonts.DialogFont; 1625using Font font = new("Microsoft Sans Serif", 8.25f); 1645using Font font = new("Microsoft Sans Serif", 8.25f); 5309using Font childFont1 = new("Arial", 1); 5310using Font childFont2 = new("Arial", 2);
System\Windows\Forms\TreeNodeTests.cs (9)
2799public void TreeNode_NodeFont_Set_GetReturnsExpected(Font value) 2814public void TreeNode_NodeFont_SetWithTreeView_GetReturnsExpected(Font value) 2838public void TreeNode_NodeFont_SetWithTreeViewWithHandle_GetReturnsExpected(Font value, int expectedInvalidatedCallCount) 2869public void TreeNode_NodeFont_SetWithCustomOldValue_GetReturnsExpected(Font value) 2871using Font oldValue = new("Arial", 1); 2887public void TreeNode_NodeFont_SetWithCustomOldValueWithTreeView_GetReturnsExpected(Font value) 2890using Font oldValue = new("Arial", 1); 2915public void TreeNode_NodeFont_SetWithCustomOldValueWithTreeViewWithHandle_GetReturnsExpected(Font value, int expectedInvalidatedCallCount) 2918using Font oldValue = new("Arial", 1);
System\Windows\Forms\TreeViewTests.cs (3)
2702Font font = new(FontFamily.GenericSansSerif, 100); 2710Font smallFont = new(FontFamily.GenericSansSerif, 2); 2721public void ItemHeight_Get_ReturnsExpected(Font font, bool checkBoxes, TreeViewDrawMode drawMode, int expectedHeight)
System\Windows\Forms\VisualStyles\VisualStyleRendererTests.cs (1)
573using Font font = renderer.GetFont(graphics, FontProperty.TextFont);
Text\FontMetrics.cs (5)
18using Font font = new(family, size); 37using Font font = new(family, size); 58using Font font = new(family, size); 76using Font font = new(family, size); 133using Font font = new(family, size);
TextBoxBaseTests.cs (15)
869public void TextBoxBase_Font_Set_GetReturnsExpected(Font value) 888public void TextBoxBase_Font_SetWithText_GetReturnsExpected(Font value) 908public void TextBoxBase_Font_SetWithNonNullOldValue_GetReturnsExpected(Font value) 910using Font oldValue = new("Arial", 1); 930public void TextBoxBase_Font_SetWithNonNullOldValueWithText_GetReturnsExpected(Font value) 932using Font oldValue = new("Arial", 1); 962public void TextBoxBase_Font_SetWithHandle_GetReturnsExpected(bool userPaint, Font value, int expectedInvalidatedCallCount) 996public void TextBoxBase_Font_SetWithTextWithHandle_GetReturnsExpected(bool userPaint, Font value, int expectedInvalidatedCallCount) 1042public void TextBoxBase_Font_SetWithNonNullOldValueWithHandle_GetReturnsExpected(bool userPaint, Font value) 1044using Font oldValue = new("Arial", 1); 1080public void TextBoxBase_Font_SetWithNonNullOldValueWithTextWithHandle_GetReturnsExpected(bool userPaint, Font value) 1082using Font oldValue = new("Arial", 1); 1131using Font font1 = new("Arial", 8.25f); 1142using var font2 = SystemFonts.DialogFont; 1278using Font font = new("Arial", 8.25f);
TrackBarTests.cs (3)
623public void TrackBar_Font_Set_GetReturnsExpected(Font value) 654using Font font1 = new("Arial", 8.25f); 665using 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);
WindowsFormsIntegration (5)
System\Windows\Integration\Convert.cs (3)
211internal static double SystemDrawingFontToSystemWindowsFontSize(SD.Font font) 227internal static FontWeight ToSystemWindowsFontWeight(SD.Font sdFont) 232internal static FontStyle ToSystemWindowsFontStyle(SD.Font sdFont)
System\Windows\Integration\ElementHostPropertyMap.cs (2)
131SD.Font wfFont = value as SD.Font;
WinFormsControlsTest (2)
DataGridViewTest.cs (1)
11private static readonly Font[] s_fonts =
MenuStripAndCheckedListBox.cs (1)
38Font f = menuStrip1.Font;