Silverlight 4 中的像素字体

发布于 2024-09-16 03:21:12 字数 165 浏览 2 评论 0原文

有没有办法在 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.
alt text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

記柔刀 2024-09-23 03:21:12

刚刚创建了一个自定义 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

雨轻弹 2024-09-23 03:21:12

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文