LanguageFontGroup class

Applies to Windows and Windows Phone

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

Syntax


public sealed class LanguageFontGroup

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(MTA)]
[Version(0x06020000)]

Members

The LanguageFontGroup class has these types of members:

Constructors

The LanguageFontGroup class has these constructors.

ConstructorDescription
LanguageFontGroup Creates a LanguageFontGroup object for a given language or script.

 

Properties

The LanguageFontGroup class has these properties.

PropertyAccess typeDescription

DocumentAlternate1Font

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

DocumentAlternate2Font

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

DocumentHeadingFont

Read-onlyGets a font that is recommended for use in document headings.

FixedWidthTextFont

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

ModernDocumentFont

Read-onlyGets a font that is recommended for typical document body text following modern style conventions.

TraditionalDocumentFont

Read-onlyGets a font that is recommended for typical document body text following traditional style conventions.

UICaptionFont

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

UIHeadingFont

Read-onlyGets 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

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

UITextFont

Read-onlyGets a font that is recommended for typical UI body text.

UITitleFont

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

 

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 Windows 8.1: 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

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Globalization.Fonts
Windows::Globalization::Fonts [C++]

Metadata

Windows.winmd

See also

Language font mapping sample

 

 

Show:
© 2014 Microsoft