8
\$\begingroup\$

I have a SpriteFont in XNA, which has the standard 126 characters that are usable.

However i would like to use the "ಠ" symbol in the game.

So is there anyway of adding just a few more symbols that the spritefont accepts?

\$\endgroup\$
13
\$\begingroup\$

Modify the sprite font file. It's XML. Double click it in Visual Studio.

Towards the bottom of the default file is a the following:

<CharacterRegions>
  <CharacterRegion>
    <Start>&#32;</Start>
    <End>&#126;</End>
  </CharacterRegion>
</CharacterRegions>

Your character is unicode code point U+0CA0, which in decimal is 3232. So add another character region tag that contains it:

  <CharacterRegion>
    <Start>&#3232;</Start>
    <End>&#3232;</End>
  </CharacterRegion>

This assumes that the ಠ symbol exists in the font you are using.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ ahhh yes, a second region... duh, didn't think of that :P I was just trying multiple Start and End tags... \$\endgroup\$
    – Joel
    Jun 24 '11 at 15:10
  • \$\begingroup\$ My solution was better :p \$\endgroup\$ Jun 24 '11 at 15:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .