Windows phone 7 Windows Phone 7-如何在SpriteFont中使用TTF?

Windows phone 7 Windows Phone 7-如何在SpriteFont中使用TTF?,windows-phone-7,xna,truetype,Windows Phone 7,Xna,Truetype,有没有办法在XNA中使用自定义字体?当然,您需要将字体导入系统。将字体添加到字体系统目录或通过控制面板添加。准备好后(重新启动Visual Studio),在Visual Studio中使用SpriteFont的自定义模板,该模板将生成一个XML文件。一棵枫树: <?xml version="1.0" encoding="utf-8"?> <!-- This file contains an xml description of a font, and will be read

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

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

<?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>
...

云纹
...

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

<?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,而不是PC。Conent Pipline将获取字体。试试看。它的生成和运行应该没有问题。错误2无法自动检测“Fonts\PreludeFLF.ttf”使用哪个导入程序。没有处理此文件类型的导入程序。指定在项目中处理此文件类型的导入程序。C:\src\C#\wp7 count game\Numbers\NumbersLibContent\font\PreludeFLF.ttf numberslib是否正确?看一看你不应该直接使用字体。使用spritfont导入字体。或者,您可以将字体更改为位图右键单击内容项目名称并选择“添加…新项目”,然后选择SpriteFont。然后,只需将name字段更改为“PreludeFLF”。如果您的计算机上安装了PreludeFLF,则内容将在编译时为您将其构建到SpriteFont中。关于XNA内容,需要了解以下几点:1)内容构建在您的PC上,而不是手机上。部署时,二进制编译内容文件(.xnbs)会传输到手机。2) 您使用的字体不必安装在PC以外的任何地方,因为它们在编译时被制作成位图。3) 你需要使用字体的权限,我想问题是关于Windows Phone 7,而不是PC。Conent Pipline将获取字体。试试看。它的生成和运行应该没有问题。错误2无法自动检测“Fonts\PreludeFLF.ttf”使用哪个导入程序。没有处理此文件类型的导入程序。指定在项目中处理此文件类型的导入程序。C:\src\C#\wp7 count game\Numbers\NumbersLibContent\font\PreludeFLF.ttf numberslib是否正确?看一看你不应该直接使用字体。使用spritfont导入字体。或者,您可以将字体更改为位图右键单击内容项目名称并选择“添加…新项目”,然后选择SpriteFont。然后,只需将name字段更改为“PreludeFLF”。如果您的计算机上安装了PreludeFLF,则内容将在编译时为您将其构建到SpriteFont中。关于XNA内容,需要了解以下几点:1)内容构建在您的PC上,而不是手机上。部署时,二进制编译内容文件(.xnbs)会传输到手机。2) 您使用的字体不必安装在PC以外的任何地方,因为它们在编译时被制作成位图。3) 我想你需要使用字体的权利