I am having difficulty getting MGCB to work with Spritefonts.
I am taking a simple Spritefont file that I would normally use with XNA, and the XML is
EDIT: It doesn’t allow me to paste XML. However, I can assure you it’s just a simple Spritefont file that basically loads Comic Sans and works with XNA.
I copy the MGCB folder and place it into it’s own directory. I then copy the spritefont into that directory. I run
mgcb.exe /clean /rebuild /platform:Windows /build:TestSpriteFont2.spritefont
It simply crashes after some text, which includes:
Z:/MGCB/MGCB/TestSpriteFont2.spritefont
Building Font C:\WINDOWS\Fonts\comic.ttf
Building Font C:\WINDOWS\Fonts\comic.ttf
System.BadImageFormatException: An attempt was made to load a program with an in
correct format. (Exception from HRESULT: 0x8007000B)
at SharpFont.FT.FT_Init_FreeType(IntPtr& alibrary)
at SharpFont.Library…ctor()
at Microsoft.Xna.Framework.Content.Pipeline.Graphics.SharpFontImporter.Import
(FontDescription options, String fontName)
at Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcess
or.ImportFont(FontDescription options, Single& lineSpacing, ContentProcessorCont
ext context, String fontName)
at Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcess
or.Process(FontDescription input, ContentProcessorContext context)
Unhandled Exception: System.ArgumentOutOfRangeException: Index was out of range.
Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.Texture2DW
riter.Write(ContentWriter output, Texture2DContent value)
at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.ContentWri
ter.WriteObject[T](T value)
at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.SpriteFont
ContentWriter.Write(ContentWriter output, SpriteFontContent value)
at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.ContentCom
piler.Compile(Stream stream, Object content, TargetPlatform targetPlatform, Grap
hicsProfile targetProfile, Boolean compressContent, String rootDirectory, String
referenceRelocationPath)
at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.WriteXnb(Objec
t content, PipelineBuildEvent pipelineEvent)
at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.BuildContent(P
ipelineBuildEvent pipelineEvent, PipelineBuildEvent cachedEvent, String eventFil
epath)
at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.BuildContent(S
tring sourceFilepath, String outputFilepath, String importerName, String process
orName, OpaqueDataDictionary processorParameters)
at MGCB.BuildContent.Build(Int32& successCount, Int32& errorCount)
at MGCB.Program.Main(String[] args)