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)
228
Font 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)
24
private
FontStyle
_fontStyle;
43
public
FontStyle
Style => _fontStyle;
49
public bool Bold => (Style &
FontStyle
.Bold) != 0;
55
public bool Italic => (Style &
FontStyle
.Italic) != 0;
61
public bool Strikeout => (Style &
FontStyle
.Strikeout) != 0;
67
public bool Underline => (Style &
FontStyle
.Underline) != 0;
147
FontStyle
style = (
FontStyle
)info.GetValue("Style", typeof(
FontStyle
))!; // Do not rename (binary serialization)
362
/// and <see cref='
FontStyle
'/>.
364
public Font(Font prototype,
FontStyle
newStyle)
374
public Font(FontFamily family, float emSize,
FontStyle
style, GraphicsUnit unit)
382
public Font(FontFamily family, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet)
390
public Font(FontFamily family, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont)
398
public Font(string familyName, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet)
406
public Font(string familyName, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont)
419
public Font(FontFamily family, float emSize,
FontStyle
style)
429
Initialize(family, emSize,
FontStyle
.Regular, unit, (byte)FONT_CHARSET.DEFAULT_CHARSET, false);
437
Initialize(family, emSize,
FontStyle
.Regular, GraphicsUnit.Point, (byte)FONT_CHARSET.DEFAULT_CHARSET, false);
443
public Font(string familyName, float emSize,
FontStyle
style, GraphicsUnit unit)
451
public Font(string familyName, float emSize,
FontStyle
style)
461
Initialize(familyName, emSize,
FontStyle
.Regular, unit, (byte)FONT_CHARSET.DEFAULT_CHARSET, IsVerticalName(familyName));
469
Initialize(familyName, emSize,
FontStyle
.Regular, GraphicsUnit.Point, (byte)FONT_CHARSET.DEFAULT_CHARSET, IsVerticalName(familyName));
483
FontStyle
style;
495
private void Initialize(string familyName, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont)
511
private void Initialize(FontFamily family, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont)
System\Drawing\FontConverter.cs (19)
75
if (font.Style !=
FontStyle
.Regular)
102
else if (font.Style !=
FontStyle
.Regular)
118
types[2] = typeof(
FontStyle
);
172
FontStyle
fontStyle =
FontStyle
.Regular;
239
fontStyle |= Enum.Parse<
FontStyle
>(styleText, true);
242
FontStyle
validBits =
FontStyle
.Regular |
FontStyle
.Bold |
FontStyle
.Italic |
FontStyle
.Underline |
FontStyle
.Strikeout;
245
throw new InvalidEnumArgumentException(nameof(style), (int)fontStyle, typeof(
FontStyle
));
321
FontStyle
style =
FontStyle
.Regular;
343
style |=
FontStyle
.Bold;
349
style |=
FontStyle
.Italic;
355
style |=
FontStyle
.Strikeout;
361
style |=
FontStyle
.Underline;
System\Drawing\FontFamily.cs (7)
286
/// Indicates whether the specified <see cref='
FontStyle
'/> is available.
288
public bool IsStyleAvailable(
FontStyle
style)
299
public int GetEmHeight(
FontStyle
style)
310
public int GetCellAscent(
FontStyle
style)
321
public int GetCellDescent(
FontStyle
style)
331
/// specified <see cref='
FontStyle
'/>.
333
public int GetLineSpacing(
FontStyle
style)
System.Drawing.Common.Tests (164)
System\Drawing\FontConverterTests.cs (38)
46
public void TestConvertFrom(string input, string expectedName, float expectedSize, GraphicsUnit expectedUnits,
FontStyle
expectedFontStyle)
100
Font 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 },
149
public static TheoryData<string, string, float, GraphicsUnit,
FontStyle
> TestConvertFormData()
152
new 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}
178
data.Add($"{Separator} 10{Separator} style=bold", "", 10f, GraphicsUnit.Point,
FontStyle
.Bold);
182
data.Add($"{Separator} 10{Separator} style=bold", "Microsoft Sans Serif", 10f, GraphicsUnit.Point,
FontStyle
.Bold);
System\Drawing\FontFamilyTests.cs (13)
163
yield return new object[] {
FontStyle
.Bold };
164
yield return new object[] {
FontStyle
.Italic };
165
yield return new object[] {
FontStyle
.Regular };
166
yield return new object[] {
FontStyle
.Strikeout };
167
yield return new object[] {
FontStyle
.Strikeout };
168
yield return new object[] {
FontStyle
.Regular - 1 };
169
yield return new object[] {
FontStyle
.Strikeout + 1 };
174
public void FontFamilyProperties_CustomFont_ReturnsExpected(
FontStyle
style)
196
AssertExtensions.Throws<ArgumentException>(null, () => family.IsStyleAvailable(
FontStyle
.Italic));
208
AssertExtensions.Throws<ArgumentException>(null, () => family.GetEmHeight(
FontStyle
.Italic));
249
AssertExtensions.Throws<ArgumentException>(null, () => family.GetCellAscent(
FontStyle
.Italic));
261
AssertExtensions.Throws<ArgumentException>(null, () => family.GetCellDescent(
FontStyle
.Italic));
273
AssertExtensions.Throws<ArgumentException>(null, () => family.GetLineSpacing(
FontStyle
.Italic));
System\Drawing\FontTests.cs (113)
65
VerifyFont(font, fontFamily.Name, emSize,
FontStyle
.Regular, GraphicsUnit.Point, 1, false);
80
VerifyFont(font, fontFamily.Name, emSize,
FontStyle
.Regular, GraphicsUnit.Point, 1, false);
90
yield return new object[] { FontFamily.GenericMonospace, 1,
FontStyle
.Bold };
91
yield return new object[] { FontFamily.GenericSerif, 2,
FontStyle
.Italic };
92
yield return new object[] { FontFamily.GenericSansSerif, 3,
FontStyle
.Regular };
93
yield return new object[] { FontFamily.GenericSerif, 4,
FontStyle
.Strikeout };
94
yield return new object[] { FontFamily.GenericSerif, float.MaxValue,
FontStyle
.Underline };
95
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)(-1) };
96
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)int.MinValue };
97
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)int.MaxValue };
102
public void Ctor_Family_Size_Style(FontFamily fontFamily, float emSize,
FontStyle
style)
117
public void Ctor_FamilyName_Size_Style(FontFamily fontFamily, float emSize,
FontStyle
style)
147
VerifyFont(font, fontFamily.Name, emSize,
FontStyle
.Regular, unit, 1, false);
162
VerifyFont(font, fontFamily.Name, emSize,
FontStyle
.Regular, unit, 1, false);
172
yield return new object[] { FontFamily.GenericMonospace, 1,
FontStyle
.Bold, GraphicsUnit.Document };
173
yield return new object[] { FontFamily.GenericSerif, 2,
FontStyle
.Italic, GraphicsUnit.Inch };
174
yield return new object[] { FontFamily.GenericSansSerif, 3,
FontStyle
.Regular, GraphicsUnit.Millimeter };
175
yield return new object[] { FontFamily.GenericSerif, 4,
FontStyle
.Strikeout, GraphicsUnit.Point };
176
yield return new object[] { FontFamily.GenericSerif, float.MaxValue,
FontStyle
.Underline, GraphicsUnit.Pixel };
177
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)(-1), GraphicsUnit.World };
178
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)int.MinValue, GraphicsUnit.Millimeter };
179
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)int.MaxValue, GraphicsUnit.Millimeter };
184
public void Ctor_Family_Size_Style_Unit(FontFamily fontFamily, float emSize,
FontStyle
style, GraphicsUnit unit)
199
public void Ctor_FamilyName_Size_Style_Unit(FontFamily fontFamily, float emSize,
FontStyle
style, GraphicsUnit unit)
214
yield return new object[] { FontFamily.GenericMonospace, 1,
FontStyle
.Bold, GraphicsUnit.Document, 0 };
215
yield return new object[] { FontFamily.GenericSerif, 2,
FontStyle
.Italic, GraphicsUnit.Inch, 1 };
216
yield return new object[] { FontFamily.GenericSansSerif, 3,
FontStyle
.Regular, GraphicsUnit.Millimeter, 255 };
217
yield return new object[] { FontFamily.GenericSerif, 4,
FontStyle
.Strikeout, GraphicsUnit.Point, 10 };
218
yield return new object[] { FontFamily.GenericSerif, float.MaxValue,
FontStyle
.Underline, GraphicsUnit.Pixel, 10 };
219
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)(-1), GraphicsUnit.World, 8 };
220
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)int.MinValue, GraphicsUnit.Millimeter, 127 };
221
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)int.MaxValue, GraphicsUnit.Millimeter, 200 };
226
public void Ctor_Family_Size_Style_Unit_GdiCharSet(FontFamily fontFamily, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet)
241
public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet(FontFamily fontFamily, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet)
256
yield return new object[] { FontFamily.GenericMonospace, 1,
FontStyle
.Bold, GraphicsUnit.Document, 0, true };
257
yield return new object[] { FontFamily.GenericSerif, 2,
FontStyle
.Italic, GraphicsUnit.Inch, 1, false };
258
yield return new object[] { FontFamily.GenericSansSerif, 3,
FontStyle
.Regular, GraphicsUnit.Millimeter, 255, true };
259
yield return new object[] { FontFamily.GenericSerif, 4,
FontStyle
.Strikeout, GraphicsUnit.Point, 10, false };
260
yield return new object[] { FontFamily.GenericSerif, float.MaxValue,
FontStyle
.Underline, GraphicsUnit.Pixel, 10, true };
261
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)(-1), GraphicsUnit.World, 8, false };
262
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)int.MinValue, GraphicsUnit.Millimeter, 127, true };
263
yield return new object[] { FontFamily.GenericSerif, 16, (
FontStyle
)int.MaxValue, GraphicsUnit.Millimeter, 200, false };
268
public void Ctor_Family_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamily fontFamily, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont)
283
public void Ctor_FamilyName_Size_Style_Unit_GdiCharSet_GdiVerticalFont(FontFamily fontFamily, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont)
308
Assert.Throws<NullReferenceException>(() => new Font(null,
FontStyle
.Regular));
318
using Font copy = new(font,
FontStyle
.Italic);
319
Assert.Equal(
FontStyle
.Italic, copy.Style);
327
AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10,
FontStyle
.Italic));
329
AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10,
FontStyle
.Italic, GraphicsUnit.Display));
330
AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10,
FontStyle
.Italic, GraphicsUnit.Display, 10));
331
AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10,
FontStyle
.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true));
344
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10,
FontStyle
.Italic));
346
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10,
FontStyle
.Italic, GraphicsUnit.Display));
347
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10,
FontStyle
.Italic, GraphicsUnit.Display, 10));
348
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10,
FontStyle
.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true));
362
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize,
FontStyle
.Italic));
363
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize,
FontStyle
.Italic));
366
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize,
FontStyle
.Italic, GraphicsUnit.Document));
367
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize,
FontStyle
.Italic, GraphicsUnit.Document));
368
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize,
FontStyle
.Italic, GraphicsUnit.Document, 10));
369
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize,
FontStyle
.Italic, GraphicsUnit.Document, 10));
370
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize,
FontStyle
.Italic, GraphicsUnit.Document, 10, gdiVerticalFont: true));
371
AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize,
FontStyle
.Italic, GraphicsUnit.Document, 10, gdiVerticalFont: true));
383
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10,
FontStyle
.Italic, unit));
384
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10,
FontStyle
.Italic, unit));
385
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10,
FontStyle
.Italic, unit, 10));
386
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10,
FontStyle
.Italic, unit, 10));
387
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10,
FontStyle
.Italic, unit, 10, gdiVerticalFont: true));
388
AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10,
FontStyle
.Italic, unit, 10, gdiVerticalFont: true));
395
using Font font = new(family, 10,
FontStyle
.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
420
Font font = new(family, 10,
FontStyle
.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
423
yield return new object[] { font.Clone(), new Font(family, 10,
FontStyle
.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true), false };
424
yield return new object[] { font.Clone(), new Font(family, 9,
FontStyle
.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true), false };
425
yield return new object[] { font.Clone(), new Font(family, 10,
FontStyle
.Italic, GraphicsUnit.Millimeter, 10, gdiVerticalFont: true), false };
426
yield return new object[] { font.Clone(), new Font(family, 10,
FontStyle
.Bold, GraphicsUnit.Inch, 9, gdiVerticalFont: true), false };
427
yield return new object[] { font.Clone(), new Font(family, 10,
FontStyle
.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: false), false };
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)]
566
public void FromLogFont_ValidLogFont_ReturnsExpected(
FontStyle
fontStyle, int weight, byte charSet)
579
lfItalic = (fontStyle &
FontStyle
.Italic) != 0 ? (byte)1 : (byte)0,
580
lfStrikeOut = (fontStyle &
FontStyle
.Strikeout) != 0 ? (byte)1 : (byte)0,
581
lfUnderline = (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)]
702
public void ToLogFont_Invoke_ReturnsExpected(
FontStyle
fontStyle, byte gdiCharSet, bool gdiVerticalFont, string expectedNamePrefix, int expectedWeight)
827
using Font font = new(family, 10,
FontStyle
.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
852
using Font font = new(family, 10,
FontStyle
.Bold, GraphicsUnit.Inch, 10, gdiVerticalFont: true);
856
private static void VerifyFont(Font font, string expectedName, float expectedEmSize,
FontStyle
expectedStyle, GraphicsUnit expectedUnit, byte expectedGdiCharset, bool expectedGdiVerticalFont)
862
Assert.Equal((expectedStyle &
FontStyle
.Bold) != 0, font.Bold);
863
Assert.Equal((expectedStyle &
FontStyle
.Italic) != 0, font.Italic);
864
Assert.Equal((expectedStyle &
FontStyle
.Strikeout) != 0, font.Strikeout);
865
Assert.Equal((expectedStyle &
FontStyle
.Underline) != 0, font.Underline);
879
using Font font1 = new(family1, 1,
FontStyle
.Bold, GraphicsUnit.Point);
882
using Font font2 = new(family2, 1,
FontStyle
.Bold, GraphicsUnit.Point);
System.Windows.Forms (39)
System\Windows\Forms\ActiveX\AxHost.cs (7)
3764
FontStyle
style =
FontStyle
.Regular;
3770
style |=
FontStyle
.Bold;
3775
style |=
FontStyle
.Italic;
3780
style |=
FontStyle
.Underline;
3785
style |=
FontStyle
.Strikeout;
3790
style |=
FontStyle
.Bold;
System\Windows\Forms\Controls\Labels\FocusableLabel.cs (2)
42
Font = new Font(Font,
FontStyle
.Underline);
52
Font = new Font(Font,
FontStyle
.Regular);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
530
using Font alwaysUnderlined = new Font(Font, Font.Style |
FontStyle
.Underline);
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (11)
203
FontStyle
style = f.Style;
206
style |=
FontStyle
.Underline;
210
style &= ~
FontStyle
.Underline;
215
style |=
FontStyle
.Bold;
219
style &= ~
FontStyle
.Bold;
227
FontStyle
hoverStyle = f.Style;
230
hoverStyle |=
FontStyle
.Underline;
234
hoverStyle &= ~
FontStyle
.Underline;
239
FontStyle
linkStyle = f.Style;
242
linkStyle |=
FontStyle
.Underline;
246
linkStyle &= ~
FontStyle
.Underline;
System\Windows\Forms\Controls\ListView\ListView.cs (2)
2607
_odCacheFont = new Font(_odCacheFont,
FontStyle
.Bold);
2794
subItemFont = new Font(item.SubItems[0].Font,
FontStyle
.Underline);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (1)
232
_titleLabel.Font = new(Font,
FontStyle
.Bold);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
1304
public Font GetBoldFont() => _boldFont ??= new Font(Font,
FontStyle
.Bold);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (6)
2181
FontStyle
style =
FontStyle
.Regular;
2184
style |=
FontStyle
.Bold;
2189
style |=
FontStyle
.Italic;
2194
style |=
FontStyle
.Strikeout;
2199
style |=
FontStyle
.Underline;
System\Windows\Forms\Rendering\FontCache.Data.cs (8)
94
lfWeight = (int)((font.Style &
FontStyle
.Bold) ==
FontStyle
.Bold ? FW.BOLD : FW.NORMAL),
95
lfItalic = (font.Style &
FontStyle
.Italic) ==
FontStyle
.Italic ? True : False,
96
lfUnderline = (font.Style &
FontStyle
.Underline) ==
FontStyle
.Underline ? True : False,
97
lfStrikeOut = (font.Style &
FontStyle
.Strikeout) ==
FontStyle
.Strikeout ? True : False,
System.Windows.Forms.Design (13)
System\ComponentModel\Design\DesignerActionPanel.HeaderLine.cs (1)
16
protected override Font GetFont() => new(ActionPanel.Font,
FontStyle
.Bold);
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (1)
94
_titleLabel.Font = new Font(ActionPanel.Font,
FontStyle
.Bold);
System\Drawing\Design\FontNameEditor.cs (8)
15
private static readonly
FontStyle
[] s_fontStyles =
17
FontStyle
.Regular,
18
FontStyle
.Italic,
19
FontStyle
.Bold,
20
FontStyle
.Bold |
FontStyle
.Italic
46
foreach (
var
fontStyle in s_fontStyles)
69
private static void DrawFontSample(PaintValueEventArgs e, FontFamily fontFamily,
FontStyle
fontStyle)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
334
label.Font = new Font(label.Font,
FontStyle
.Bold);
System\Windows\Forms\Design\TabOrder.cs (1)
49
_tabFont = new Font(_tabFont,
FontStyle
.Bold);
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (1)
868
using Font boldFont = new(_selectedItemName.Font,
FontStyle
.Bold);
System.Windows.Forms.Design.Tests (2)
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (1)
23
contextMenuStrip.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)
531
using Font font = new("Segoe UI", 9,
FontStyle
.Regular);
618
using Font font = new("Arial", 9f,
FontStyle
.Regular);
711
using Font font = new("Arial", 9f,
FontStyle
.Regular);
793
using Font font = new("Arial", 9f,
FontStyle
.Regular);
1200
using Font font = new("Arial", fontSize,
FontStyle
.Regular);
System.Windows.Forms.Tests (68)
System\Windows\Forms\AxHostTests.cs (8)
1477
using Font font = new("Arial", 10,
FontStyle
.Bold |
FontStyle
.Underline |
FontStyle
.Italic |
FontStyle
.Strikeout, GraphicsUnit.Point, 10);
1546
using Font font = new("Arial", 10,
FontStyle
.Bold |
FontStyle
.Underline |
FontStyle
.Italic |
FontStyle
.Strikeout, GraphicsUnit.Point, 10);
System\Windows\Forms\DataGridViewTests.cs (5)
2322
using Font formFont1 = new("Times New Roman", 12F,
FontStyle
.Regular);
2328
using Font customFont1 = new("Tahoma", 8.25F,
FontStyle
.Regular);
2329
using Font customFont2 = new("Consolas", 14F,
FontStyle
.Italic);
2330
using Font customFont3 = new("Arial", 9F,
FontStyle
.Bold);
2371
using Font formFont2 = new("Arial Black", 10F,
FontStyle
.Italic);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
106
using Font formFont1 = new("Times New Roman", 12F,
FontStyle
.Regular);
113
using Font customCellStyleFont = new("Tahoma", 8.25F,
FontStyle
.Regular);
114
using Font customColumnHeaderFont = new("Consolas", 14F,
FontStyle
.Italic);
115
using Font customRowHeaderFont = new("Arial", 9F,
FontStyle
.Bold);
System\Windows\Forms\Ole\BinaryFormatUtilitiesTests.cs (2)
74
(typeof(
FontStyle
).FullName, typeof(
FontStyle
)),
System\Windows\Forms\RichTextBoxTests.cs (47)
1583
yield return new object[] { "Arial", 8.25f,
FontStyle
.Regular, GraphicsUnit.Point, 1, 165, 0 };
1584
yield return new object[] { "Arial", 8.25f,
FontStyle
.Bold, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_BOLD };
1585
yield return new object[] { "Arial", 8.25f,
FontStyle
.Italic, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_ITALIC };
1586
yield return new object[] { "Arial", 8.25f,
FontStyle
.Strikeout, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_STRIKEOUT };
1587
yield return new object[] { "Arial", 8.25f,
FontStyle
.Underline, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_UNDERLINE };
1588
yield 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 };
1593
public unsafe void RichTextBox_Font_GetCharFormat_Success(string familyName, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet, int expectedYHeight, int expectedEffects)
4706
yield return new object[] { 0, 0, 0, Array.Empty<char>(), string.Empty, 13,
FontStyle
.Regular };
4707
yield return new object[] { 0, 0, 0, arial, "Arial", 13,
FontStyle
.Regular };
4708
yield return new object[] { 0, 0, 0, new char[] { 'A', 'r', 'i', 'a', 'l', '\0', 'm' }, "Arial", 13,
FontStyle
.Regular };
4709
yield return new object[] { 0, 0, 0, new char[] { 'N', 'r', 'i', 'a', 'l', '\0', 'm' }, "Nrial", 13,
FontStyle
.Regular };
4711
yield return new object[] { 0, 0, 200, arial, "Arial", 13,
FontStyle
.Regular };
4712
yield return new object[] { CFM_MASK.CFM_SIZE, 0, 200, arial, "Arial", 10,
FontStyle
.Regular };
4713
yield return new object[] { CFM_MASK.CFM_SIZE, 0, 250, arial, "Arial", 12.5f,
FontStyle
.Regular };
4714
yield return new object[] { CFM_MASK.CFM_SIZE | CFM_MASK.CFM_ALLCAPS, 0, 250, arial, "Arial", 12.5f,
FontStyle
.Regular };
4716
yield return new object[] { CFM_MASK.CFM_BOLD, CFE_EFFECTS.CFE_BOLD, 0, arial, "Arial", 13,
FontStyle
.Bold };
4717
yield return new object[] { CFM_MASK.CFM_BOLD, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ALLCAPS, 0, arial, "Arial", 13,
FontStyle
.Bold };
4719
yield return new object[] { CFM_MASK.CFM_ITALIC, CFE_EFFECTS.CFE_ITALIC, 0, arial, "Arial", 13,
FontStyle
.Italic };
4720
yield return new object[] { CFM_MASK.CFM_ITALIC, CFE_EFFECTS.CFE_ITALIC | CFE_EFFECTS.CFE_ALLCAPS, 0, arial, "Arial", 13,
FontStyle
.Italic };
4722
yield return new object[] { CFM_MASK.CFM_STRIKEOUT, CFE_EFFECTS.CFE_STRIKEOUT, 0, arial, "Arial", 13,
FontStyle
.Strikeout };
4723
yield return new object[] { CFM_MASK.CFM_STRIKEOUT, CFE_EFFECTS.CFE_STRIKEOUT | CFE_EFFECTS.CFE_STRIKEOUT, 0, arial, "Arial", 13,
FontStyle
.Strikeout };
4725
yield return new object[] { CFM_MASK.CFM_UNDERLINE, CFE_EFFECTS.CFE_UNDERLINE, 0, arial, "Arial", 13,
FontStyle
.Underline };
4726
yield return new object[] { CFM_MASK.CFM_UNDERLINE, CFE_EFFECTS.CFE_UNDERLINE | CFE_EFFECTS.CFE_UNDERLINE, 0, arial, "Arial", 13,
FontStyle
.Underline };
4728
yield return new object[] { CFM_MASK.CFM_ALLCAPS, CFE_EFFECTS.CFE_BOLD, 0, arial, "Arial", 13,
FontStyle
.Regular };
4729
yield return new object[] { CFM_MASK.CFM_ALLCAPS, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ALLCAPS, 0, arial, "Arial", 13,
FontStyle
.Regular };
4734
public unsafe void RichTextBox_SelectionFont_CustomGetCharFormat_ReturnsExpected(uint mask, uint effects, int yHeight, char[] faceName, string expectedFontName, float expectedSize,
FontStyle
expectedStyle)
4816
yield return new object[] { "Arial", 8.25f, false,
FontStyle
.Regular, 0, 0, 1 };
4817
yield return new object[] { "Arial", 8.25f, true,
FontStyle
.Bold |
FontStyle
.Italic |
FontStyle
.Regular |
FontStyle
.Strikeout |
FontStyle
.Underline, GraphicsUnit.Point, 10, 1 };
4822
public void RichTextBox_SelectionFont_Set_GetReturnsExpected(string fontName, float fontSize, bool hasStyle,
FontStyle
fontStyle, GraphicsUnit units, byte gdiCharSet, byte expectedGdiCharset)
4849
public void RichTextBox_SelectionFont_SetWithHandle_GetReturnsExpected(string fontName, float fontSize, bool hasStyle,
FontStyle
fontStyle, GraphicsUnit units, byte gdiCharSet, byte expectedGdiCharset)
4918
yield return new object[] { new Font("Arial", 8.25f,
FontStyle
.Bold), 165, CFE_EFFECTS.CFE_BOLD };
4919
yield return new object[] { new Font("Arial", 8.25f,
FontStyle
.Italic), 165, CFE_EFFECTS.CFE_ITALIC };
4920
yield return new object[] { new Font("Arial", 8.25f,
FontStyle
.Strikeout), 165, CFE_EFFECTS.CFE_STRIKEOUT };
4921
yield return new object[] { new Font("Arial", 8.25f,
FontStyle
.Underline), 165, CFE_EFFECTS.CFE_UNDERLINE };
4922
yield return new object[] { new Font("Arial", 8.25f,
FontStyle
.Bold |
FontStyle
.Italic |
FontStyle
.Regular |
FontStyle
.Strikeout |
FontStyle
.Underline, GraphicsUnit.Point, 10), 165, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ITALIC | CFE_EFFECTS.CFE_UNDERLINE | CFE_EFFECTS.CFE_STRIKEOUT };
System\Windows\Forms\ToolStripLabelTests.cs (2)
171
accessor._hoverLinkFont = new Font("Arial", 10,
FontStyle
.Underline);
184
accessor._hoverLinkFont = new Font("Arial", 10,
FontStyle
.Underline);
System.Windows.Forms.UI.IntegrationTests (1)
Dpi\ToolStripItemTests.Dpi.cs (1)
45
using Font initialFont = toolStrip.Font = new("Segoe UI", 9F,
FontStyle
.Bold, GraphicsUnit.Point);
WindowsFormsIntegration (11)
System\Windows\Integration\WindowsFormsHostPropertyMap.cs (11)
158
SD.
FontStyle
style;
161
style = SD.
FontStyle
.Regular;
165
style = SD.
FontStyle
.Italic;
169
style |= SD.
FontStyle
.Bold;
187
SD.
FontStyle
style = CurrentFontStyle;
190
style |= SD.
FontStyle
.Bold;
335
private SD.
FontStyle
CurrentFontStyle
339
SD.
FontStyle
style;
343
style = SD.
FontStyle
.Regular;
347
style = SD.
FontStyle
.Italic;
352
style |= SD.
FontStyle
.Bold;
WinFormsControlsTest (32)
ChartControl.cs (1)
40
chart4.Series[0].Font = new Font("Trebuchet MS", 8,
FontStyle
.Bold);
ChartControl.Designer.cs (16)
110
chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
114
chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
133
legend1.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
172
title1.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.
FontStyle
.Bold);
195
chartArea2.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
201
chartArea2.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
246
title2.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.
FontStyle
.Bold);
269
chartArea3.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
272
chartArea3.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
284
legend3.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
308
title3.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.
FontStyle
.Bold);
329
chartArea4.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
336
chartArea4.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
352
legend4.Font = new System.Drawing.Font("Trebuchet MS", 8F, System.Drawing.
FontStyle
.Bold);
365
series7.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.
FontStyle
.Bold);
402
title4.Font = new System.Drawing.Font("Trebuchet MS", 14.25F, System.Drawing.
FontStyle
.Bold);
DataGridViewInVirtualModeTest.Designer.cs (1)
87
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.
FontStyle
.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
DataGridViewTest.cs (5)
13
new Font("Tahoma", 12F,
FontStyle
.Regular),
14
new Font("Consolas", 14F,
FontStyle
.Italic),
15
new Font("Arial", 9F,
FontStyle
.Bold),
16
new Font("Microsoft Sans Serif", 11F,
FontStyle
.Regular)
93
Font = new Font("Tahoma", (float)numericUpDown1.Value,
FontStyle
.Regular);
DataGridViewTest.Designer.cs (5)
58
dataGridViewCellStyle1.Font = new System.Drawing.Font("Cascadia Code", 12F, System.Drawing.
FontStyle
.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
76
dataGridViewCellStyle3.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.
FontStyle
.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
148
this.changeFontButton.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.
FontStyle
.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
196
this.resetFontButton.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.
FontStyle
.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
216
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.
FontStyle
.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
ErrorProviderTest.Designer.cs (2)
59
this.label1.Font = new System.Drawing.Font("Calibri", 12F,
FontStyle
.Bold);
89
this.label2.Font = new System.Drawing.Font("Calibri", 12F,
FontStyle
.Bold);
MultipleControls.Designer.cs (1)
109
this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.
FontStyle
.Regular, System.Drawing.GraphicsUnit.Point);
ToolStripTests.Designer.cs (1)
138
this.toolStrip4.Font=new System.Drawing.Font("Calibri", 12F, System.Drawing.
FontStyle
.Bold);