LanguageFontGroup 類別

定義

針對各種使用案例,為指定的語言或腳本提供一組字型建議。

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

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

備註

LanguageFontGroup 會針對特定語言或腳本提供一組字型建議。 給定 LanguageFontGroup 所建議的不同字型會公開為個別 LanguageFontGroup 屬性,對應至不同的使用案例。

每個 LanguageFontGroup 屬性都會傳回 LanguageFont 物件,該物件會提供該特定字型建議的詳細資料。 這些詳細資料包括字型系列,以及字型粗細、樣式和延展屬性。

某些使用案例的權數/樣式/延展屬性相當重要,但不適用於其他使用案例。 例如,各種 UI 使用類別的字型建議可能會使用相同的字型系列,但粗細不同 (例如,適用于 UITextFont的 Segoe UI Semilight,但適用于 UICaptionFont 的 Segoe UI 一般) 。 但在某些使用案例中,粗細/樣式/延展屬性可能一律表示「一般」字型 (一般粗細、一般樣式、一般延展) 。 在這些情況下,應用程式可能會想要套用其他權數/樣式/延展格式,因為可能適用于應用程式案例。 如需詳細資訊,請參閱每個 LanguageFontGroup 屬性的備註。

對於某些語言和腳本,LanguageFontGroup 可能不會為每個使用案例提供字型建議。 例如,Windows 中不會針對每個腳本提供固定寬度字型。 如需詳細資訊,請參閱每個 LanguageFontGroup 屬性的備註。

注意

如果您的應用程式將此類別中使用的語言標籤傳遞至任何 國家語言支援 函式,則必須先呼叫 ResolveLocaleName來轉換標記。

從 開始: LanguageFontGroup 類別會傳回字型群組資料,以符合開發應用程式的目標作業系統。 因此,如果您將 Windows 8 應用程式更新為 Windows 8.1,您的應用程式中使用的字型可能會變更,而且您可能需要調整 UI 配置。

建構函式

LanguageFontGroup(String)

為指定的語言或腳本建立 LanguageFontGroup 物件。

屬性

DocumentAlternate1Font

取得建議用於 DocumentHeadingFontModernDocumentFont 和 TraditionalDocumentFont 所提供之檔以外的其他選項的字

DocumentAlternate2Font

取得建議用於 DocumentHeadingFontModernDocumentFont 和 TraditionalDocumentFont 所提供之檔以外的其他選項的字

DocumentHeadingFont

取得建議用於檔標題的字型。

FixedWidthTextFont

取得建議用來顯示固定寬度字元的字型。

ModernDocumentFont

取得建議用於遵循新式樣式慣例之一般檔本文的字型。

TraditionalDocumentFont

取得遵循傳統樣式慣例的一般檔本文建議的字型。

UICaptionFont

取得建議用於特殊 UI 元素的字型,例如標題,以小於一般 UI 本文文字的大小顯示。

UIHeadingFont

取得建議用於特殊 UI 元素的字型,例如標題,其大小比一般 UI 本文文字大一些。

UINotificationHeadingFont

取得建議用於特殊 UI 元素的字型,例如通知或其他應用程式訊息中的標題,以 UI 本文大小顯示,或只需要與 UI 本文文字區別。

UITextFont

取得建議用於一般 UI 本文的字型。

UITitleFont

取得建議用於大小遠大於一般 UI 本文文字之特殊 UI 元素的字型。

適用於

另請參閱