Share via


LanguageFontGroup Class

Definition

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

public ref class LanguageFontGroup sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.Fonts.ILanguageFontGroupFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class LanguageFontGroup final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.Fonts.ILanguageFontGroupFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class LanguageFontGroup final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.Fonts.ILanguageFontGroupFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public sealed class LanguageFontGroup
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.Fonts.ILanguageFontGroupFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class LanguageFontGroup
function LanguageFontGroup(languageTag)
Public NotInheritable Class LanguageFontGroup
Inheritance
Object Platform::Object IInspectable LanguageFontGroup
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

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

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)

Creates a LanguageFontGroup object for a given language or script.

Properties

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

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

DocumentHeadingFont

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

FixedWidthTextFont

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

ModernDocumentFont

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

TraditionalDocumentFont

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

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

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

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

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

UITitleFont

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

Applies to

See also