Windows 8.1 支援多彩字型 Segoe UI Emoji

  • 3220
  • 0

在 Windows 8.1 支援多彩字型,像是 Segoe UI Emoji,在開發 App 我們可以透過 IsColorFontEnabled 屬性來取得或設定是否顯示 Color Font

 

說明

在 Windows 8.1 支援多彩字型,像是 Segoe UI Emoji,在開發 App 我們可以透過 IsColorFontEnabled 屬性來取得或設定是否顯示 Color Font。

 

示範

一個簡單的範例,新增空白的應用程式,畫面加上以下 xaml 代碼顯示兩個 TextBox,一個 IsColorFontEnabled 屬性設為 True,另一個為 False。


    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <TextBox Grid.Row="0" x:Name="tbColorFont" FontSize="30" TextWrapping="Wrap" IsColorFontEnabled="True"/>
        <TextBox Grid.Row="1" x:Name="tbNoColorFont" FontSize="30" TextWrapping="Wrap" IsColorFontEnabled="False"/>       
    </Grid>

 

程式碼加上以下代碼,在兩個 TextBox 顯示相同的內容。


        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            StringBuilder strContect = new StringBuilder();
            for (int code = 0x1F600; code < 0x1F6C6; code++)
            {
                strContect.Append(Char.ConvertFromUtf32(code));
            }
            tbColorFont.Text = strContect.ToString();
            tbNoColorFont.Text = strContect.ToString();
        }

 

執行結果如下圖所示。

image

 

其他相關資訊

API changes for Windows 8.1 Preview(Windows Store apps using C#/VB/C++ and XAML)

Innovations in High Performance 2D Graphics with DirectX