Skip to main content
fixed typos
Source Link
Pikalek
  • 13.4k
  • 5
  • 49
  • 54

Adding my experience here as this was one of the first googleGoogle hits.

You could consider making sure you don't get this exception in any case, by defining a default character to be replaced for any character missing from the font.

You can put something like this in your spritefont file:

<DefaultCharacter>*</DefaultCharacter>

Or you can do font.DefaultCharacter = '*' after loading the font.

References: commnitycommunity thread, apiAPI documentation.

Adding my experience here as this was one of the first google hits.

You could consider making sure you don't get this exception in any case, by defining a default character to be replaced for any character missing from the font.

You can put something like this in your spritefont file:

<DefaultCharacter>*</DefaultCharacter>

Or you can do font.DefaultCharacter = '*' after loading the font.

References: commnity thread, api documentation

Adding my experience here as this was one of the first Google hits.

You could consider making sure you don't get this exception in any case, by defining a default character to be replaced for any character missing from the font.

You can put something like this in your spritefont file:

<DefaultCharacter>*</DefaultCharacter>

Or you can do font.DefaultCharacter = '*' after loading the font.

References: community thread, API documentation.

Source Link

Adding my experience here as this was one of the first google hits.

You could consider making sure you don't get this exception in any case, by defining a default character to be replaced for any character missing from the font.

You can put something like this in your spritefont file:

<DefaultCharacter>*</DefaultCharacter>

Or you can do font.DefaultCharacter = '*' after loading the font.

References: commnity thread, api documentation