LanguageFontGroup LanguageFontGroup LanguageFontGroup LanguageFontGroup LanguageFontGroup Class

Definition

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

public : sealed class LanguageFontGroup : ILanguageFontGroup
struct winrt::Windows::Globalization::Fonts::LanguageFontGroup : ILanguageFontGroup
public sealed class LanguageFontGroup : ILanguageFontGroup
Public NotInheritable Class LanguageFontGroup Implements ILanguageFontGroup
var languageFontGroup = new languageFontGroup(languageTag);
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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

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.

Constructors

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

Creates a LanguageFontGroup object for a given language or script.

Properties

DocumentAlternate1Font 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.

DocumentAlternate2Font 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.

DocumentHeadingFont DocumentHeadingFont DocumentHeadingFont DocumentHeadingFont DocumentHeadingFont

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

FixedWidthTextFont FixedWidthTextFont FixedWidthTextFont FixedWidthTextFont FixedWidthTextFont

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

ModernDocumentFont ModernDocumentFont ModernDocumentFont ModernDocumentFont ModernDocumentFont

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

TraditionalDocumentFont TraditionalDocumentFont TraditionalDocumentFont TraditionalDocumentFont TraditionalDocumentFont

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

UICaptionFont 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.

UIHeadingFont 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.

UINotificationHeadingFont 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.

UITextFont UITextFont UITextFont UITextFont UITextFont

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

UITitleFont UITitleFont UITitleFont UITitleFont UITitleFont

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

See Also