问题
<TextBlock Foreground="Black" FontSize="50" FontFamily="Segoe UI">
<Run>Normal Text</Run>
<Run Typography.Variants="Superscript" Text="Superscript123"/>
<Run Typography.Variants="Subscript" Text="Subscript123"/>
</TextBlock>
Below is my screen shot. It seems that certain characters are not allowed in super/sub script.
Actually I want to put a ® symbol what I'm getting is
and what I want is
P.S. I found this answer https://stackoverflow.com/a/3435675/468724 but there is no such property as BaselineAlignment
回答1:
Either use Segoe WP font
Or can do like this
<StackPanel Orientation="Horizontal">
<TextBlock FontFamily="Segoe UI" FontSize="16" Text"Normal Text"/>
<TextBlock FontFamily="Segoe UI" FontSize="9" Text="®"/>
</StackPanel>
I used 60% lesser font for trademark symbol
回答2:
This looks nice for a subscsript Run in a TextBlock on my screen, using VS2015:
<Style TargetType="{x:Type Run}" x:Key="Sub">
<Setter Property="FontSize" Value="10"/>
<Setter Property="BaselineAlignment" Value="TextBottom"/>
</Style>
It's just a bit lower than Typography.Variants = Subscript, which seems to use just a smaller font
来源:https://stackoverflow.com/questions/14950827/superscript-or-subscript-in-textblock