Share via


FontIconSource.FontFamily Property

Definition

Gets or sets the font used to display the icon glyph.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

FontFamily FontFamily();

void FontFamily(FontFamily value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="{ c_fontIconSourceDefaultFontFamily }")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="{ c_fontIconSourceDefaultFontFamily }")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="{ c_fontIconSourceDefaultFontFamily }")]
FontFamily FontFamily();

void FontFamily(FontFamily value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")]
FontFamily FontFamily();

void FontFamily(FontFamily value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
FontFamily FontFamily();

void FontFamily(FontFamily value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
FontFamily FontFamily();

void FontFamily(FontFamily value);
public FontFamily FontFamily { get; set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="{ c_fontIconSourceDefaultFontFamily }")]
public FontFamily FontFamily { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="{ c_fontIconSourceDefaultFontFamily }")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="{ c_fontIconSourceDefaultFontFamily }")] set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")]
public FontFamily FontFamily { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")] set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
public FontFamily FontFamily { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")] [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="winrt::FontFamily{ c_fontIconSourceDefaultFontFamily }")] [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
public FontFamily FontFamily { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] set; }
Public Property FontFamily As FontFamily
<FontIconSource FontFamily="fontFamilyValue"/>

Property Value

The font used to display the icon glyph. The default is the font family defined by the SymbolThemeFontFamily theme resource (see Remarks).

Attributes
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute

Examples

<FontIcon FontFamily="Segoe UI Emoji" Glyph="&#x25B6;"/>

Remarks

If you don't specify a FontFamily, or you specify a FontFamily that is not available on the system at runtime, the FontIcon falls back to the default font family defined by the SymbolThemeFontFamily theme resource.

By default, Windows uses the Segoe Fluent Icon font family. If your app is run on Windows 10, version 20H2 or earlier, the Segoe Fluent Icon font family is not available and the SymbolThemeFontFamily resource falls back to the Segoe MDL2 Asset font family instead.

To use glyphs from the default system font, don't set the FontFamily property, let it use its default value instead.

Applies to