An old XNA Extras had used System.XML, but it becomes unable to use because XNA Framework doesn’t allow to reference System.XML. But, we can use great solution using Content-Pipeline. I found it in this thread.
In this thread, new XNAExtras Aaron Leiby have posted is a very good solution. This may be the quickest bitmap font solution I have seen. This converted XNAExtras makes it possible to load XML files generated by bmfontgen with content-pipeline.
- Build XNABaseWin or Xbox.
- Modify the reference of XNAImport and build it.
- Double-click the property of your game project and add XNAImport.dll to your content-pipeline.
- Add XNABase.dll as the reference of your project.
- Change properties of your XML files generated by bmfontgen. XNA Content Pipeline is true, Content Importer is BitmapFontImporter, Content Font Processor is BitmapFontProcessor.
Now, you can load your bitmap font as the following:
BitmapFont bitmapFont = content.Load(asset_name);