我怎样才能让我的“TM”成为更小?
我正在开发 Silverlight 4 应用程序。我在应用程序名称的资源字符串中嵌入了一个“TM”符号,因此无论它出现在文本中,“TM”都位于它旁边。好吧,我的客户说他喜欢它并想保留它,但说“TM”太大了。我想知道是否可以在不破坏资源系统的情况下解决这个问题。我没有使用 Microsoft 的 Resx,因为即使直接开箱即用(即使用 Silverlight 业务应用程序模板 - 我首先将其取出),它总是会导致随机异常和令人困惑的编译器错误。我正在使用自己专有的字符串资源解决方案,该解决方案相当简单,并使用附加的依赖属性从 XML 存储注入字符串。
类似这样:
<TextBox res:Strings.Assignment="Text=HomeView.Title" />
下面是 XML 存储的相关部分:
<Group Name="Default">
<Resource Name="ApplicationName"><![CDATA[MyApp™]]></Resource>
</Group>
<Group Name="HomeView">
<Resource Name="Title"><![CDATA[Welcome to [~ApplicationName]]]></Resource>
</Group>
正如您所看到的,一个资源可以引用另一个资源。 “TM”直接嵌入到 Default.ApplicationName
资源中。
I'm working on a Silverlight 4 application. I have a "TM" symbol embedded in the resource string for my application's name so that wherever it appears in text the "TM" sits beside it. Well, my client says he likes it and wants to keep it but says that the "TM" is too big. I'm wondering if I can fix this without breaking my resource system. I'm not using Microsoft's Resx because it has always caused random exceptions and baffling compiler errors for me even when used straight out of the box (i.e. with the Silverlight Business Application template -- I take it out first thing). I'm using my own proprietary string resource solution which is fairly simple and uses attached dependency properties to inject strings from an XML store.
Something like this:
<TextBox res:Strings.Assignment="Text=HomeView.Title" />
And here is the relevant part of the XML store:
<Group Name="Default">
<Resource Name="ApplicationName"><![CDATA[MyApp™]]></Resource>
</Group>
<Group Name="HomeView">
<Resource Name="Title"><![CDATA[Welcome to [~ApplicationName]]]></Resource>
</Group>
As you can see one resource can reference another. And the "TM" is embedded straight into the Default.ApplicationName
resource.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我相信特殊符号的外观是由字体本身定义的,因此无需编辑字体,您只需像 RobSiklos 提到的那样创建一个单独的部分
I believe the appearance of special symbols is defined by the font itself, so short of editing the font, you'll just have to make a separate section like RobSiklos mentioned
像这样的事情怎么样:
How about something like this:
另一个建议:
因此您正在设置 RichTextBox 的 Xaml 属性。我猜这样你应该能够输入你想要的所有格式。不过还没有真正尝试过。
Another suggestion:
So you're setting the Xaml property of a RichTextBox. That way you should be able to put in all the formatting you want, I would guess. Haven't actually tried it though.