Share via


FontExtensions.ToSKTypeface(IFont) Method

Definition

Converts a .NET MAUI Graphics font to a SkiaSharp typeface.

public:
[System::Runtime::CompilerServices::Extension]
 static SkiaSharp::SKTypeface ^ ToSKTypeface(Microsoft::Maui::Graphics::IFont ^ font);
public static SkiaSharp.SKTypeface ToSKTypeface(this Microsoft.Maui.Graphics.IFont font);
static member ToSKTypeface : Microsoft.Maui.Graphics.IFont -> SkiaSharp.SKTypeface
<Extension()>
Public Function ToSKTypeface (font As IFont) As SKTypeface

Parameters

font
IFont

The font to convert.

Returns

A SkiaSharp typeface that corresponds to the specified font.

Remarks

If the font name is not found as a family name, this method will attempt to load it as a file. If the font is null or has an empty name, the default typeface will be returned.

Applies to