mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 12:06:37 +00:00
* 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
23 lines
871 B
C#
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);
|
|
}
|
|
}
|
|
}
|