391 references to FontStyle
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)
228Font columnHeaderFont = new System.Drawing.Font(Font, System.Drawing.FontStyle.Bold);
MS\Internal\Documents\SigningDialog.cs (1)
261_signerlabel.Font = new Font(System.Drawing.SystemFonts.DialogFont, System.Drawing.SystemFonts.DialogFont.Style | FontStyle.Bold);
System.Drawing (1)
System.Drawing.cs (1)
59[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.FontStyle))]
System.Drawing.Common (52)
System\Drawing\Font.cs (26)
24private FontStyle _fontStyle; 43public FontStyle Style => _fontStyle; 49public bool Bold => (Style & FontStyle.Bold) != 0; 55public bool Italic => (Style & FontStyle.Italic) != 0; 61public bool Strikeout => (Style & FontStyle.Strikeout) != 0; 67public bool Underline => (Style & FontStyle.Underline) != 0; 147FontStyle style = (FontStyle)info.GetValue("Style", typeof(FontStyle))!; // Do not rename (binary serialization) 362/// and <see cref='FontStyle'/>. 364public Font(Font prototype, FontStyle newStyle) 374public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit) 382public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet) 390public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 398public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet) 406public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 419public Font(FontFamily family, float emSize, FontStyle style) 429Initialize(family, emSize, FontStyle.Regular, unit, (byte)FONT_CHARSET.DEFAULT_CHARSET, false); 437Initialize(family, emSize, FontStyle.Regular, GraphicsUnit.Point, (byte)FONT_CHARSET.DEFAULT_CHARSET, false); 443public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit) 451public Font(string familyName, float emSize, FontStyle style) 461Initialize(familyName, emSize, FontStyle.Regular, unit, (byte)FONT_CHARSET.DEFAULT_CHARSET, IsVerticalName(familyName)); 469Initialize(familyName, emSize, FontStyle.Regular, GraphicsUnit.Point, (byte)FONT_CHARSET.DEFAULT_CHARSET, IsVerticalName(familyName)); 483FontStyle style; 495private void Initialize(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 511private void Initialize(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont)
System\Drawing\FontConverter.cs (19)
75if (font.Style != FontStyle.Regular) 102else if (font.Style != FontStyle.Regular) 118types[2] = typeof(FontStyle); 172FontStyle fontStyle = FontStyle.Regular; 239fontStyle |= Enum.Parse<FontStyle>(styleText, true); 242FontStyle validBits = FontStyle.Regular | FontStyle.Bold | FontStyle.Italic | FontStyle.Underline | FontStyle.Strikeout; 245throw new InvalidEnumArgumentException(nameof(style), (int)fontStyle, typeof(FontStyle)); 321FontStyle style = FontStyle.Regular; 343style |= FontStyle.Bold; 349style |= FontStyle.Italic; 355style |= FontStyle.Strikeout; 361style |= FontStyle.Underline;
System\Drawing\FontFamily.cs (7)
286/// Indicates whether the specified <see cref='FontStyle'/> is available. 288public bool IsStyleAvailable(FontStyle style) 299public int GetEmHeight(FontStyle style) 310public int GetCellAscent(FontStyle style) 321public int GetCellDescent(FontStyle style) 331/// specified <see cref='FontStyle'/>. 333public int GetLineSpacing(FontStyle style)
System.Drawing.Common.Tests (164)
System\Drawing\FontConverterTests.cs (38)
46public void TestConvertFrom(string input, string expectedName, float expectedSize, GraphicsUnit expectedUnits, FontStyle expectedFontStyle) 100Font font = new($"Courier New", 8.25f, FontStyle.Regular, GraphicsUnit.Point); 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 }, 149public static TheoryData<string, string, float, GraphicsUnit, FontStyle> TestConvertFormData() 152new TheoryData<string, string, float, GraphicsUnit, FontStyle>() 154{ $"Courier New", "Courier New", 8.25f, GraphicsUnit.Point, FontStyle.Regular }, 155{ $"Courier New{Separator} 11", "Courier New", 11f, GraphicsUnit.Point, FontStyle.Regular }, 156{ $"Arial{Separator} 11px", "Arial", 11f, GraphicsUnit.Pixel, FontStyle.Regular }, 157{ $"Courier New{Separator} 11 px", "Courier New", 11f, GraphicsUnit.Pixel, FontStyle.Regular }, 158{ $"Courier New{Separator} 11 px{Separator} style=Regular", "Courier New", 11f, GraphicsUnit.Pixel, FontStyle.Regular }, 159{ $"Courier New{Separator} style=Bold", "Courier New", 8.25f, GraphicsUnit.Point, FontStyle.Bold }, 160{ $"Courier New{Separator} 11 px{Separator} style=Bold{Separator} Italic", "Courier New", 11f, GraphicsUnit.Pixel, FontStyle.Bold | FontStyle.Italic }, 161{ $"Courier New{Separator} 11 px{Separator} style=Regular, Italic", "Courier New", 11f, GraphicsUnit.Pixel, FontStyle.Regular | FontStyle.Italic }, 162{ $"Courier New{Separator} 11 px{Separator} style=Bold{Separator} Italic{Separator} Strikeout", "Courier New", 11f, GraphicsUnit.Pixel, FontStyle.Bold | FontStyle.Italic | FontStyle.Strikeout }, 163{ $"Arial{Separator} 11 px{Separator} style=Bold, Italic, Strikeout", "Arial", 11f, GraphicsUnit.Pixel, FontStyle.Bold | FontStyle.Italic | FontStyle.Strikeout }, 164{ $"11px", "Microsoft Sans Serif", 8.25f, GraphicsUnit.Point, FontStyle.Regular }, 165{ $"Style=Bold", "Microsoft Sans Serif", 8.25f, GraphicsUnit.Point, FontStyle.Regular }, 166{ $"arIAL{Separator} 10{Separator} style=bold", "Arial", 10f, GraphicsUnit.Point, FontStyle.Bold }, 167{ $"Arial{Separator} 10{Separator}", "Arial", 10f, GraphicsUnit.Point, FontStyle.Regular }, 168{ $"Arial{Separator}", "Arial", 8.25f, GraphicsUnit.Point, FontStyle.Regular }, 169{ $"Arial{Separator} 10{Separator} style=12", "Arial", 10f, GraphicsUnit.Point, FontStyle.Underline | FontStyle.Strikeout }, 170{ $"Courier New{Separator} Style=Bold", "Courier New", 8.25f, GraphicsUnit.Point, FontStyle.Bold }, // FullFramework style keyword is case sensitive. 171{ $"11px{Separator} Style=Bold", "Microsoft Sans Serif", 8.25f, GraphicsUnit.Point, FontStyle.Bold} 178data.Add($"{Separator} 10{Separator} style=bold", "", 10f, GraphicsUnit.Point, FontStyle.Bold); 182data.Add($"{Separator} 10{Separator} style=bold", "Microsoft Sans Serif", 10f, GraphicsUnit.Point, FontStyle.Bold);
System\Drawing\FontFamilyTests.cs (13)
163yield return new object[] { FontStyle.Bold }; 164yield return new object[] { FontStyle.Italic }; 165yield return new object[] { FontStyle.Regular }; 166yield return new object[] { FontStyle.Strikeout }; 167yield return new object[] { FontStyle.Strikeout }; 168yield return new object[] { FontStyle.Regular - 1 }; 169yield return new object[] { FontStyle.Strikeout + 1 }; 174public void FontFamilyProperties_CustomFont_ReturnsExpected(FontStyle style) 196AssertExtensions.Throws<ArgumentException>(null, () => family.IsStyleAvailable(FontStyle.Italic)); 208AssertExtensions.Throws<ArgumentException>(null, () => family.GetEmHeight(FontStyle.Italic)); 249AssertExtensions.Throws<ArgumentException>(null, () => family.GetCellAscent(FontStyle.Italic)); 261AssertExtensions.Throws<ArgumentException>(null, () => family.GetCellDescent(FontStyle.Italic)); 273AssertExtensions.Throws<ArgumentException>(null, () => family.GetLineSpacing(FontStyle.Italic));
System\Drawing\FontTests.cs (113)
65VerifyFont(font, fontFamily.Name, emSize, FontStyle.Regular, GraphicsUnit.Point, 1, false); 80VerifyFont(font, fontFamily.Name, emSize, FontStyle.Regular, GraphicsUnit.Point, 1, false); 90yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold }; 91yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic }; 92yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular }; 93yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout }; 94yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline }; 95yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1) }; 96yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue }; 97yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue }; 102public void Ctor_Family_Size_Style(FontFamily fontFamily, float emSize, FontStyle style) 117public void Ctor_FamilyName_Size_Style(FontFamily fontFamily, float emSize, FontStyle style) 147VerifyFont(font, fontFamily.Name, emSize, FontStyle.Regular, unit, 1, false); 162VerifyFont(font, fontFamily.Name, emSize, FontStyle.Regular, unit, 1, false); 172yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold, GraphicsUnit.Document }; 173yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic, GraphicsUnit.Inch }; 174yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular, GraphicsUnit.Millimeter }; 175yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout, GraphicsUnit.Point }; 176yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline, GraphicsUnit.Pixel }; 177yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1), GraphicsUnit.World }; 178yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue, GraphicsUnit.Millimeter }; 179yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue, GraphicsUnit.Millimeter }; 184public void Ctor_Family_Size_Style_Unit(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit) 199public void Ctor_FamilyName_Size_Style_Unit(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit) 214yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold, GraphicsUnit.Document, 0 }; 215yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic, GraphicsUnit.Inch, 1 }; 216yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular, GraphicsUnit.Millimeter, 255 }; 217yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout, GraphicsUnit.Point, 10 }; 218yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline, GraphicsUnit.Pixel, 10 }; 219yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1), GraphicsUnit.World, 8 }; 220yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue, GraphicsUnit.Millimeter, 127 }; 221yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue, GraphicsUnit.Millimeter, 200 }; 226public void Ctor_Family_Size_Style_Unit_GdiCharSet(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet) 241public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet) 256yield return new object[] { FontFamily.GenericMonospace, 1, FontStyle.Bold, GraphicsUnit.Document, 0, true }; 257yield return new object[] { FontFamily.GenericSerif, 2, FontStyle.Italic, GraphicsUnit.Inch, 1, false }; 258yield return new object[] { FontFamily.GenericSansSerif, 3, FontStyle.Regular, GraphicsUnit.Millimeter, 255, true }; 259yield return new object[] { FontFamily.GenericSerif, 4, FontStyle.Strikeout, GraphicsUnit.Point, 10, false }; 260yield return new object[] { FontFamily.GenericSerif, float.MaxValue, FontStyle.Underline, GraphicsUnit.Pixel, 10, true }; 261yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)(-1), GraphicsUnit.World, 8, false }; 262yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MinValue, GraphicsUnit.Millimeter, 127, true }; 263yield return new object[] { FontFamily.GenericSerif, 16, (FontStyle)int.MaxValue, GraphicsUnit.Millimeter, 200, false }; 268public void Ctor_Family_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 283public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamily fontFamily, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) 308Assert.Throws<NullReferenceException>(() => new Font(null, FontStyle.Regular)); 318using Font copy = new(font, FontStyle.Italic); 319Assert.Equal(FontStyle.Italic, copy.Style); 327AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic)); 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)); 344AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic)); 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)); 362AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic)); 363AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic)); 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)); 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); 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 }; 556[InlineData(FontStyle.Bold, int.MinValue, 0)] 557[InlineData(FontStyle.Bold, -2147483099, 0)] 558[InlineData(FontStyle.Regular, -2147483098, 0)] 559[InlineData(FontStyle.Regular, -1, 0)] 560[InlineData(FontStyle.Regular, 0, 0)] 561[InlineData(FontStyle.Regular, 300, 0)] 562[InlineData(FontStyle.Regular, 400, 0)] 563[InlineData(FontStyle.Strikeout | FontStyle.Underline | FontStyle.Italic, 549, 1)] 564[InlineData(FontStyle.Strikeout | FontStyle.Underline | FontStyle.Italic | FontStyle.Bold, 550, 1)] 565[InlineData(FontStyle.Strikeout | FontStyle.Underline | FontStyle.Bold | FontStyle.Italic, int.MaxValue, 1)] 566public void FromLogFont_ValidLogFont_ReturnsExpected(FontStyle fontStyle, int weight, byte charSet) 579lfItalic = (fontStyle & FontStyle.Italic) != 0 ? (byte)1 : (byte)0, 580lfStrikeOut = (fontStyle & FontStyle.Strikeout) != 0 ? (byte)1 : (byte)0, 581lfUnderline = (fontStyle & FontStyle.Underline) != 0 ? (byte)1 : (byte)0, 699[InlineData(FontStyle.Strikeout | FontStyle.Bold | FontStyle.Italic, 255, true, "@", 700)] 700[InlineData(FontStyle.Regular, 0, false, "", 400)] 701[InlineData(FontStyle.Regular, 10, false, "", 400)] 702public void ToLogFont_Invoke_ReturnsExpected(FontStyle fontStyle, byte gdiCharSet, bool gdiVerticalFont, string expectedNamePrefix, int expectedWeight) 827using Font font = new(family, 10, FontStyle.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true); 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) 862Assert.Equal((expectedStyle & FontStyle.Bold) != 0, font.Bold); 863Assert.Equal((expectedStyle & FontStyle.Italic) != 0, font.Italic); 864Assert.Equal((expectedStyle & FontStyle.Strikeout) != 0, font.Strikeout); 865Assert.Equal((expectedStyle & FontStyle.Underline) != 0, font.Underline); 879using Font font1 = new(family1, 1, FontStyle.Bold, GraphicsUnit.Point); 882using Font font2 = new(family2, 1, FontStyle.Bold, GraphicsUnit.Point);
System.Windows.Forms (39)
System\Windows\Forms\ActiveX\AxHost.cs (7)
3764FontStyle style = FontStyle.Regular; 3770style |= FontStyle.Bold; 3775style |= FontStyle.Italic; 3780style |= FontStyle.Underline; 3785style |= FontStyle.Strikeout; 3790style |= FontStyle.Bold;
System\Windows\Forms\Controls\Labels\FocusableLabel.cs (2)
42Font = new Font(Font, FontStyle.Underline); 52Font = new Font(Font, FontStyle.Regular);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
530using Font alwaysUnderlined = new Font(Font, Font.Style | FontStyle.Underline);
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (11)
203FontStyle style = f.Style; 206style |= FontStyle.Underline; 210style &= ~FontStyle.Underline; 215style |= FontStyle.Bold; 219style &= ~FontStyle.Bold; 227FontStyle hoverStyle = f.Style; 230hoverStyle |= FontStyle.Underline; 234hoverStyle &= ~FontStyle.Underline; 239FontStyle linkStyle = f.Style; 242linkStyle |= FontStyle.Underline; 246linkStyle &= ~FontStyle.Underline;
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\Controls\RichTextBox\RichTextBox.cs (6)
2181FontStyle style = FontStyle.Regular; 2184style |= FontStyle.Bold; 2189style |= FontStyle.Italic; 2194style |= FontStyle.Strikeout; 2199style |= FontStyle.Underline;
System\Windows\Forms\Rendering\FontCache.Data.cs (8)
94lfWeight = (int)((font.Style & FontStyle.Bold) == FontStyle.Bold ? FW.BOLD : FW.NORMAL), 95lfItalic = (font.Style & FontStyle.Italic) == FontStyle.Italic ? True : False, 96lfUnderline = (font.Style & FontStyle.Underline) == FontStyle.Underline ? True : False, 97lfStrikeOut = (font.Style & FontStyle.Strikeout) == FontStyle.Strikeout ? True : False,
System.Windows.Forms.Design (13)
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\Drawing\Design\FontNameEditor.cs (8)
15private static readonly FontStyle[] s_fontStyles = 17FontStyle.Regular, 18FontStyle.Italic, 19FontStyle.Bold, 20FontStyle.Bold | FontStyle.Italic 46foreach (var fontStyle in s_fontStyles) 69private static void DrawFontSample(PaintValueEventArgs e, FontFamily fontFamily, FontStyle fontStyle)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
334label.Font = new Font(label.Font, FontStyle.Bold);
System\Windows\Forms\Design\TabOrder.cs (1)
49_tabFont = new Font(_tabFont, FontStyle.Bold);
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (1)
868using Font boldFont = new(_selectedItemName.Font, FontStyle.Bold);
System.Windows.Forms.Design.Tests (2)
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (1)
23contextMenuStrip.Font = new Font("Times New Roman", 10.0f, FontStyle.Italic);
System\Windows\Forms\Design\TabOrderTests.cs (1)
65((Font)accessor._tabFont).Should().Be(new Font(_dialogFont, FontStyle.Bold));
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 (68)
System\Windows\Forms\AxHostTests.cs (8)
1477using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10); 1546using Font font = new("Arial", 10, FontStyle.Bold | FontStyle.Underline | FontStyle.Italic | FontStyle.Strikeout, GraphicsUnit.Point, 10);
System\Windows\Forms\DataGridViewTests.cs (5)
2322using Font formFont1 = new("Times New Roman", 12F, FontStyle.Regular); 2328using Font customFont1 = new("Tahoma", 8.25F, FontStyle.Regular); 2329using Font customFont2 = new("Consolas", 14F, FontStyle.Italic); 2330using Font customFont3 = new("Arial", 9F, FontStyle.Bold); 2371using Font formFont2 = new("Arial Black", 10F, FontStyle.Italic);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
106using Font formFont1 = new("Times New Roman", 12F, FontStyle.Regular); 113using Font customCellStyleFont = new("Tahoma", 8.25F, FontStyle.Regular); 114using Font customColumnHeaderFont = new("Consolas", 14F, FontStyle.Italic); 115using Font customRowHeaderFont = new("Arial", 9F, FontStyle.Bold);
System\Windows\Forms\Ole\BinaryFormatUtilitiesTests.cs (2)
74(typeof(FontStyle).FullName, typeof(FontStyle)),
System\Windows\Forms\RichTextBoxTests.cs (47)
1583yield return new object[] { "Arial", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 1, 165, 0 }; 1584yield return new object[] { "Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_BOLD }; 1585yield return new object[] { "Arial", 8.25f, FontStyle.Italic, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_ITALIC }; 1586yield return new object[] { "Arial", 8.25f, FontStyle.Strikeout, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_STRIKEOUT }; 1587yield return new object[] { "Arial", 8.25f, FontStyle.Underline, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_UNDERLINE }; 1588yield return new object[] { "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 }; 1593public unsafe void RichTextBox_Font_GetCharFormat_Success(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, int expectedYHeight, int expectedEffects) 4706yield return new object[] { 0, 0, 0, Array.Empty<char>(), string.Empty, 13, FontStyle.Regular }; 4707yield return new object[] { 0, 0, 0, arial, "Arial", 13, FontStyle.Regular }; 4708yield return new object[] { 0, 0, 0, new char[] { 'A', 'r', 'i', 'a', 'l', '\0', 'm' }, "Arial", 13, FontStyle.Regular }; 4709yield return new object[] { 0, 0, 0, new char[] { 'N', 'r', 'i', 'a', 'l', '\0', 'm' }, "Nrial", 13, FontStyle.Regular }; 4711yield return new object[] { 0, 0, 200, arial, "Arial", 13, FontStyle.Regular }; 4712yield return new object[] { CFM_MASK.CFM_SIZE, 0, 200, arial, "Arial", 10, FontStyle.Regular }; 4713yield return new object[] { CFM_MASK.CFM_SIZE, 0, 250, arial, "Arial", 12.5f, FontStyle.Regular }; 4714yield return new object[] { CFM_MASK.CFM_SIZE | CFM_MASK.CFM_ALLCAPS, 0, 250, arial, "Arial", 12.5f, FontStyle.Regular }; 4716yield return new object[] { CFM_MASK.CFM_BOLD, CFE_EFFECTS.CFE_BOLD, 0, arial, "Arial", 13, FontStyle.Bold }; 4717yield return new object[] { CFM_MASK.CFM_BOLD, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ALLCAPS, 0, arial, "Arial", 13, FontStyle.Bold }; 4719yield return new object[] { CFM_MASK.CFM_ITALIC, CFE_EFFECTS.CFE_ITALIC, 0, arial, "Arial", 13, FontStyle.Italic }; 4720yield return new object[] { CFM_MASK.CFM_ITALIC, CFE_EFFECTS.CFE_ITALIC | CFE_EFFECTS.CFE_ALLCAPS, 0, arial, "Arial", 13, FontStyle.Italic }; 4722yield return new object[] { CFM_MASK.CFM_STRIKEOUT, CFE_EFFECTS.CFE_STRIKEOUT, 0, arial, "Arial", 13, FontStyle.Strikeout }; 4723yield return new object[] { CFM_MASK.CFM_STRIKEOUT, CFE_EFFECTS.CFE_STRIKEOUT | CFE_EFFECTS.CFE_STRIKEOUT, 0, arial, "Arial", 13, FontStyle.Strikeout }; 4725yield return new object[] { CFM_MASK.CFM_UNDERLINE, CFE_EFFECTS.CFE_UNDERLINE, 0, arial, "Arial", 13, FontStyle.Underline }; 4726yield return new object[] { CFM_MASK.CFM_UNDERLINE, CFE_EFFECTS.CFE_UNDERLINE | CFE_EFFECTS.CFE_UNDERLINE, 0, arial, "Arial", 13, FontStyle.Underline }; 4728yield return new object[] { CFM_MASK.CFM_ALLCAPS, CFE_EFFECTS.CFE_BOLD, 0, arial, "Arial", 13, FontStyle.Regular }; 4729yield return new object[] { CFM_MASK.CFM_ALLCAPS, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ALLCAPS, 0, arial, "Arial", 13, FontStyle.Regular }; 4734public unsafe void RichTextBox_SelectionFont_CustomGetCharFormat_ReturnsExpected(uint mask, uint effects, int yHeight, char[] faceName, string expectedFontName, float expectedSize, FontStyle expectedStyle) 4816yield return new object[] { "Arial", 8.25f, false, FontStyle.Regular, 0, 0, 1 }; 4817yield return new object[] { "Arial", 8.25f, true, FontStyle.Bold | FontStyle.Italic | FontStyle.Regular | FontStyle.Strikeout | FontStyle.Underline, GraphicsUnit.Point, 10, 1 }; 4822public void RichTextBox_SelectionFont_Set_GetReturnsExpected(string fontName, float fontSize, bool hasStyle, FontStyle fontStyle, GraphicsUnit units, byte gdiCharSet, byte expectedGdiCharset) 4849public void RichTextBox_SelectionFont_SetWithHandle_GetReturnsExpected(string fontName, float fontSize, bool hasStyle, FontStyle fontStyle, GraphicsUnit units, byte gdiCharSet, byte expectedGdiCharset) 4918yield return new object[] { new Font("Arial", 8.25f, FontStyle.Bold), 165, CFE_EFFECTS.CFE_BOLD }; 4919yield return new object[] { new Font("Arial", 8.25f, FontStyle.Italic), 165, CFE_EFFECTS.CFE_ITALIC }; 4920yield return new object[] { new Font("Arial", 8.25f, FontStyle.Strikeout), 165, CFE_EFFECTS.CFE_STRIKEOUT }; 4921yield return new object[] { new Font("Arial", 8.25f, FontStyle.Underline), 165, CFE_EFFECTS.CFE_UNDERLINE }; 4922yield return new object[] { new Font("Arial", 8.25f, FontStyle.Bold | FontStyle.Italic | FontStyle.Regular | FontStyle.Strikeout | FontStyle.Underline, GraphicsUnit.Point, 10), 165, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ITALIC | CFE_EFFECTS.CFE_UNDERLINE | CFE_EFFECTS.CFE_STRIKEOUT };
System\Windows\Forms\ToolStripLabelTests.cs (2)
171accessor._hoverLinkFont = new Font("Arial", 10, FontStyle.Underline); 184accessor._hoverLinkFont = new Font("Arial", 10, FontStyle.Underline);
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 (11)
System\Windows\Integration\WindowsFormsHostPropertyMap.cs (11)
158SD.FontStyle style; 161style = SD.FontStyle.Regular; 165style = SD.FontStyle.Italic; 169style |= SD.FontStyle.Bold; 187SD.FontStyle style = CurrentFontStyle; 190style |= SD.FontStyle.Bold; 335private SD.FontStyle CurrentFontStyle 339SD.FontStyle style; 343style = SD.FontStyle.Regular; 347style = SD.FontStyle.Italic; 352style |= SD.FontStyle.Bold;
WinFormsControlsTest (32)
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)));
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);
MultipleControls.Designer.cs (1)
109this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
ToolStripTests.Designer.cs (1)
138this.toolStrip4.Font=new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Bold);