是否有任何方法可以在XNA中使用自定义字体?

有帮助吗?

解决方案

当然,您需要将字体导入系统。将字体添加到字体系统目录或通过控制面板添加。当它已准备就绪(Reboot Visual Studio)使用Visual Studio中SpriteFont的自定义模板,它生成XML文件。exmaple:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
  <Asset Type="Graphics:FontDescription">

    <!--
    Modify this string to change the font that will be imported.
    -->
    <FontName>Moire</FontName>
...
.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top