Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm developing a game in XNA, however, I do not want to use a content project. I'm loading all my textures through different means, and I'd also like to load my fonts without a content project.

Is there any quick way to maybe include the SpriteFont in the main game project?

share|improve this question
    
I'm pretty sure there isnt a quick way to load a font as a sprite font. As todo that a font is baked into a texture. Maybe head over to MonoGame and check their source code to see if they have something for text rendering. Why are you not using the content project btw? Its a good way to pack and manage textures. –  Roy T. Mar 16 '13 at 13:59
    
A content project isn't ideal for my needs, because all the textures I use are concentrated in two different very large spritesheets. I want to be able to change these files out very easily, and I want to use my own code to load and process them. –  Andreas Carlbom Mar 21 '13 at 12:18
1  
That is what custom content importers and processors are for :) –  Roy T. Mar 21 '13 at 15:06

1 Answer 1

XNA is designed around the content processor pipeline and SpriteFont resources are designed to make use of that. There are really no good ways to circumvent that.

You could create a separate project that used a content project to generate and load the sprite font, and then use reflection to access the SpriteFont object's private members, including textureValue (which is a Texture2D) and spit them out to some format you can parse yourself. But that is really a bit heavy-handed, and at that point not much different than using a third-party, API-agnostic bitmap font generation tool (like BMFont).

Plus it still uses a content project somewhere in your pipeline. Your best option if you really don't want to make use of XNA's content pipeline is to find third-party tools.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.