如何为字符加上上标? [英] how to have superscript for characters?

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

问题描述



我正在做一个项目,需要在其中显示以下内容:XIth,6th,7th,"th"应该是上标.我尝试了很多,但没有得到.请帮助...

Hi,

I am making a project in which i need to display something like this : XIth ,6th ,7th where ''th'' should be in superscript.I tried a lot but am not getting it . Plz help...

推荐答案

纯文本,Unicode不会为每个字符定义下标/上标.您需要某种格式的文本.如果这是HTML,那么这很简单:您可以使用<sub><sup>元素:6 th ,7 th ...

(为什么,为什么您忽略使用的应用程序类型或UI库的标签呢?!不要怪我一个大概的答案,请自己寻找更多详细信息.)

如果这不是Web应用程序或应用程序生成的某些HTML文档,则可以使用富文本框(确切类型取决于您的UI库,请查找它).

另外,CodeProject上的一些组件允许在Windows应用程序中呈现HTML:
您将使用的专业HTML渲染器 [ ^ ],
WPF HTML支持的TextBlock [
Plain text, Unicode do not define subscripts/superscripts for every character. You need some kind of formatting text. If this is HTML, this is trivial: you can use <sub> or <sup> elements: 6th, 7th

(Why, why did you neglect to tag application type or UI library you use?! don''t blame me for an approximate answer, find further detail by yourself.)

If this is not a Web application or some HTML document generated by your application, you can use rich text box (exact type depends on you UI library, look it up).

Also, there are some components on the CodeProject which allow to render HTML in your Windows application:
A Professional HTML Renderer You Will Use[^],
WPF HTML Supported TextBlock[^].

—SA


这篇关于如何为字符加上上标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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