Konstantin Koch 17d0771b03 Placed the importers into different categories for the "importing existing files" dialog in Visual Studio.
Fixed a performance problem in the Visual Studio extension where no importer or processor was selected for an asset.
Fixed that the asset names for Uri encoded in the build output.
Fixed that errors when serializing assets get logged.
Sped up ImporterManager.GuessImporterByFileExtension, which caused performance problems if many assemblies are loaded into the current AppDomain.
Made the AssimpImporter library deploy the binary files again (hopefully just a temporary solution until we've found a better way.)
Provide a extension for TargetPlatform enum for getting the DisplayName of an entry.
Changed that ProcessorManager.GetProcessorDisplayName doesn't throw an exception if no processor with the given name exists, which now mimicks the same behavior as in importerManager.GetImporterDisplayName.
2015-04-26 19:47:26 +02:00

46 lines
2.2 KiB
C#

#region Using Statements
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
using System.Xml;
using System.Xml.Linq;
using ANX.Framework.Content.Pipeline.Graphics;
using ANX.Framework.NonXNA.Development;
using ANX.Framework.Content.Pipeline.Serialization.Intermediate;
#endregion
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Content.Pipeline.Importer
{
/// <summary>Provides methods for reading .spritefont files for use in the Content Pipeline.</summary>
[PercentageComplete(90)]
[Developer("SilentWarrior/Eagle Eye Studios, KorsarNek")]
[TestState(TestStateAttribute.TestState.InProgress)] //Works but there should be a check whether the characters are supported
[ContentImporter("Spritefont", ".spritefont", DefaultProcessor = "FontDescriptionProcessor", DisplayName = "FontDescription Importer - ANX Framework", Category = "Font Files")]
public class FontDescriptionImporter : ContentImporter<FontDescription>
{
/// <summary>
/// Called by the Framework when importing a .spritefont file to be used as a game asset. This is the method called by the Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
/// </summary>
/// <param name="filename">Name of a game asset file.</param>
/// <param name="context">Contains information for importing a game asset, such as a logger interface.</param>
public override FontDescription Import(string filename, ContentImporterContext context)
{
using (XmlReader reader = XmlReader.Create(filename))
{
FontDescription fontDescription = IntermediateSerializer.Deserialize<FontDescription>(reader, filename);
fontDescription.Identity = new ContentIdentity(new FileInfo(filename).FullName, "FontDescriptionImporter");
return fontDescription;
}
}
}
}