I'm playing around with Monogame and can't add a font. When adding a font with the MonoGame Pipeline tool i can't build my project anymore.
Visual studio stopps with the following error:
Der Befehl ""C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\MGCB.exe" /@:"C:\dev\Mini\Mini\Content\Content.mgcb" /platform:Windows /outputDir:"C:\dev\Mini\Mini\Content\bin\Windows" /intermediateDir:"C:\dev\Mini\Mini\Content\obj\Windows" /quiet" wurde mit dem Code 1 beendet. 'FontDescriptionProcessor' had unexpected
(sorry, its German, but i think you can understand the problem ; ) )
When i execute the error throwing command i get a more helping error:
C:\dev\Mini\Mini\Content>"C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\MGCB.exe" /@:"C:\dev\Mini\Mini\Content\Content.mgcb" /platform:Windows /outputDir:"C:\dev\Mini\Mini\Content\bin\Windows" /intermediateDir:"C:\dev\Mini\Mini\Content\obj\Windows" Build started 07.08.2015 23:15:43
Skipping C:/dev/Mini/Mini/Content/Game/Character.PNG Skipping C:/dev/Mini/Mini/Content/SplashScreen/splashScreenGame.png Skipping C:/dev/Mini/Mini/Content/Game/Background.PNG C:/dev/Mini/Mini/Content/fonts/default.spritefont C:/dev/Mini/Mini/Content/fonts/default.spritefont: error: Processor 'FontDescriptionProcessor' had unexpected failure! System.ArgumentException: Illegales Zeichen im Pfad. bei System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) bei System.IO.Path.IsPathRooted(String path)
bei Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor.FindFontFileFromFontName(String fontName, String fontDirectory) bei Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor.Process(FontDescription input, ContentProcessorContext context) bei Microsoft.Xna.Framework.Content.Pipeline.ContentProcessor`2.Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process(Object input, ContentProcessorContext context) bei MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent(PipelineBuildEvent pipelineEvent)Skipping C:/dev/Mini/Mini/Content/SplashScreen/SplashScreen.xml Skipping C:/dev/Mini/Mini/Content/Game/Game.xmlBuild 3 succeeded, 1 failed.
Time elapsed 00:00:00.19.
I understand, that the path C:/dev/Mini/Mini/Content/fonts/default.spritefont
is invalid, but i don't see any invalid characters. The .spritefont file is generated with the MonoGame tool and not imported. Did i miss something?
I am on a Windows 10, the MonoGame Pipeline Tool is on version 3.5.0.465 and MGCB.exe has the version 3.5.0.465, too.
Edit: When checking the path myself, everything looks ok and moving the whole project to an other harddrive doesn't help at all.
Edit2: Okey. it looks like it is not my font path. It is the path loaded from the registry. The line registryKey.GetValue(current).ToString();
inside the FindFontFileFromFontName
method returns ARIAL.TTF\00\0\0\0\0\0
. I will look into it and update this question or make an answer.
After testing around i came to an solution (or i found the problem...):
Some font paths in my registry are corrupted. Fonts with an uppercase Date value are throwing errors. When you encounter a similar problem take a look in your registry under "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"
l, check your chosen font or change it to a different one. I hope this solution will help you, too. (And when somebody know, why my registry data got corrupted, please let me know.)