Giter VIP home page Giter VIP logo

Comments (12)

tomspilman avatar tomspilman commented on June 3, 2024

I was receiving build failures that only indicated MCGB.exe crashed with only an exit code as feedback.

It would be good to reproduce that crash. It should have given you a more clear error message like:

font.spritefont() - Error:  The font "Pericles" was not found!

That would have made things much easier to figure out.

Still... yea the samples need to include any custom fonts it uses.

from monogame.samples.

AaronLS avatar AaronLS commented on June 3, 2024

@tomspilman Yes, I would think the same build output you see in the Pipeline editor when building there would be the same output in the VS output windows. I.e. MSGB.exe compile step would have its output piped to the VS output window. Maybe it would be appropriate to have verbose switches to limit output to warnings/error by default so as not to clutter the output.

from monogame.samples.

tomspilman avatar tomspilman commented on June 3, 2024

Yes, I would think the same build output you see in the Pipeline editor when building there would be the same output in the VS output windows.

It should be. Are you saying you saw different output in VS than you saw in the Pipeline tool?

from monogame.samples.

AaronLS avatar AaronLS commented on June 3, 2024

Correct. When the font was not installed on my computer, when building from VS, a "MGCB has stopped working" dialog appears and the error in the Error List is:

The command ""C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\MGCB.exe" /@:"C:\Users\aaron\Downloads\MonoGame.Samples-develop\MonoGame.Samples-develop\Platformer2D\Content\Platformer2D.mgcb" /platform:WindowsGL /outputDir:"C:\Users\aaron\Downloads\MonoGame.Samples-develop\MonoGame.Samples-develop\Platformer2D\Platforms\WindowsGL\Content\bin\WindowsGL" /intermediateDir:"C:\Users\aaron\Downloads\MonoGame.Samples-develop\MonoGame.Samples-develop\Platformer2D\Platforms\WindowsGL\Content\obj\WindowsGL" /quiet" exited with code -532462766.

If I look at the build output there is an unhandled exception from MGCB:

1>  Unhandled Exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
1>  Parameter name: index
1>     at System.Collections.Generic.List`1.get_Item(Int32 index)
1>     at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.Texture2DWriter.Write(ContentWriter output, Texture2DContent value)
1>     at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.ContentWriter.WriteObject[T](T value)
1>     at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.SpriteFontContentWriter.Write(ContentWriter output, SpriteFontContent value)
1>     at Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.ContentCompiler.Compile(Stream stream, Object content, TargetPlatform targetPlatform, GraphicsProfile targetProfile, Boolean compressContent, String rootDirectory, String referenceRelocationPath)
1>     at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.WriteXnb(Object content, PipelineBuildEvent pipelineEvent)
1>     at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.BuildContent(PipelineBuildEvent pipelineEvent, PipelineBuildEvent cachedEvent, String eventFilepath)
1>     at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.BuildContent(String sourceFilepath, String outputFilepath, String importerName, String processorName, OpaqueDataDictionary processorParameters)
1>     at MGCB.BuildContent.Build(Int32& successCount, Int32& errorCount)
1>     at MGCB.Program.Main(String[] args)

from monogame.samples.

tomspilman avatar tomspilman commented on June 3, 2024

@AaronLS - Yea... that should have been handled a lot cleaner. A) the font processor should have failed when the font wasn't found B) the XNB writer should be capturing content building exceptions and reporting a good error message.

I'll see about correcting both of these in the pipeline code.

from monogame.samples.

SimonDarksideJ avatar SimonDarksideJ commented on June 3, 2024

For now I've just submitted a PR to change the font used in the sample to Arial. #33
This ensures that all machines will be able to build the samples without extra stuff

from monogame.samples.

theZMan avatar theZMan commented on June 3, 2024

Simply shipping the font with the source code doesn't help as fonts need to be installed. So this should be shipped at part of MonoGame since that's what XNA 4.0 Game Studio did (note that 3.x did NOT - developers had to install it themselves)

I have no clue if the license Microsoft got with Ascender allows us to do that thugh - someone else would need to determine that http://xbox.create.msdn.com/en-US/education/catalog/utility/font_pack

Here's the spritefont schema http://msdn.microsoft.com/en-us/library/bb447759.aspx - it doesn't allow multiple fonts to be selected like CSS. Its pretty rare you would want that - fonts are so different in sizes that even a simple font switch can totally change the game layout.

Obviously the font processor needs a better error but installing the XNA font pack would be a much better solution if legally allowed.

from monogame.samples.

tomspilman avatar tomspilman commented on June 3, 2024

it doesn't allow multiple fonts to be selected like CSS

Yea... you don't want the font selection to be fuzzy like that. It should always select the desired font or error out.

I think we support looking for the font TTF in the same folder as the .spritefont folder. That is as good as we can get I think without requiring users install the font into the system.

from monogame.samples.

theZMan avatar theZMan commented on June 3, 2024

Well that's a cool feature that XNA didn't do and would work well for samples since we can ship the TTF with the sample.

from monogame.samples.

AaronLS avatar AaronLS commented on June 3, 2024

I think we support looking for the font TTF in the same folder as the .spritefont folder.

Nice. Side-by-side like this is really great because it makes it easy for others to get-latest and compile without interference from variations in their own local environment.

from monogame.samples.

tomspilman avatar tomspilman commented on June 3, 2024

without interference from variations in their own local environment.

Yeah... that is exactly why we wanted that feature.

from monogame.samples.

SimonDarksideJ avatar SimonDarksideJ commented on June 3, 2024

@AaronLS can you close this issue since it is no longer an issue?

from monogame.samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.