LanguageFont class

Applies to Windows and Windows Phone

Provides data related to a particular font recommendation for a given language.

Syntax


var languageFont = LanguageFontGroup.uiTextFont;
var languageFont = LanguageFontGroup.uiHeadingFont;
var languageFont = LanguageFontGroup.uiTitleFont;
var languageFont = LanguageFontGroup.uiCaptionFont;
var languageFont = LanguageFontGroup.UINotificationHeadingFont;
var languageFont = LanguageFontGroup.traditionalDocumentFont;
var languageFont = LanguageFontGroup.modernDocumentFont;
var languageFont = LanguageFontGroup.documentHeadingFont;
var languageFont = LanguageFontGroup.fixedWidthTextFont;

Attributes

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

Members

The LanguageFont class has these types of members:

Methods

The LanguageFont class inherits methods from the Object class (C#/VB/C++).

Properties

The LanguageFont class has these properties.

PropertyAccess typeDescription

FontFamily

Read-onlyGets the family name of the font.

FontStretch

Read-onlyGets the FontStretch property of the font.

FontStyle

Read-onlyGets the FontStyle property of the font.

FontWeight

Read-onlyGets the weight of the font (FontWeight).

ScaleFactor

Read-onlyGets a recommended font size scaling factor for the font.

 

Remarks

A LanguageFont object provides data giving a font recommendation for a particular language and for particular usage cases. LanguageFont objects are obtained from a LanguageFontGroup object, which is constructed for a particular language or script. Each LanguageFontGroup object provides different LanguageFont objects for different usage cases.

Depending on the usage case, font weight/style/stretch attributes provided in the LanguageFont may or may not be significant: for some usage cases, a "regular" font (regular weight, normal style, normal stretch) may always be returned. Applications may want to apply other weight/style/stretch formatting in those cases. See the remarks on the different usage cases for LanguageFontGroup.

The ScaleFactor property provides a multiplier that can be applied to a nominal font size. See the ScaleFactor property topic for additional information.

The fonts referenced by a LanguageFont are always fonts that ship as part of Windows. There is no way for an end user or developer to customize these values. It is safe to assume that the font will be present on every Windows 8 system.

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