TextBlock 中的上标或下标 [英] Superscript or subscript in TextBlock

查看:26
本文介绍了TextBlock 中的上标或下标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<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

我想要的是

PS 我找到了这个答案 https://stackoverflow.com/a/3435675/468724a> 但没有像 BaselineAlignment

P.S. I found this answer https://stackoverflow.com/a/3435675/468724 but there is no such property as BaselineAlignment

推荐答案

要么使用Segoe WP字体

或者可以这样做

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

我使用的商标符号字体减少了 60%

I used 60% lesser font for trademark symbol

这篇关于TextBlock 中的上标或下标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆