在Silverlight中显示®符号 [英] Displaying ® symbol in Silverlight

查看:117
本文介绍了在Silverlight中显示®符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Folks!

我试图在我的silverlight应用程序中显示®和上标TM符号。我想将包含符号的文本保存在resx文件中。

I am trying to display ® and superscript TM symbols in my silverlight app. I want to save the text containing the symbols in a resx file.

我尝试过的东西:



  • 将任何文档中的®符号复制到resx文件。 ®符号在resx文件中显示
    。但是,当
    运行silverlight应用程序时,
    xamlparseexception被抛出。

  • Copy paste the ® symbol from any document to resx file. ® symbol gets displayed in the resx file. But, when running the silverlight app, xamlparseexception is thrown.

使用unicode文本&#174而不是®符号resx文件。相同的
xamlparseexception抛出。

Use unicode text &#174 instead of ® symbol in the resx file. Same xamlparseexception thrown.

我的resx文件编码是utf- 8。

My resx file encoding is utf-8.

欣赏您的想法!

编辑:

错误地提及@而不是®。

EDITED:
Incorrectly mentioned @ instead of ®.

快照中的Redbox是如何在Silverlight中显示符号的。 Bluebox是如何显示的。

Redbox in the snapshot is how the symbol gets displayed in Silverlight. Bluebox is how it needs to be displayed.

编辑2和解决方案:
显示符号的方式取决于使用的字体。此外,在Silverlight中显示上标有点棘手。但是,我发现的最简单的解决方案是在Windows字符映射工具中创建上标文本,并将其应用资源文件复制粘贴。

EDIT 2 and SOLUTION: The way the symbols are displayed are dependant on the font used. Also, displaying superscripts in Silverlight is a bit tricky. But, the simplest solution i found was to create the superscript text in Windows character map tool and copy paste it your app resource file.

推荐答案

p>符号的大小因使用的字体而异。一些字体将其作为上标绘制,其他字体将其绘制为标准字符。例如,Lucida Sans Unicode字体对待它像一个Superscript,因为Lucida Grande字体像普通字符一样绘制它。因此,您需要小心使用哪种字体来呈现。

The size of the ® symbol varies with the font being used. Some fonts draw it as a superscript others draw it as a standard character. For example the "Lucida Sans Unicode" font treats it like a Superscript where as the "Lucida Grande" font draws it like a normal character. Hence you need to be careful which font you use to render it.

正如我写的那样,我看到一个例子。我在SO中写的这个文本框中的字符是上标,而在字符下面的预览框是正常大小。

I'm seeing a case in point just as I write this. The text box where I'm writing this in SO has the ® character as a superscript whereas looking at the preview box below the character is normal size.

这篇关于在Silverlight中显示®符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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