FontFamily FontFamily FontFamily Class

Represents a family of related fonts.

Syntax

Declaration

public class FontFamilypublic class FontFamilyPublic Class FontFamily
<FontFamily>fontFamilyName[,fallbackFontFamilyName]*</FontFamily>

Constructors summary

Initializes a new instance of the FontFamily class from the specified font family string.

Properties summary

Gets the font family name that is used to construct the FontFamily object.

Gets the default font family based on an app's language settings.

Constructors

  • FontFamily(String)
    FontFamily(String)
    FontFamily(String)
    FontFamily(String)

    Initializes a new instance of the FontFamily class from the specified font family string.

    public FontFamily(String familyName)public New(String familyName)Public Sub New(familyName As String)public FontFamily(String familyName)

    Parameters

    • familyName
      System.String
      System.String
      System.String

      The family name of the font to represent. This can include a hashed suffix.

Properties

  • Source
    Source
    Source
    Source

    Gets the font family name that is used to construct the FontFamily object.

    public string Source { get; }public string Source { get; }Public ReadOnly Property Source As stringpublic string Source { get; }

    Property Value

    • string
      string
      string

      The font family name of the FontFamily object.

  • XamlAutoFontFamily
    XamlAutoFontFamily
    XamlAutoFontFamily
    XamlAutoFontFamily

    Gets the default font family based on an app's language settings.

    public static FontFamily XamlAutoFontFamily { get; }public static FontFamily XamlAutoFontFamily { get; }Public Static ReadOnly Property XamlAutoFontFamily As FontFamilypublic static FontFamily XamlAutoFontFamily { get; }

    Property Value

    Remarks

    XamlAutoFontFamily is the default FontFamily property setting for all XAML controls. The FontFamily that this property gets at run time depends on the app language.

    LanguageDefault FontFamily
    JapaneseYu Gothic UI
    KoreanMalgun Gothic
    All othersSegoe UI

    Examples

    <TextBlock FontFamily="XamlAutoFontFamily"/>
    
    
    TextBlock textBlock1 = new TextBlock();
    textBlock1.FontFamily = FontFamily.XamlAutoFontFamily;
    

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ComposableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.Media.dll