Silverlight 4 中的像素字体
有没有办法在 Silverlight 4 中正确渲染像素字体?无需将文本分解为路径或某种手动渲染,因为文本依赖于数据绑定。使用 UseLayoutRounding 和 .5px 定位移动进行的调整不起作用。
Is there a way to render pixel fonts correctly in Silverlight 4? Without breaking text into paths or some sort of manual rendering because the text is dependent on data binding. Tweaks with UseLayoutRounding and .5px positioning shifting don't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
刚刚创建了一个自定义 TextBlock 控件,它使用像素字体呈现文本并关闭抗锯齿功能。
Silverlight 像素字体
Just have created a custom TextBlock control which renders text with a pixel font and anti-aliasing turned off.
Pixel Fonts for Silverlight
MS 渲染字体抗锯齿以使它们看起来更好......通常......但是当然这不适用于已经针对特定显示尺寸进行了优化的像素字体。
从一组 png 手动渲染将是您最好的选择(直到 MS 添加新的渲染选项)。
当然,您必须编写自己的字体管理器并创建/子类化用户控件来替换 TextBlock(以便您的绑定方法仍然有效)。我还没有找到现有的像素字体管理器(还)。
祝你的项目好运。
MS render the font anti-aliased to make them look better... generally... but of course that does not work for pixel fonts that are already optimised for a specific display size.
Manual rendering from a set of pngs would be your best bet (until MS add a new rendering option).
You would of course have to write your own font manager and create/subclass a user control to replace the TextBlock (so that your binding methods still work). I have not found an existing pixel font manager (yet).
Good luck with your project.