LanguageFontGroup LanguageFontGroup LanguageFontGroup LanguageFontGroup Class

Supplies a set of font recommendations for a given language or script for various usage cases.

Syntax

Declaration

public sealed class LanguageFontGrouppublic sealed class LanguageFontGroupPublic NotInheritable Class LanguageFontGrouppublic sealed class LanguageFontGroup

Remarks

A LanguageFontGroup provides a set of font recommendations for a particular language or script. The different fonts recommended by a given LanguageFontGroup, exposed as separate LanguageFontGroup properties, correspond to different usage cases.

Each LanguageFontGroup property returns a LanguageFont object, which provides the details for that particular font recommendation. Those details include a font family as well as font weight, style and stretch attributes.

The weight/style/stretch attributes are significant for some usage cases but not others. For instance, the font recommendations for the various UI usage categories may use fonts from the same font family but differ in weight (for example, Segoe UI Semilight for UITextFont, but Segoe UI Regular for UICaptionFont ). But for some usage cases, the weight/style/stretch attributes might always indicate a "regular" font (regular weight, normal style, normal stretch). In those cases, apps might want to apply other weight/style/stretch formatting as may be appropriate for the app scenario. See the remarks for each LanguageFontGroup property for additional information.

For some languages and scripts, the LanguageFontGroup may not provide a font recommendation for every usage case. For instance, fixed-width fonts are not provided in Windows for every script. See the remarks for each LanguageFontGroup property for additional information.

Note

If your app passes language tags used in this class to any National Language Support functions, it must first convert the tags by calling ResolveLocaleName.

Beginning in : The LanguageFontGroup class returns font group data to match the target operating system for which an app was developed. Therefore, if you update your Windows 8 app to Windows 8.1, the fonts used in your app may change, and you may need to make adjustments to your UI layout.

Examples

// Get the recommended Japanese fonts for traditional documents and modern documents.
var fonts = new Windows.Globalization.Fonts.LanguageFontGroup('ja-JP');
var traditionalDocumentFont = fonts.traditionalDocumentFont;
var modernDocumentFont = fonts.modernDocumentFont;

// Obtain two properties of the traditional document font.
var traditionalDocumentFontFontFamily = traditionalDocumentFont.fontFamily;   // "MS Mincho"
var traditionalDocumentFontScaleFactor = traditionalDocumentFont.scaleFactor; // 100

// Obtain two properties of the modern document font.
var modernDocumentFontFontFamily = modernDocumentFont.fontFamily;             // "Meiryo"
var modernDocumentFontScaleFactor = modernDocumentFont.scaleFactor;           // 90
// Get the recommended Japanese fonts for traditional documents and modern documents.
var fonts = new Windows.Globalization.Fonts.LanguageFontGroup("ja-JP");
var traditionalDocumentFont = fonts.TraditionalDocumentFont;
var modernDocumentFont = fonts.ModernDocumentFont;

// Obtain two properties of the traditional document font.
var traditionalDocumentFontFontFamily = traditionalDocumentFont.FontFamily;   // "MS Mincho"
var traditionalDocumentFontScaleFactor = traditionalDocumentFont.ScaleFactor; // 100

// Obtain two properties of the modern document font.
var modernDocumentFontFontFamily = modernDocumentFont.FontFamily;             // "Meiryo"
var modernDocumentFontScaleFactor = modernDocumentFont.ScaleFactor;           // 90

Constructors summary

Creates a LanguageFontGroup object for a given language or script.

Properties summary

Gets a font that is recommended as an additional option for use in documents beyond the recommendations provided by DocumentHeadingFont, ModernDocumentFont and TraditionalDocumentFont.

Gets a font that is recommended as an additional option for use in documents beyond the recommendations provided by DocumentHeadingFont, ModernDocumentFont and TraditionalDocumentFont.

Gets a font that is recommended for use in document headings.

Gets a font that is recommended for displaying fixed-width characters.

Gets a font that is recommended for typical document body text following modern style conventions.

Gets a font that is recommended for typical document body text following traditional style conventions.

Gets a font that is recommended for special UI elements, such as captions, that are displayed at sizes smaller than typical UI body text.

Gets a font that is recommended for special UI elements, such as headings, that are displayed at sizes somewhat larger than typical UI body text.

Gets a font that is recommended for special UI elements, such as headings in notifications or other app messages, that are displayed at UI body text size or only slightly larger yet need to be differentiated from UI body text.

Gets a font that is recommended for typical UI body text.

Gets a font that is recommended for special UI elements set at sizes much larger than typical UI body text.

Constructors

  • LanguageFontGroup(String)
    LanguageFontGroup(String)
    LanguageFontGroup(String)
    LanguageFontGroup(String)

    Creates a LanguageFontGroup object for a given language or script.

    public LanguageFontGroup(String languageTag)public New(String languageTag)Public Sub New(languageTag As String)public LanguageFontGroup(String languageTag)

    Parameters

    • languageTag
      System.String
      System.String
      System.String
      System.String

      A BCP-47 language tag, or an ISO 15924 script identifier.

    Remarks

    The languageTag parameter can be any valid BCP-47 language tag, such as "en", "de-CH", or "zh-Hans". The only limitations are that the language tag must include an explicit script subtag or be for a language for which the script is implicitly known. (For instance, "en" is assumed to imply Latin script.) Moreover, the script must be one that Windows supports.

    The languageTag parameter can also be a valid ISO 15924 script identifier, such as "Latn", "Cyrl", or "Deva". The only limitation is that the script must be one that Windows supports.

    Note

    If your app passes language tags used in this class to any National Language Support functions, it must first convert the tags by calling ResolveLocaleName.

Properties

  • DocumentAlternate1Font
    DocumentAlternate1Font
    DocumentAlternate1Font
    DocumentAlternate1Font

    Gets a font that is recommended as an additional option for use in documents beyond the recommendations provided by DocumentHeadingFont, ModernDocumentFont and TraditionalDocumentFont.

    public LanguageFont DocumentAlternate1Font { get; }public LanguageFont DocumentAlternate1Font { get; }Public ReadOnly Property DocumentAlternate1Font As LanguageFontpublic LanguageFont DocumentAlternate1Font { get; }

    Property Value

    Remarks

    The DocumentAlternate1Font property provides a font recommendation as an additional option for use in documents beyond the recommendations provided by DocumentHeadingFont, ModernDocumentFont and TraditionalDocumentFont. These fonts could be used in body text or other text elements. The app scenario for which this is most likely to be useful is in populating a font-picker list in an authoring tool with a set of fonts designed for a particular language or script.

    The font recommended for this usage case will always be a "regular" font (regular weight, normal style, normal stretch). Apps might want to apply other weight/style/stretch formatting, as may be appropriate for the app scenario.

    A DocumentAlternate1Font recommendation is available for certain languages and scripts only.

  • DocumentAlternate2Font
    DocumentAlternate2Font
    DocumentAlternate2Font
    DocumentAlternate2Font

    Gets a font that is recommended as an additional option for use in documents beyond the recommendations provided by DocumentHeadingFont, ModernDocumentFont and TraditionalDocumentFont.

    public LanguageFont DocumentAlternate2Font { get; }public LanguageFont DocumentAlternate2Font { get; }Public ReadOnly Property DocumentAlternate2Font As LanguageFontpublic LanguageFont DocumentAlternate2Font { get; }

    Property Value

    Remarks

    The DocumentAlternate2Font property provides a font recommendation as an additional option for use in documents beyond the recommendations provided by DocumentHeadingFont, ModernDocumentFont and TraditionalDocumentFont. These fonts could be used in body text or other text elements. The app scenario for which this is most likely to be useful is in populating a font-picker list in an authoring tool with a set of fonts designed for a particular language or script.

    The font recommended for this usage case will always be a "regular" font (regular weight, normal style, normal stretch). Apps might want to apply other weight/style/stretch formatting, as may be appropriate for the app scenario.

    A DocumentAlternate2Font recommendation is available for certain languages and scripts only.

  • DocumentHeadingFont
    DocumentHeadingFont
    DocumentHeadingFont
    DocumentHeadingFont

    Gets a font that is recommended for use in document headings.

    public LanguageFont DocumentHeadingFont { get; }public LanguageFont DocumentHeadingFont { get; }Public ReadOnly Property DocumentHeadingFont As LanguageFontpublic LanguageFont DocumentHeadingFont { get; }

    Property Value

    Remarks

    The DocumentHeadingFont property provides a font recommendation for document text elements such as headings. These fonts could also be used in body text, but use for long runs of body text is not generally recommended. The recommended font may be a display face that is significantly different from the ModernDocumentFont and TraditionalDocumentFont recommendations.

    The font recommended for this usage case will always be a "regular" font (regular weight, normal style, normal stretch). Apps might want to apply other weight/style/stretch formatting, as may be appropriate for the app scenario.

    A DocumentHeadingFont recommendation is available for every supported language or script.

  • FixedWidthTextFont
    FixedWidthTextFont
    FixedWidthTextFont
    FixedWidthTextFont

    Gets a font that is recommended for displaying fixed-width characters.

    public LanguageFont FixedWidthTextFont { get; }public LanguageFont FixedWidthTextFont { get; }Public ReadOnly Property FixedWidthTextFont As LanguageFontpublic LanguageFont FixedWidthTextFont { get; }

    Property Value

    Remarks

    The FixedWidthTextFont property provides a font recommendation for displaying fixed-width characters.

    The font recommended for this usage case will always be a "regular" font (regular weight, normal style, normal stretch). Apps might want to apply other weight/style/stretch formatting, as may be appropriate for the app scenario.

    A FixedWidthTextFont recommendation is available for certain languages and scripts only.

  • ModernDocumentFont
    ModernDocumentFont
    ModernDocumentFont
    ModernDocumentFont

    Gets a font that is recommended for typical document body text following modern style conventions.

    public LanguageFont ModernDocumentFont { get; }public LanguageFont ModernDocumentFont { get; }Public ReadOnly Property ModernDocumentFont As LanguageFontpublic LanguageFont ModernDocumentFont { get; }

    Property Value

    Remarks

    The ModernDocumentFont property provides a font recommendation for typical document body text following modern style conventions. These fonts can also be used in headings or other document elements.

    The font recommended for this usage case will always be a "regular" font (regular weight, normal style, normal stretch). Apps might want to apply other weight/style/stretch formatting, as may be appropriate for the app scenario.

    A ModernDocumentFont recommendation is available for every supported language or script.

  • TraditionalDocumentFont
    TraditionalDocumentFont
    TraditionalDocumentFont
    TraditionalDocumentFont

    Gets a font that is recommended for typical document body text following traditional style conventions.

    public LanguageFont TraditionalDocumentFont { get; }public LanguageFont TraditionalDocumentFont { get; }Public ReadOnly Property TraditionalDocumentFont As LanguageFontpublic LanguageFont TraditionalDocumentFont { get; }

    Property Value

    Remarks

    The TraditionalDocumentFont property provides a font recommendation for typical document body text following traditional styling conventions. These fonts can also be used in headings or other document elements.

    The font recommended for this usage case will always be a "regular" font (regular weight, normal style, normal stretch). Apps might want to apply other weight/style/stretch formatting, as may be appropriate for the app scenario.

    A TraditionalDocumentFont recommendation is available for every supported language or script.

  • UICaptionFont
    UICaptionFont
    UICaptionFont
    UICaptionFont

    Gets a font that is recommended for special UI elements, such as captions, that are displayed at sizes smaller than typical UI body text.

    public LanguageFont UICaptionFont { get; }public LanguageFont UICaptionFont { get; }Public ReadOnly Property UICaptionFont As LanguageFontpublic LanguageFont UICaptionFont { get; }

    Property Value

    Remarks

    The UICaptionFont property provides a font recommendation for special UI elements, such as captions, that are displayed at sizes smaller than typical UI body text.

    The font recommended for this usage case may be differentiated from other UI usage cases in font weight, style or stretch values. Those attributes are significant aspects of the font recommendation being provided.

    A UICaptionFont recommendation is available for every supported language or script.

  • UIHeadingFont
    UIHeadingFont
    UIHeadingFont
    UIHeadingFont

    Gets a font that is recommended for special UI elements, such as headings, that are displayed at sizes somewhat larger than typical UI body text.

    public LanguageFont UIHeadingFont { get; }public LanguageFont UIHeadingFont { get; }Public ReadOnly Property UIHeadingFont As LanguageFontpublic LanguageFont UIHeadingFont { get; }

    Property Value

    Remarks

    The UIHeadingFont property provides a font recommendation for special UI elements, such as headings, that are displayed at sizes somewhat larger than typical UI body text.

    The font recommended for this usage case may be differentiated from other UI usage cases in font weight, style or stretch values. Those attributes are significant aspects of the font recommendation being provided.

    A UIHeadingFont recommendation is available for every supported language or script.

  • UINotificationHeadingFont
    UINotificationHeadingFont
    UINotificationHeadingFont
    UINotificationHeadingFont

    Gets a font that is recommended for special UI elements, such as headings in notifications or other app messages, that are displayed at UI body text size or only slightly larger yet need to be differentiated from UI body text.

    public LanguageFont UINotificationHeadingFont { get; }public LanguageFont UINotificationHeadingFont { get; }Public ReadOnly Property UINotificationHeadingFont As LanguageFontpublic LanguageFont UINotificationHeadingFont { get; }

    Property Value

    Remarks

    The UINotificationHeadingFont property provides a font recommendation for special UI elements, such as headings in notifications or other app messages, that are displayed at UI body text size or only slightly larger yet need to be differentiated from UI body text.

    The font recommended for this usage case may be differentiated from other UI usage cases in font weight, style or stretch values. Those attributes are significant aspects of the font recommendation being provided.

    A UINotificationHeadingFont recommendation is available for every supported language or script.

  • UITextFont
    UITextFont
    UITextFont
    UITextFont

    Gets a font that is recommended for typical UI body text.

    public LanguageFont UITextFont { get; }public LanguageFont UITextFont { get; }Public ReadOnly Property UITextFont As LanguageFontpublic LanguageFont UITextFont { get; }

    Property Value

    Remarks

    The UITextFont property provides a font recommendation for typical UI body text.

    The font recommended for this usage case may be differentiated from other UI usage cases in font weight, style or stretch values. Those attributes are significant aspects of the font recommendation being provided.

    A UITextFont recommendation is available for every supported language or script.

  • UITitleFont
    UITitleFont
    UITitleFont
    UITitleFont

    Gets a font that is recommended for special UI elements set at sizes much larger than typical UI body text.

    public LanguageFont UITitleFont { get; }public LanguageFont UITitleFont { get; }Public ReadOnly Property UITitleFont As LanguageFontpublic LanguageFont UITitleFont { get; }

    Property Value

    Remarks

    The UITitleFont property provides a font recommendation for special UI elements set at sizes much larger than typical UI body text—typically 36 pt. or above.

    The font recommended for this usage case may be differentiated from other UI usage cases in font weight, style or stretch values. Those attributes are significant aspects of the font recommendation being provided.

    A UITitleFont recommendation is available for every supported language or script.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Globalization.Fonts.dll