ScaleHelperGetFontOrDefault Method

Gets the specified font if it is not and is not equal to Control.DefaultFont; otherwise, returns the DefaultFont.

Definition

Namespace: KGySoft.WinForms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public static Font GetFontOrDefault(
	Font? font
)

Parameters

font  Font
The Font to check.

Return Value

Font
The specified font if it is not and is not equal to Control.DefaultFont; otherwise, the value of the DefaultFont property.

Remarks

This method can be especially useful on .NET Framework, where the Control.DefaultFont property may return a non-scaled font, which is not suitable for high DPI scenarios.

See Also