UtilityEx.GetFont Method

Gets a Font starting from the commons WPF font values.
Public Shared Function GetFont( _ 
ByVal fontFamily As FontFamily, _ 
ByVal fontStyle As FontStyle, _ 
ByVal fontWeight As FontWeight, _ 
ByVal fontSize As Double, _ 
Optional ByVal scalingLevelRatio As Single = 1 _ 
) As Font
This language is not supported or no code example is available.
public static Font GetFont( 
FontFamily fontFamily
FontStyle fontStyle
FontWeight fontWeight
double fontSize
float scalingLevelRatio = 1 
)
This language is not supported or no code example is available.

Parameters

fontFamily
FontFamily

The FontFamily.

fontStyle
FontStyle

The FontStyle.

fontWeight
FontWeight

The FontWeight.

fontSize
double

The font size.

scalingLevelRatio
float

The scaling level ratio among displays with different dpi scale factors. Used to get the correct font size when per-monitor DPI is enabled.

Return Value

Font

The new Font.

.NET Framework

Supported in: 4.8

In this article

Definition