LanguageFont LanguageFont LanguageFont LanguageFont LanguageFont Class

Definition

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

public : sealed class LanguageFont : ILanguageFont
struct winrt::Windows::Globalization::Fonts::LanguageFont : ILanguageFont
public sealed class LanguageFont : ILanguageFont
Public NotInheritable Class LanguageFont Implements ILanguageFont
// This class does not provide a public constructor.
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 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.

Properties

FontFamily FontFamily FontFamily FontFamily FontFamily

Gets the family name of the font.

FontStretch FontStretch FontStretch FontStretch FontStretch

Gets the FontStretch property of the font.

FontStyle FontStyle FontStyle FontStyle FontStyle

Gets the FontStyle property of the font.

FontWeight FontWeight FontWeight FontWeight FontWeight

Gets the weight of the font (FontWeight ).

The weight of the font is the lightness or heaviness of the strokes.

ScaleFactor ScaleFactor ScaleFactor ScaleFactor ScaleFactor

Gets a recommended font size scaling factor for the font.

The factor can be used to adjust relative sizes when two or more fonts are used for different runs within the same text element.

See Also