Pixel fonts in Silverlight 4

五迷三道 提交于 2019-12-07 06:27:29

问题


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.


回答1:


Just have created a custom TextBlock control which renders text with a pixel font and anti-aliasing turned off.

Pixel Fonts for Silverlight




回答2:


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.



来源:https://stackoverflow.com/questions/3567671/pixel-fonts-in-silverlight-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!