Я работаю над приложением UWP, в котором много рендеринга текста, включая некоторые формулы и математические уравнения. Это все забава и игра, пока вы не наткнетесь на надстрочные или подстрочные части текста с кириллическими буквами.
Я пробовал много разных семейств шрифтов:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Foreground="White" FontSize="36" FontFamily="Palatino Linotype">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Palatino 123"/>
<Run Typography.Variants="Subscript" Text="Linotype 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="1" Foreground="White" FontSize="36" FontFamily="Calibri">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Calibri 123"/>
<Run Typography.Variants="Subscript" Text="Calibri 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="2" Foreground="White" FontSize="36" FontFamily="Arial">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Arial 123"/>
<Run Typography.Variants="Subscript" Text="Arial 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="3" Foreground="White" FontSize="36" FontFamily="Segoe UI">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Segoe 123"/>
<Run Typography.Variants="Subscript" Text="UI 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="4" Foreground="White" FontSize="36" FontFamily="Segoe WP">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Segoe 123"/>
<Run Typography.Variants="Subscript" Text="WP 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="5" Foreground="White" FontSize="36" FontFamily="Segoe Script">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Segoe 123"/>
<Run Typography.Variants="Subscript" Text="Script 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="6" Foreground="White" FontSize="36" FontFamily="Sitka">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Superscript Sitka 123"/>
<Run Typography.Variants="Subscript" Text="Subscript Sitka 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="7" Foreground="White" FontSize="36" FontFamily="Verdana">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Super Verdana 123"/>
<Run Typography.Variants="Subscript" Text="Subs Verdana 123"/>
<Run Typography.Variants="Superscript" Text="суп1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="8" Foreground="White" FontSize="36" FontFamily="Trebuchet MS">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Trebuchet 123"/>
<Run Typography.Variants="Subscript" Text="MS 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="9" Foreground="White" FontSize="36" FontFamily="Arial Nova">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Arial 123"/>
<Run Typography.Variants="Subscript" Text="Arial 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="10" Foreground="White" FontSize="36" FontFamily="Consolas">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Consolas 123"/>
<Run Typography.Variants="Subscript" Text="Consolas 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="11" Foreground="White" FontSize="36" FontFamily="Courier New">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Courier 123"/>
<Run Typography.Variants="Subscript" Text="New 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
<TextBlock Grid.Row="12" Foreground="White" FontSize="36" FontFamily="Gill Sans Nova">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Gill 123"/>
<Run Typography.Variants="Subscript" Text="Sans Nova 123"/>
<Run Typography.Variants="Superscript" Text="супер1"/>
<Run Typography.Variants="Subscript" Text="саб2"/>
</TextBlock>
</Grid>
Как видите, некоторые шрифты вообще не будут отображать суб-/супер-начертание, некоторые будут работать, но только для латинских букв и/или цифр, и ни один из них не будет работать с кириллицей.
Есть ли способ заставить приложение UWP отображать эти шрифты? символы правильно?
P.S. Я видел вопросы: это, это и это, и ни один из ответов мне не помог.
П.П.С. Я также встречал упоминания о свойстве BaselineAlignment
, но оно недоступно в UWP.