Files
MonoGame.Extended/src/dotnet/MonoGame.Extended.Content.Pipeline/BitmapFonts/BitmapFontImporter.cs
T
Lucas Girouard-Stranks 3678ef907d Move code into src/dotnet
2020-11-30 17:34:54 -05:00

22 lines
817 B
C#

using System.IO;
using System.Xml.Serialization;
using Microsoft.Xna.Framework.Content.Pipeline;
namespace MonoGame.Extended.Content.Pipeline.BitmapFonts
{
[ContentImporter(".fnt", DefaultProcessor = "BitmapFontProcessor",
DisplayName = "BMFont Importer - MonoGame.Extended")]
public class BitmapFontImporter : ContentImporter<BitmapFontFile>
{
public override BitmapFontFile Import(string filename, ContentImporterContext context)
{
context.Logger.LogMessage("Importing XML file: {0}", filename);
using (var streamReader = new StreamReader(filename))
{
var deserializer = new XmlSerializer(typeof(BitmapFontFile));
return (BitmapFontFile)deserializer.Deserialize(streamReader);
}
}
}
}