private void ApplyFonts_Click(object sender, RoutedEventArgs e) { var languageFontGroup = new LanguageFontGroup("ja-JP"); // Change the Font value with selected font from LanguageFontGroup API MainPage.ApplyLanguageFont(HeadingTextBlock, languageFontGroup.UIHeadingFont); MainPage.ApplyLanguageFont(BodyTextBlock, languageFontGroup.UITextFont); }
private void ApplyFonts_Click(object sender, RoutedEventArgs e) { var languageFontGroup = new LanguageFontGroup("hi"); MainPage.ApplyLanguageFont(HeadingTextBlock, languageFontGroup.DocumentHeadingFont); // Not all scripts have recommended fonts for "document alternate" // categories, so need to verify before using it. Note that Hindi does // have document alternate fonts, so in this case the fallback logic is // unnecessary, but (for example) Japanese does not have recommendations // for the document alternate 2 category. MainPage.ApplyLanguageFont(DocumentTextBlock, languageFontGroup.DocumentAlternate2Font ?? languageFontGroup.DocumentAlternate1Font ?? languageFontGroup.ModernDocumentFont); }