Windows Phone 7 - 如何在 SpriteFont 中使用 TTF? [英] Windows Phone 7 - How to use TTF in SpriteFont?

查看:27
本文介绍了Windows Phone 7 - 如何在 SpriteFont 中使用 TTF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 XNA 中使用自定义字体?

Is there any way to use custom fonts in XNA?

推荐答案

当然,您需要将字体导入到您的系统中.将字体添加到字体系统目录或通过控制面板添加.当它准备好(重新启动 Visual Studio)时,在 Visual Studio 中使用 SpriteFont 的自定义模板,它会生成一个 XML 文件.一个例子:

Sure, you need to import the font to your system. Add the font to the font system catalog or add through control panel. When it is ready (reboot Visual Studio) use the custom template for SpriteFont in Visual studio, which generates an XML file. An 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>
...

这篇关于Windows Phone 7 - 如何在 SpriteFont 中使用 TTF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆