LanguageFont 類別

定義

提供與特定語言之特定字型建議相關的資料。

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
繼承
Object Platform::Object IInspectable LanguageFont
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

// 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

備註

LanguageFont 物件會提供特定語言和特定使用案例字型建議的資料。 LanguageFont 物件是從 LanguageFontGroup物件取得,這是針對特定語言或腳本所建構的。 每個 LanguageFontGroup 物件會針對不同的使用案例提供不同的 LanguageFont 物件。

視使用案例而定,LanguageFont 中提供的字型粗細/樣式/延展屬性可能不重要:對於某些使用案例,一般字型 (一般粗細、一般樣式、一般延展性) 一律會傳回。 應用程式可能想要在這些情況下套用其他權數/樣式/延展格式設定。 請參閱 LanguageFontGroup不同使用案例的備註。

ScaleFactor屬性提供可套用至小數位數位號的乘數。 如需詳細資訊,請參閱 ScaleFactor 屬性主題。

LanguageFont 所參考的字型一律是隨附于 Windows 的字型。 使用者或開發人員無法自訂這些值。 假設每一個 Windows 8 系統上都有字型是安全的。

屬性

FontFamily

取得字型的系列名稱。

FontStretch

取得字型的 FontStretch 屬性。

FontStyle

取得字 型的 FontStyle 屬性。

FontWeight

取得 FontWeight) (字型的粗細。

字型的粗細是筆劃的光線或粗細。

ScaleFactor

取得字型的建議字型大小縮放比例。

當兩個或多個字型用於相同文字元素內的不同執行時,此因素可用來調整相對大小。

適用於

另請參閱