Install fonts from within the code

谁说我不能喝 提交于 2019-12-13 07:13:36

问题


I'm currently using a custom font in my XNA game. As you might imagine, the game wont start if the font isn't installed on the PC. I'm planning on using try/catch to understand whether the font's installed or not.

Now, is there a way to install the font from within the code? You can take in mind that the font file is in the Content folder.


回答1:


What you can do is convert your font to a BMP spritefont, import the BMP image and change from "Texture" to "Sprite Font Texture" at the Content Processor in the properties. You can see Here how you can do this.



来源:https://stackoverflow.com/questions/16045255/install-fonts-from-within-the-code

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