348 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)
232
Font 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 (1)
System.Drawing.cs (1)
59
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.
FontStyle
))]
System.Drawing.Common (15)
Special\NotSupported.cs (15)
301
public Font(System.Drawing.Font prototype, System.Drawing.
FontStyle
newStyle) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
303
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.
FontStyle
style) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
304
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.
FontStyle
style, System.Drawing.GraphicsUnit unit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
305
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.
FontStyle
style, System.Drawing.GraphicsUnit unit, byte gdiCharSet) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
306
public Font(System.Drawing.FontFamily family, float emSize, System.Drawing.
FontStyle
style, System.Drawing.GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
309
public Font(string familyName, float emSize, System.Drawing.
FontStyle
style) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
310
public Font(string familyName, float emSize, System.Drawing.
FontStyle
style, System.Drawing.GraphicsUnit unit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
311
public Font(string familyName, float emSize, System.Drawing.
FontStyle
style, System.Drawing.GraphicsUnit unit, byte gdiCharSet) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
312
public Font(string familyName, float emSize, System.Drawing.
FontStyle
style, System.Drawing.GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
340
public System.Drawing.
FontStyle
Style { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
409
public int GetCellAscent(System.Drawing.
FontStyle
style) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
410
public int GetCellDescent(System.Drawing.
FontStyle
style) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
411
public int GetEmHeight(System.Drawing.
FontStyle
style) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
415
public int GetLineSpacing(System.Drawing.
FontStyle
style) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
417
public bool IsStyleAvailable(System.Drawing.
FontStyle
style) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
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 (37)
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\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)
2603
_odCacheFont = new Font(_odCacheFont,
FontStyle
.Bold);
2790
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 (12)
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.Tests (1)
System\Windows\Forms\Design\BaseContextMenuStripTests.cs (1)
21
contextMenuStrip.Font = new Font("Times New Roman", 10.0f,
FontStyle
.Italic);
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 (66)
System\Windows\Forms\AxHostTests.cs (8)
1475
using Font font = new("Arial", 10,
FontStyle
.Bold |
FontStyle
.Underline |
FontStyle
.Italic |
FontStyle
.Strikeout, GraphicsUnit.Point, 10);
1544
using Font font = new("Arial", 10,
FontStyle
.Bold |
FontStyle
.Underline |
FontStyle
.Italic |
FontStyle
.Strikeout, GraphicsUnit.Point, 10);
System\Windows\Forms\DataGridViewTests.cs (5)
2320
using Font formFont1 = new("Times New Roman", 12F,
FontStyle
.Regular);
2326
using Font customFont1 = new("Tahoma", 8.25F,
FontStyle
.Regular);
2327
using Font customFont2 = new("Consolas", 14F,
FontStyle
.Italic);
2328
using Font customFont3 = new("Arial", 9F,
FontStyle
.Bold);
2369
using Font formFont2 = new("Arial Black", 10F,
FontStyle
.Italic);
System\Windows\Forms\DataGridViewTests.Rendering.cs (4)
104
using Font formFont1 = new("Times New Roman", 12F,
FontStyle
.Regular);
111
using Font customCellStyleFont = new("Tahoma", 8.25F,
FontStyle
.Regular);
112
using Font customColumnHeaderFont = new("Consolas", 14F,
FontStyle
.Italic);
113
using Font customRowHeaderFont = new("Arial", 9F,
FontStyle
.Bold);
System\Windows\Forms\RichTextBoxTests.cs (47)
1581
yield return new object[] { "Arial", 8.25f,
FontStyle
.Regular, GraphicsUnit.Point, 1, 165, 0 };
1582
yield return new object[] { "Arial", 8.25f,
FontStyle
.Bold, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_BOLD };
1583
yield return new object[] { "Arial", 8.25f,
FontStyle
.Italic, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_ITALIC };
1584
yield return new object[] { "Arial", 8.25f,
FontStyle
.Strikeout, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_STRIKEOUT };
1585
yield return new object[] { "Arial", 8.25f,
FontStyle
.Underline, GraphicsUnit.Point, 1, 165, CFE_EFFECTS.CFE_UNDERLINE };
1586
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 };
1591
public unsafe void RichTextBox_Font_GetCharFormat_Success(string familyName, float emSize,
FontStyle
style, GraphicsUnit unit, byte gdiCharSet, int expectedYHeight, int expectedEffects)
4704
yield return new object[] { 0, 0, 0, Array.Empty<char>(), string.Empty, 13,
FontStyle
.Regular };
4705
yield return new object[] { 0, 0, 0, arial, "Arial", 13,
FontStyle
.Regular };
4706
yield return new object[] { 0, 0, 0, new char[] { 'A', 'r', 'i', 'a', 'l', '\0', 'm' }, "Arial", 13,
FontStyle
.Regular };
4707
yield return new object[] { 0, 0, 0, new char[] { 'N', 'r', 'i', 'a', 'l', '\0', 'm' }, "Nrial", 13,
FontStyle
.Regular };
4709
yield return new object[] { 0, 0, 200, arial, "Arial", 13,
FontStyle
.Regular };
4710
yield return new object[] { CFM_MASK.CFM_SIZE, 0, 200, arial, "Arial", 10,
FontStyle
.Regular };
4711
yield return new object[] { CFM_MASK.CFM_SIZE, 0, 250, arial, "Arial", 12.5f,
FontStyle
.Regular };
4712
yield return new object[] { CFM_MASK.CFM_SIZE | CFM_MASK.CFM_ALLCAPS, 0, 250, arial, "Arial", 12.5f,
FontStyle
.Regular };
4714
yield return new object[] { CFM_MASK.CFM_BOLD, CFE_EFFECTS.CFE_BOLD, 0, arial, "Arial", 13,
FontStyle
.Bold };
4715
yield return new object[] { CFM_MASK.CFM_BOLD, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ALLCAPS, 0, arial, "Arial", 13,
FontStyle
.Bold };
4717
yield return new object[] { CFM_MASK.CFM_ITALIC, CFE_EFFECTS.CFE_ITALIC, 0, arial, "Arial", 13,
FontStyle
.Italic };
4718
yield return new object[] { CFM_MASK.CFM_ITALIC, CFE_EFFECTS.CFE_ITALIC | CFE_EFFECTS.CFE_ALLCAPS, 0, arial, "Arial", 13,
FontStyle
.Italic };
4720
yield return new object[] { CFM_MASK.CFM_STRIKEOUT, CFE_EFFECTS.CFE_STRIKEOUT, 0, arial, "Arial", 13,
FontStyle
.Strikeout };
4721
yield return new object[] { CFM_MASK.CFM_STRIKEOUT, CFE_EFFECTS.CFE_STRIKEOUT | CFE_EFFECTS.CFE_STRIKEOUT, 0, arial, "Arial", 13,
FontStyle
.Strikeout };
4723
yield return new object[] { CFM_MASK.CFM_UNDERLINE, CFE_EFFECTS.CFE_UNDERLINE, 0, arial, "Arial", 13,
FontStyle
.Underline };
4724
yield return new object[] { CFM_MASK.CFM_UNDERLINE, CFE_EFFECTS.CFE_UNDERLINE | CFE_EFFECTS.CFE_UNDERLINE, 0, arial, "Arial", 13,
FontStyle
.Underline };
4726
yield return new object[] { CFM_MASK.CFM_ALLCAPS, CFE_EFFECTS.CFE_BOLD, 0, arial, "Arial", 13,
FontStyle
.Regular };
4727
yield return new object[] { CFM_MASK.CFM_ALLCAPS, CFE_EFFECTS.CFE_BOLD | CFE_EFFECTS.CFE_ALLCAPS, 0, arial, "Arial", 13,
FontStyle
.Regular };
4732
public unsafe void RichTextBox_SelectionFont_CustomGetCharFormat_ReturnsExpected(uint mask, uint effects, int yHeight, char[] faceName, string expectedFontName, float expectedSize,
FontStyle
expectedStyle)
4814
yield return new object[] { "Arial", 8.25f, false,
FontStyle
.Regular, 0, 0, 1 };
4815
yield return new object[] { "Arial", 8.25f, true,
FontStyle
.Bold |
FontStyle
.Italic |
FontStyle
.Regular |
FontStyle
.Strikeout |
FontStyle
.Underline, GraphicsUnit.Point, 10, 1 };
4820
public void RichTextBox_SelectionFont_Set_GetReturnsExpected(string fontName, float fontSize, bool hasStyle,
FontStyle
fontStyle, GraphicsUnit units, byte gdiCharSet, byte expectedGdiCharset)
4847
public void RichTextBox_SelectionFont_SetWithHandle_GetReturnsExpected(string fontName, float fontSize, bool hasStyle,
FontStyle
fontStyle, GraphicsUnit units, byte gdiCharSet, byte expectedGdiCharset)
4916
yield return new object[] { new Font("Arial", 8.25f,
FontStyle
.Bold), 165, CFE_EFFECTS.CFE_BOLD };
4917
yield return new object[] { new Font("Arial", 8.25f,
FontStyle
.Italic), 165, CFE_EFFECTS.CFE_ITALIC };
4918
yield return new object[] { new Font("Arial", 8.25f,
FontStyle
.Strikeout), 165, CFE_EFFECTS.CFE_STRIKEOUT };
4919
yield return new object[] { new Font("Arial", 8.25f,
FontStyle
.Underline), 165, CFE_EFFECTS.CFE_UNDERLINE };
4920
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)
173
accessor._hoverLinkFont = new Font("Arial", 10,
FontStyle
.Underline);
186
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)
160
SD.
FontStyle
style;
163
style = SD.
FontStyle
.Regular;
167
style = SD.
FontStyle
.Italic;
171
style |= SD.
FontStyle
.Bold;
189
SD.
FontStyle
style = CurrentFontStyle;
192
style |= SD.
FontStyle
.Bold;
337
private SD.
FontStyle
CurrentFontStyle
341
SD.
FontStyle
style;
345
style = SD.
FontStyle
.Regular;
349
style = SD.
FontStyle
.Italic;
354
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);