2012-02-25 58 views

回答

3

當然,您需要將字體導入到您的系統。將字體添加到字體系統目錄或通過控制面板添加。準備好後(重新啓動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> 
... 
+0

問題是關於Windows Phone 7,而不是PC。 – arts777 2012-02-25 17:25:59

+0

Conent Pipline將獲取字體。嘗試一下。它應該建立和運行沒有問題。 – 2012-02-25 18:13:56

+0

錯誤無法自動檢測哪個導入器用於「Fonts \ PreludeFLF.ttf」。沒有進口商處理這種文件類型。指定在您的項目中處理此文件類型的導入程序。 \t C:\ src \ c#\ wp7-count-game \ Numbers \ NumbersLibContent \ Fonts \ PreludeFLF.ttf \t NumbersLib – arts777 2012-02-25 18:55:47