Files
MonoGame.Extended/source/MonoGame.Extended.Content.Pipeline/BitmapFonts/BitmapFontImporter.cs
T
Christopher WhitleyandGitHub 66277568c8 Refactor BitmapFont (#887)
* Update file header

* Created initial project to move BitmapFont too

* XMl, Text, and Binar reading now supported for BMFont

* Refactor BittmapFont

* Update content pipeline from BitmapFont refactor

* Update changelog
2024-06-11 00:25:10 -04:00

23 lines
871 B
C#

using System.IO;
using System.Xml.Serialization;
using Microsoft.Xna.Framework.Content.Pipeline;
using MonoGame.Extended.BitmapFonts;
using MonoGame.Extended.BitmapFonts.BmfTypes;
namespace MonoGame.Extended.Content.Pipeline.BitmapFonts
{
[ContentImporter(".fnt", DefaultProcessor = "BitmapFontProcessor",
DisplayName = "BMFont Importer - MonoGame.Extended")]
public class BitmapFontImporter : ContentImporter<ContentImporterResult<BmfFile>>
{
public override ContentImporterResult<BmfFile> Import(string filename, ContentImporterContext context)
{
context.Logger.LogMessage("Importing FNT file: {0}", filename);
using FileStream stream = File.OpenRead(filename);
BmfFile file = BmfFile.FromStream(stream);
return new ContentImporterResult<BmfFile>(filename, file);
}
}
}