0
votes

XNB files are created by Microsoft XNA and distributed with many games. XNB is a general serialization format capable of representing arbitrary .NET objects, but there are common definitions for textures, sound samples, 3D models, fonts, and other game data. XNB files may use LZX compression (referred to as the Xbox XMemCompress format).

I have decompressed xnb files with fonts and I need to get information what kind of font and font size is used. I don't have a source of primary application. I would like to use the same font design in other application.

Current xnb files with fonts don't have all special characters which I need. I'm able to generate new spritefont with Unicode characters and compile it to xnb files but because I don't know what font had been used so my addon design is visible different.

Does anyone know how to detect what kind of font and fontsize is used in XNB file? Also I was thinking about change encoding through hex editior but I didn't find any info where information about encoding is stored and how easly change them.

Sample file with font: https://onedrive.live.com/redir?resid=B6196AD97CA6B88A!251&authkey=!ADaJmio5n3RO2zM&ithint=file%2c.zip

Until now I found below helpful resources:

1

1 Answers

1
votes

You can use the "Compiled (XNB) Content Format" project from the msdn.

I haven't tried it myself, but according to Microsoft, you can use it to open an XNB file and see it's content printed on the screen:

It also includes an example .xnb parser, written in native C++, which demonstrates how to parse a compiled XNB file by printing its contents to the screen.

Check it out here.

You can find other similar tools, but I always prefer to go to the owner of the product itself, this way you have better chances of having something useful.