37 instantiations of Font
PresentationUI (3)
MS\Internal\Documents\RMEnrollmentPage1.Designer.cs (1)
150
_instructionlabel.Font = new System.Drawing.
Font
("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
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.Windows.Forms (18)
System\Windows\Forms\ActiveX\AxHost.cs (2)
3721
:
new
(f.Name, f.SizeInPoints, f.Style, GraphicsUnit.Point, f.GdiCharSet, f.GdiVerticalFont);
3807
return new
Font
(
System\Windows\Forms\Controls\GroupBox\GroupBox.Modern.cs (2)
571
return new
Font
(
581
return new
Font
(
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)
545
using Font alwaysUnderlined = new
Font
(Font, Font.Style | FontStyle.Underline);
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (3)
227
hoverLinkFont = new
Font
(f, style);
242
hoverLinkFont = new
Font
(f, hoverStyle);
254
linkFont = new
Font
(f, linkStyle);
System\Windows\Forms\Controls\ListView\ListView.cs (2)
2617
_odCacheFont = new
Font
(_odCacheFont, FontStyle.Bold);
2804
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)
1333
public Font GetBoldFont() => _boldFont ??= new
Font
(Font, FontStyle.Bold);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
2231
return new
Font
(cf.FaceName.ToString(), fontSize, style, GraphicsUnit.Point, cf.bCharSet);
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (2)
144
result = new
Font
(result.FontFamily, MinSize, result.Style, GraphicsUnit.Point);
149
result = new
Font
(result.FontFamily, MaxSize, result.Style, GraphicsUnit.Point);
System\Windows\Forms\Rendering\ControlPaint.cs (1)
2122
=>
new
(
System.Windows.Forms.Design (11)
System\ComponentModel\Design\ByteViewer.cs (2)
37
private static readonly Font s_addressFont =
new
("Microsoft Sans Serif", 8.0f);
38
private static readonly Font s_hexDumpFont =
new
("Courier New", 8.0f);
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\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
305
replaceFont = new
Font
(fallBackFontName, base.Font.Size, base.Font.Style);
System\Drawing\Design\FontNameEditor.cs (1)
72
using Font font =
new
(fontFamily, fontSize, fontStyle, GraphicsUnit.Pixel);
System\Windows\Forms\Design\ControlDesigner.cs (1)
2273
using (Font errorFont =
new
(
System\Windows\Forms\Design\SplitterPanelDesigner.cs (1)
191
using Font drawFont =
new
("Arial", 8);
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)
864
using Font boldFont =
new
(_selectedItemName.Font, FontStyle.Bold);
System.Windows.Forms.Primitives (1)
System\Windows\Forms\FontExtensions.cs (1)
22
:
new
(
WindowsFormsIntegration (4)
System\Windows\Integration\WindowsFormsHostPropertyMap.cs (4)
140
adapter.Font = new SD.
Font
(familySource, adapter.Font.Size, adapter.Font.Style);
171
adapter.Font = new SD.
Font
(CurrentFontFamily, CurrentFontSize, style);
192
adapter.Font = new SD.
Font
(CurrentFontFamily, CurrentFontSize, style);
208
adapter.Font = new SD.
Font
(CurrentFontFamily, (float)pointSize, CurrentFontStyle);
398 references to Font
PresentationUI (1)
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
228
Font
columnHeaderFont = new System.Drawing.Font(Font, System.Drawing.FontStyle.Bold);
System.Drawing (1)
System.Drawing.cs (1)
56
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.
Font
))]
System.Windows.Forms (345)
System\Drawing\Design\UITypeEditor.cs (1)
55
[typeof(
Font
)] = $"System.Drawing.Design.FontEditor, {Assemblies.SystemDrawingDesign}",
System\Windows\Forms\ActiveX\AxHost.cs (10)
65
private static ConditionalWeakTable<
Font
, object>? s_fontTable;
339
public override
Font
Font
3602
private static FONTDESC GetFONTDESCFromFont(
Font
font)
3653
protected static object? GetIFontFromFont(
Font
? font)
3678
private protected static IFont* GetIFontPointerFromFont(
Font
? font)
3708
protected static
Font
? GetFontFromIFont(object? font)
3718
Font
f =
Font
.FromHfont(oleFont.hFont);
3733
protected static object? GetIFontDispFromFont(
Font
? font)
3761
protected static
Font
? GetFontFromIFontDisp(object? font)
System\Windows\Forms\ActiveX\Control.ActiveXFontMarshaler.cs (3)
32
Font
font = (
Font
)obj;
61
return hr.Failed ? DefaultFont :
Font
.FromHfont(nativeFont.Value->hFont);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (5)
44
private
Font
? ActiveXAmbientFont
200
internal
Font
? AmbientFont
216
property.Value =
Font
.FromHfont(font.Value->hFont);
226
return (
Font
?)property.Value;
1376
prop.Value =
Font
.FromHfont(pQaContainer->pFont->hFont);
System\Windows\Forms\AmbientProperties.cs (1)
28
public
Font
? Font { get; set; }
System\Windows\Forms\Application.cs (7)
27
private static
Font
? s_defaultFont;
31
private static
Font
? s_defaultFontScaled;
458
internal static
Font
DefaultFont => s_defaultFontScaled ?? s_defaultFont!;
1536
/// Sets the default <see cref="
Font
"/> for the process.
1553
public static void SetDefaultFont(
Font
font)
1582
Font
newSystemFont = SystemFonts.GetFontByName(s_defaultFont.SystemFontName)!;
1595
Font
? font = ScaleHelper.ScaleToSystemTextSize(s_defaultFont);
System\Windows\Forms\ComponentModel\COM2Interop\COM2FontConverter.cs (6)
17
private
Font
? _lastFont;
21
public override Type ManagedType => typeof(
Font
);
53
using
Font
font =
Font
.FromHfont(_lastHandle);
77
_lastFont = (
Font
)managedValue;
106
private static void ApplyFontSettings(
Font
source, IFont* target, out bool targetChanged)
System\Windows\Forms\Control.cs (27)
178
private static
Font
? s_defaultFont;
291
private
Font
? _scaledControlFont;
299
private Dictionary<int,
Font
>? _dpiFonts;
1835
public static
Font
DefaultFont
2080
public virtual
Font
Font
2088
Font
? previous = Properties.GetValueOrDefault<
Font
>(s_fontProperty);
2096
Font
currentFont = Font;
2137
internal
Font
GetScaledFont(
Font
font, int newDpi, int oldDpi)
2143
_dpiFonts ??= new Dictionary<int,
Font
>
2148
if (_dpiFonts.TryGetValue(newDpi, out
Font
? scaledFont))
2168
foreach (
Font
font in _dpiFonts.Values)
2195
if (TryGetExplicitlySetFont(out
Font
? font))
2214
if (Properties.TryGetValue(s_currentAmbientFontProperty, out
Font
? currentAmbient) && currentAmbient == ambientFont)
2242
if (TryGetExplicitlySetFont(out
Font
? font))
3186
internal
Font
? ScaledControlFont
3224
Font
? oldFont = null;
4462
Font
oldFont = Font;
5789
private
Font
GetCurrentFontAndDpi(out int fontDpi)
5799
if (TryGetExplicitlySetFont(out
Font
? font))
8099
Font
localFont = GetCurrentFontAndDpi(out int fontDpi);
8111
Font
fontForDpi = GetScaledFont(localFont, DeviceDpiInternal, fontDpi);
11579
private protected bool TryGetExplicitlySetFont([NotNullWhen(true)] out
Font
? font) =>
11587
private protected void SetScaledFont(
Font
scaledFont, bool raiseOnFontChangedEvent = true)
12372
Font
localFont = GetCurrentFontAndDpi(out int fontDpi);
13420
Font
font = SystemFonts.MessageBoxFont!;
System\Windows\Forms\Control.FontHandleWrapper.cs (2)
11
/// Wrapper for a <see cref="Drawing.
Font
"/>'s <see cref="HFONT"/>.
17
internal FontHandleWrapper(
Font
font) => _handle = (HFONT)font.ToHfont();
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
675
Font
font,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (1)
36
public
Font
Font { get; set; } = null!;
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (1)
297
Font
font,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (1)
157
Font
font,
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
135
Font
font,
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (11)
65
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
124
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
128
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
129
public static void DrawButton(Graphics g, Rectangle bounds, string? buttonText,
Font
? font, bool focused, PushButtonState state)
141
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
142
public static void DrawButton(Graphics g, Rectangle bounds, string? buttonText,
Font
? font, TextFormatFlags flags, bool focused, PushButtonState state)
170
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
197
/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
202
Font
? font,
224
Font
? font,
236
Font
? font,
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (9)
49
/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
83
/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
89
Font
? font,
101
/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
107
Font
? font,
117
Font
? font,
155
/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
161
Font
? font,
185
Font
? font,
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (10)
49
/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
87
/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
93
Font
? font,
102
/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
108
Font
? font,
121
Font
? font,
155
/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?,
Font
?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
161
Font
? font,
185
Font
? font,
208
Font
? font,
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (4)
62
public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText,
Font
? font, ComboBoxState state)
70
public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText,
Font
? font, Rectangle textBounds, ComboBoxState state)
78
public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText,
Font
? font, TextFormatFlags flags, ComboBoxState state)
90
public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText,
Font
? font, Rectangle textBounds, TextFormatFlags flags, ComboBoxState state)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
2628
public override
Font
Font
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (6)
2523
Font
font,
2537
Font
font,
2562
Font
font,
2608
Font
font,
2628
Font
font,
3959
internal static bool TextFitsInBounds(Graphics graphics, string text,
Font
font, Size maxBounds, TextFormatFlags flags)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (3)
145
public
Font
? Font
147
get => Properties.GetValueOrDefault<
Font
>(s_propFont);
150
Font
? previous = Properties.AddOrRemoveValue(s_propFont, value);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (4)
978
Font
? getLinkFont = null;
979
Font
? getHoverFont = null;
983
using
Font
linkFont = getLinkFont;
984
using
Font
hoverFont = getHoverFont;
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (1)
318
Font
font)
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (2)
95
private
Font
? _calendarFont;
205
public
Font
CalendarFont
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
22
private
Font
? _cachedFont;
System\Windows\Forms\Controls\GroupBox\GroupBox.Modern.cs (5)
20
private
Font
? _modernCaptionFont;
21
private
Font
? _modernCaptionSourceFont;
30
private
Font
ModernCaptionFont
151
Font
font = ModernCaptionFont;
558
private
Font
CreateModernCaptionFont(float textScale)
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (8)
77
public static void DrawGroupBox(Graphics g, Rectangle bounds, string? groupBoxText,
Font
? font, GroupBoxState state)
87
Font
? font,
99
Font
? font,
108
Font
? font,
129
Font
? font,
139
Font
? font,
170
Font
? font,
276
Font
? font,
System\Windows\Forms\Controls\Labels\LinkLabel.cs (6)
34
private
Font
? _linkFont;
35
private
Font
? _hoverLinkFont;
545
using
Font
alwaysUnderlined = new Font(Font, Font.Style | FontStyle.Underline);
1237
Font
linkFont,
1238
Font
hoverLinkFont,
1269
Font
font = (linkState & LinkState.Hover) == LinkState.Hover ? hoverLinkFont : linkFont;
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (4)
178
Font
baseFont,
180
[AllowNull] ref
Font
linkFont,
181
[AllowNull] ref
Font
hoverLinkFont)
212
Font
f = baseFont;
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
588
Font
font = Font;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (1)
428
public override
Font
Font
System\Windows\Forms\Controls\ListView\DrawListViewColumnHeaderEventArgs.cs (2)
26
Font
? font)
76
public
Font
? Font { get; }
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (1)
138
Font
font = ItemIndex == -1 ? Item!.Font : SubItem!.Font;
System\Windows\Forms\Controls\ListView\ListView.cs (5)
108
private
Font
_odCacheFont;
2793
Font
? subItemFont = null;
6077
Font
font = GetListHeaderFont();
6391
private
Font
GetListHeaderFont()
6395
return
Font
.FromHfont(hFont);
System\Windows\Forms\Controls\ListView\ListViewItem.cs (7)
106
public ListViewItem(string[]? items, int imageIndex, Color foreColor, Color backColor,
Font
? font)
162
public ListViewItem(string[]? items, int imageIndex, Color foreColor, Color backColor,
Font
? font, ListViewGroup? group)
197
public ListViewItem(string[]? items, string? imageKey, Color foreColor, Color backColor,
Font
? font)
235
public ListViewItem(string[]? items, string? imageKey, Color foreColor, Color backColor,
Font
? font, ListViewGroup? group)
388
public
Font
Font
1222
Font = (
Font
)info.GetValue(nameof(Font), typeof(
Font
))!;
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.cs (2)
46
public ListViewSubItem(ListViewItem? owner, string? text, Color foreColor, Color backColor,
Font
font)
141
public
Font
Font
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.SubItemStyle.cs (1)
16
public
Font
? font; // Do NOT rename (binary serialization).
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (2)
125
public ListViewSubItem Add(string? text, Color foreColor, Color backColor,
Font
font)
167
public void AddRange(string[] items, Color foreColor, Color backColor,
Font
font)
System\Windows\Forms\Controls\ListView\ListViewItemConverter.cs (2)
90
typeof(
Font
)
110
typeof(
Font
)
System\Windows\Forms\Controls\ListView\ListViewSubItemConverter.cs (1)
41
typeof(
Font
)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
278
public override
Font
Font
System\Windows\Forms\Controls\ProgressBar\ProgressBar.cs (1)
200
public override
Font
Font
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.MeasureTextHelper.cs (4)
15
public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text,
Font
font)
18
public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text,
Font
font, int width)
21
public static SizeF MeasureTextSimple(PropertyGrid owner, Graphics g, string? text,
Font
font, SizeF size)
31
public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text,
Font
font, SizeF size)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CategoryGridEntry.cs (1)
117
Font
font = GetFont(boldFont: bold);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.CacheItems.cs (2)
13
public
Font
? LastLabelFont;
17
public
Font
? LastValueFont;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (4)
1178
protected int GetLabelTextWidth(string? text, Graphics graphics,
Font
font)
1201
public int GetValueTextWidth(string text, Graphics graphics,
Font
font)
1474
protected
Font
GetFont(bool boldFont)
1526
Font
font = GetFont(boldFont: bold);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (3)
56
private
Font
? _boldFont;
1331
public
Font
GetBaseFont() => Font;
1333
public
Font
GetBoldFont() => _boldFont ??= new Font(Font, FontStyle.Bold);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (5)
418
public override
Font
Font
438
Font
? font = GetCharFormatFont(selectionOnly: false);
974
public
Font
? SelectionFont
2188
private
Font
? GetCharFormatFont(bool selectionOnly)
2817
private unsafe void SetCharFormatFont(bool selectionOnly,
Font
value)
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
156
public override
Font
Font
System\Windows\Forms\Controls\TabControl\TabRenderer.cs (5)
54
public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText,
Font
? font, TabItemState state)
62
public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText,
Font
? font, bool focused, TabItemState state)
72
public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText,
Font
? font, TextFormatFlags flags, bool focused, TabItemState state)
111
public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText,
Font
? font, Image image, Rectangle imageRectangle, bool focused, TabItemState state)
121
public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText,
Font
? font, TextFormatFlags flags, Image image, Rectangle imageRectangle, bool focused, TabItemState state)
System\Windows\Forms\Controls\TextBox\TextBoxRenderer.cs (4)
51
public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText,
Font
? font, TextBoxState state)
59
public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText,
Font
? font, Rectangle textBounds, TextBoxState state)
67
public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText,
Font
? font, TextFormatFlags flags, TextBoxState state)
78
public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText,
Font
? font, Rectangle textBounds, TextFormatFlags flags, TextBoxState state)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (3)
67
private
Font
? _defaultFont;
521
public override
Font
Font
3752
if (item.TryGetExplicitlySetFont(out
Font
? local))
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
189
public override
Font
Font
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (2)
355
public override
Font
Font
610
Font
originalFont = Font;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
789
Font
currentFont = childItem.Font;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (6)
145
internal
Font
_defaultFont = ToolStripManager.DefaultFont;
909
public virtual
Font
Font
913
if (TryGetExplicitlySetFont(out
Font
? font))
2325
private
Font
? GetOwnerFont() => Owner?.Font;
3191
Font
f = Font;
3632
internal bool TryGetExplicitlySetFont([NotNullWhen(true)] out
Font
? local) => Properties.TryGetValue(s_fontProperty, out local);
System\Windows\Forms\Controls\ToolStrips\ToolStripItemTextRenderEventArgs.cs (3)
25
Font
? textFont,
48
Font
? textFont,
86
public
Font
? TextFont { get; set; }
System\Windows\Forms\Controls\ToolStrips\ToolStripLabel.cs (3)
23
private
Font
? _hoverLinkFont;
24
private
Font
? _linkFont;
352
Font
font = Font;
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (6)
23
private static
Font
? s_defaultFont;
24
private static readonly ConcurrentDictionary<int,
Font
> s_defaultFontCache = new();
50
internal static
Font
DefaultFont
59
Font
? sysFont;
66
if (!s_defaultFontCache.TryGetValue(dpi, out
Font
? retFont))
90
Font
? retFont = s_defaultFont;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
922
Font
? textFont = e.TextFont;
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
105
public override
Font
Font
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.ToolStripTextBoxControl.cs (1)
95
public override
Font
Font
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (1)
216
public override
Font
Font
System\Windows\Forms\Controls\TreeView\TreeNode.cs (2)
729
public
Font
? NodeFont
742
Font
? oldfont = NodeFont;
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
2848
Font
font = node.NodeFont ?? node.TreeView.Font;
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGrid.cs (2)
104
public
Font
CaptionFont
264
public
Font
HeaderFont
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGridTableStyle.cs (1)
140
public
Font
HeaderFont
System\Windows\Forms\Controls\Unsupported\StatusBar\StatusBar.cs (1)
71
public override Drawing.
Font
Font
System\Windows\Forms\Controls\Unsupported\StatusBar\StatusBarDrawItemEventArgs.cs (2)
25
Font
font,
38
Font
font,
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
1253
public override
Font
Font
System\Windows\Forms\Design\ComponentEditorForm.cs (2)
169
Font
? uiFont = DefaultFont;
172
uiFont = (
Font
?)uiService.Styles["DialogFont"];
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (5)
26
private
Font
? _font;
135
public
Font
Font
139
Font
? result = _font ?? Control.DefaultFont;
466
using
Font
fontInWorldUnits =
Font
.FromLogFont(in lf, dc);
System\Windows\Forms\Form.cs (2)
3779
public static SizeF GetAutoScaleSize(
Font
font)
4593
Font
fontForDpi = GetScaledFont(Font, deviceDpiNew, deviceDpiOld);
System\Windows\Forms\Help\Help.cs (1)
88
Font
font = SystemFonts.StatusFont ?? SystemFonts.DefaultFont;
System\Windows\Forms\Layout\Containers\ContainerControl.cs (1)
1393
Font
fontForDpi = GetScaledFont(Font, deviceDpiNew, deviceDpiOld);
System\Windows\Forms\Layout\LayoutUtils.cs (1)
43
public static Size OldGetLargestStringSizeInCollection(
Font
? font, ICollection? objects)
System\Windows\Forms\Layout\LayoutUtils.MeasureTextCache.cs (3)
29
public Size GetTextSize(string? text,
Font
? font, Size proposedConstraints, TextFormatFlags flags)
99
public bool TextRequiresWordBreak(string? text,
Font
? font, Size size, TextFormatFlags flags)
108
private Size GetUnconstrainedSize(string? text,
Font
? font, TextFormatFlags flags)
System\Windows\Forms\OwnerDrawPropertyBag.cs (3)
15
private
Font
? _font;
23
if (entry.Name == nameof(Font) && entry.Value is
Font
font)
42
public
Font
? Font
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
637
public override
Font
Font
System\Windows\Forms\Rendering\Button\PopupButtonRenderContext.cs (1)
33
public required
Font
Font { get; init; }
System\Windows\Forms\Rendering\ControlPaint.cs (5)
2007
Font
font,
2039
Font
font,
2056
Font
font,
2121
internal static
Font
FontInPoints(
Font
font)
System\Windows\Forms\Rendering\DrawItemEventArgs.cs (5)
31
public DrawItemEventArgs(Graphics graphics,
Font
? font, Rectangle rect, int index, DrawItemState state)
41
Font
? font,
58
Font
? font,
67
Font
? font,
90
public
Font
? Font { get; }
System\Windows\Forms\Rendering\FontCache.cs (7)
9
/// Thread safe cache of <see cref="HFONT"/> objects created from <see cref="
Font
"/> objects.
22
internal sealed partial class FontCache : RefCountedCache<HFONT, FontCache.Data, (
Font
Font, FONT_QUALITY Quality)>
36
public CacheEntry GetEntry(
Font
font, FONT_QUALITY quality = FONT_QUALITY.DEFAULT_QUALITY) => GetEntry((font, quality));
38
public override CacheEntry GetEntry((
Font
Font, FONT_QUALITY Quality) key)
46
protected override CacheEntry CreateEntry((
Font
Font, FONT_QUALITY Quality) key, bool cached)
49
protected override bool IsMatch((
Font
Font, FONT_QUALITY Quality) key, CacheEntry entry)
50
=> entry.Data.Font.TryGetTarget(out
Font
? currentFont)
System\Windows\Forms\Rendering\FontCache.Data.cs (4)
18
public WeakReference<
Font
> Font { get; }
24
public Data(
Font
font, FONT_QUALITY quality)
26
Font = new WeakReference<
Font
>(font);
66
private static unsafe HFONT FromFont(
Font
font, FONT_QUALITY quality = FONT_QUALITY.DEFAULT_QUALITY)
System\Windows\Forms\Rendering\GdiCache.cs (1)
91
public static FontCache.Scope GetHFONTScope(
Font
? font, FONT_QUALITY quality = FONT_QUALITY.DEFAULT_QUALITY)
System\Windows\Forms\Rendering\TextRenderer.cs (55)
25
public static void DrawText(IDeviceContext dc, string? text,
Font
? font, Point pt, Color foreColor)
33
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
37
public static void DrawText(IDeviceContext dc, ReadOnlySpan<char> text,
Font
font, Point pt, Color foreColor)
43
Font
? font,
54
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
62
Font
font,
71
Font
? font,
83
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
94
Font
? font,
110
Font
? font,
123
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
135
Font
? font,
149
public static void DrawText(IDeviceContext dc, string? text,
Font
? font, Rectangle bounds, Color foreColor)
157
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
164
Font
? font,
172
Font
? font,
184
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
192
Font
? font,
201
Font
? font,
213
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
224
Font
? font,
240
Font
? font,
253
/// <param name="font">The <see cref="
Font
"/> to apply to the drawn text.</param>
265
Font
? font,
282
Font
? font,
292
Font
? font,
315
Font
? font,
324
Font
? font,
348
Font
? font,
358
Font
? font,
381
public static Size MeasureText(string? text,
Font
? font)
388
/// <param name="font">The <see cref="
Font
"/> to apply to the measured text.</param>
392
/// <see cref="DrawText(IDeviceContext, ReadOnlySpan{char},
Font
?, Rectangle, Color, TextFormatFlags)"/>
396
/// versions of <see cref="DrawText(IDeviceContext, ReadOnlySpan{char},
Font
, Point, Color)"/> and
397
/// <see cref="MeasureText(IDeviceContext, ReadOnlySpan{char},
Font
?)"/> that take a Size and
399
/// <see cref="MeasureText(IDeviceContext, string?,
Font
?, Size, TextFormatFlags)"/>.
401
public static Size MeasureText(ReadOnlySpan<char> text,
Font
? font)
404
public static Size MeasureText(string? text,
Font
? font, Size proposedSize)
412
/// <param name="font">The <see cref="
Font
"/> to apply to the measured text.</param>
418
public static Size MeasureText(ReadOnlySpan<char> text,
Font
? font, Size proposedSize)
421
public static Size MeasureText(string? text,
Font
? font, Size proposedSize, TextFormatFlags flags)
429
/// <param name="font">The <see cref="
Font
"/> to apply to the measured text.</param>
439
public static Size MeasureText(ReadOnlySpan<char> text,
Font
? font, Size proposedSize, TextFormatFlags flags)
442
public static Size MeasureText(IDeviceContext dc, string? text,
Font
? font)
456
public static Size MeasureText(IDeviceContext dc, ReadOnlySpan<char> text,
Font
? font)
459
public static Size MeasureText(IDeviceContext dc, string? text,
Font
? font, Size proposedSize)
468
/// <param name="font">The <see cref="
Font
"/> to apply to the measured text.</param>
475
public static Size MeasureText(IDeviceContext dc, ReadOnlySpan<char> text,
Font
? font, Size proposedSize)
481
Font
? font,
492
/// <param name="font">The <see cref="
Font
"/> to apply to the measured text.</param>
506
Font
? font,
513
Font
? font,
529
Font
? font,
650
/// <inheritdoc cref="GdiCache.GetHFONTScope(
Font
?, FONT_QUALITY)"/>
658
private static FontCache.Scope GetFontOrHdcHFONT(
Font
? font, FONT_QUALITY quality, HDC hdc)
System\Windows\Forms\Scrolling\ScrollBar.cs (1)
163
public override
Font
Font
System\Windows\Forms\SystemInformation.cs (4)
134
public static
Font
MenuFont => GetMenuFontHelper(0, useDpi: false);
139
public static
Font
GetMenuFontForDpi(int dpi)
142
private static unsafe
Font
GetMenuFontHelper(uint dpi, bool useDpi)
156
return
Font
.FromLogFont(Unsafe.AsRef<LOGFONT>((LOGFONT*)&data.lfMenuFont));
System\Windows\Forms\ToolTip\DrawToolTipEventArgs.cs (2)
27
Font
? font)
67
public
Font
? Font { get; }
System\Windows\Forms\ToolTip\ToolTip.cs (2)
2326
Font
font;
2329
font =
Font
.FromHfont(PInvokeCore.SendMessage(this, PInvokeCore.WM_GETFONT));
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (2)
530
public
Font
? GetFont(IDeviceContext dc, FontProperty prop)
547
return
Font
.FromLogFont(logfont);
System.Windows.Forms.Design (37)
System\ComponentModel\Design\ByteViewer.cs (5)
37
private static readonly
Font
s_addressFont = new("Microsoft Sans Serif", 8.0f);
38
private static readonly
Font
s_hexDumpFont = new("Courier New", 8.0f);
124
Font
font = s_addressFont;
193
Font
font = s_hexDumpFont;
205
Font
font = s_hexDumpFont;
System\ComponentModel\Design\DesignerActionPanel.cs (1)
65
Font = (
Font
)uiService.Styles["DialogFont"]!;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (1)
444
public DropDownHolder(Control hostedControl, Control parentControl, Color borderColor,
Font
font, EditorPropertyLine parent)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (1)
18
public FlyoutDialog(Control hostedControl, Control parentControl, Color borderColor,
Font
font)
System\ComponentModel\Design\DesignerActionPanel.HeaderLine.cs (1)
16
protected override
Font
GetFont() => new(ActionPanel.Font, FontStyle.Bold);
System\ComponentModel\Design\DesignerActionPanel.TextLine.cs (1)
58
protected virtual
Font
GetFont()
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (3)
22
private readonly Dictionary<int,
Font
?> _fallbackFonts;
250
public override
Font
Font
295
if (!_fallbackFonts.TryGetValue(planeNumber, out
Font
? replaceFont))
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
259
Font
font = Font;
System\Drawing\Design\CursorEditor.CursorUI.cs (1)
71
Font
font = e.Font!;
System\Drawing\Design\FontEditor.cs (1)
33
if (value is
Font
fontValue)
System\Drawing\Design\FontNameEditor.cs (1)
72
using
Font
font = new(fontFamily, fontSize, fontStyle, GraphicsUnit.Pixel);
System\Windows\Forms\Design\BaseContextMenuStrip.cs (2)
125
_selectionMenuItem.DropDown.Font = (
Font
)uis.Styles["DialogFont"]!;
239
Font = (
Font
)uis.Styles["DialogFont"]!;
System\Windows\Forms\Design\ComponentTray.cs (3)
154
Font = (
Font
)uiService.Styles["DialogFont"];
1410
Font = (
Font
)uiService.Styles["DialogFont"];
1943
public override
Font
Font
System\Windows\Forms\Design\ControlDesigner.cs (1)
2273
using (
Font
errorFont = new(
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (2)
55
Font
uiFont = DefaultFont;
58
uiFont = (
Font
)uiService.Styles["DialogFont"]!;
System\Windows\Forms\Design\DataGridViewCellStyleEditor.cs (1)
30
_builderDialog.Font = (
Font
)uiService.Styles["DialogFont"]!;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
794
if (font is not
Font
uiFont)
System\Windows\Forms\Design\SplitterPanelDesigner.cs (1)
191
using
Font
drawFont = new("Arial", 8);
System\Windows\Forms\Design\TabOrder.cs (3)
26
private readonly
Font
_tabFont;
48
_tabFont = uisvc is not null && uisvc.Styles["DialogFont"] is
Font
dialogFont ? dialogFont : DefaultFont;
191
Font
font = _tabFont;
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (2)
636
Font
measureFont = Font;
864
using
Font
boldFont = new(_selectedItemName.Font, FontStyle.Bold);
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
393
contextMenu.Font = (
Font
)uis.Styles["DialogFont"];
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (3)
82
item.DropDown.Font = (
Font
)uis.Styles["DialogFont"];
172
Font
font = (
Font
)uis.Styles["DialogFont"];
System.Windows.Forms.Primitives (9)
System\Drawing\FontExtensions.cs (2)
11
public static LOGFONTW ToLogicalFont(this
Font
font)
17
public static LOGFONTW ToLogicalFont(this
Font
font, Graphics graphics)
System\Windows\Forms\FontExtensions.cs (3)
16
/// A new <see cref="
Font
"/> object with the new size, or <see langword="null"/> if <paramref name="templateFont"/>
20
public static
Font
? WithSize(this
Font
? templateFont, float emSize) => templateFont is null
System\Windows\Forms\Internals\ScaleHelper.cs (3)
226
/// Creates a scaled version of the given non system <see cref="
Font
"/> to the Windows Accessibility Text Size setting (also
229
internal static
Font
? ScaleToSystemTextSize(
Font
? font)
System\Windows\Forms\SystemDrawingExtensions.cs (1)
14
internal static HFONT ToHFONT(this
Font
font) => (HFONT)font.ToHfont();
WindowsFormsIntegration (5)
System\Windows\Integration\Convert.cs (3)
208
internal static double SystemDrawingFontToSystemWindowsFontSize(SD.
Font
font)
224
internal static FontWeight ToSystemWindowsFontWeight(SD.
Font
sdFont)
229
internal static FontStyle ToSystemWindowsFontStyle(SD.
Font
sdFont)
System\Windows\Integration\ElementHostPropertyMap.cs (2)
126
SD.
Font
wfFont = value as SD.
Font
;