Вопрос

Есть ли способ использовать пользовательские шрифты в XNA?

Это было полезно?

Решение

Конечно, вам нужно импортировать шрифт в вашу систему.Добавьте шрифт в каталог системы шрифта или добавить через панель управления.Когда он готов (перезагрузка Visual Studio) Используйте пользовательский шаблон для SpriteFont в Visual Studio, что генерирует файл 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>
...
.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top