LanguageFont Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides data related to a particular font recommendation for a given language.
public ref class LanguageFont sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class LanguageFont final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class LanguageFont
Public NotInheritable Class LanguageFont
- Inheritance
- 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 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 |
Gets the family name of the font. |
FontStretch |
Gets the FontStretch property of the font. |
FontStyle |
Gets the FontStyle property of the font. |
FontWeight |
Gets the weight of the font (FontWeight). The weight of the font is the lightness or heaviness of the strokes. |
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. |