2013-02-19 45 views
2
<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> 

下面是我的屏幕截图。看起来超级/子脚本中不允许某些字符。 enter image description hereTextBlock中的上标或下标

其实我想提出一个®象征什么,我得到的是

enter image description here

和我要的是

enter image description here

附:我发现这个答案https://stackoverflow.com/a/3435675/468724但目前还没有这样的属性为BaselineAlignment

+0

这将取决于用来作为支持哪些变体的字体 - 帕拉蒂诺莱诺支持实例中的所有字母。如果您使用FontFamily = Segoe WP作为注册标记,您将获得所需的行为,但我不确定您是否可以/想要依赖Segoe WP在设备上。 – 2013-02-19 07:14:27

+0

@ JimO'Neil是的,我得到这取决于字体家族。但是基线属性呢? – 2013-02-19 07:39:20

+0

另一个问题与WPF有关。 WPF是Windows 8中WinRT/XAML的祖父,用于Windows应用商店应用。 – 2013-02-19 08:11:13

回答

2

要么使用Segoe WP字体

或者可以这样做

<StackPanel Orientation="Horizontal"> 
    <TextBlock FontFamily="Segoe UI" FontSize="16" Text"Normal Text"/> 
    <TextBlock FontFamily="Segoe UI" FontSize="9" Text="&#174;"/> 
</StackPanel> 

我不经常使用的60%的字体商标符号

0

这看起来不错,在我的屏幕上,使用VS2015在我的屏幕上运行一个TextBlock:

<Style TargetType="{x:Type Run}" x:Key="Sub"> 
    <Setter Property="FontSize" Value="10"/>   
    <Setter Property="BaselineAlignment" Value="TextBottom"/> 
</Style> 

这比Typography.Variants低只是有点=下标,这似乎只使用一个较小的字体