Hello. I'm trying to use Nuclex Fonts in a XNA project, but I have a problem. I've been able to draw text, but when I use special characters (with accents), they don't show up. Is there a way to draw special characters with Nuclex Fonts?!?
Thanks in advance.
Only Ascii for Now
Sorry, but the current release only renders ascii characters (in the 0-127 range).
If you desperately need accents or other special characters, you can modify the Nuclex.Fonts.Content.Pipeline.TrueTypeImporter to import accented characters simply by altering this section of code in BitmapFontProcessor.cpp:
// Import all Ascii characters
for(wchar_t character = 0; character < 128; ++character)
importGlyph(fontContent, face, character);
// Example: Import accented 'a' variants
importGlyph(fontContent, face, L'á');
importGlyph(fontContent, face, L'à');
importGlyph(fontContent, face, L'â');
...
Just FYI, the XNA SpriteFont classes released with XNA Game Studio 1.0 Refresh do allow you to import special characters by placing them in the XML file:
<CharacterRegion>
<Start>á</Start>
<End>â</End>
</CharacterRegion>
</CharacterRegions>
That did the trick!
That did the trick!
Thanks!
Post new comment