質問

I am trying to add the arrow keys ►, ◄, ▲, ▼ to my spritefont. They are Alt16, Alt17, Alt30, Alt31.

Here is what I am trying to do.

<CharacterRegions>
  <CharacterRegion>
    <Start>&#16;</Start>
    <End>&#17;</End>
  </CharacterRegion>
  <CharacterRegion>
    <Start>&#30;</Start>
    <End>&#126;</End>
  </CharacterRegion>
</CharacterRegions>

I am getting an error at the 16 / 17 and 30.

The errors are:

Error   6   Character ' ', hexadecimal value 0x3 is illegal in XML documents.  
Error   7   Character ' ', hexadecimal value 0x1e is illegal in XML documents.  
Error   4   Character ' ', hexadecimal value 0x12 is illegal in XML documents.  
Error   2   Character ' ', hexadecimal value 0x11 is illegal in XML documents.  
Error   5   Character ' ', hexadecimal value 0x11 is illegal in XML documents.  
Error   3   Character ' ', hexadecimal value 0x10 is illegal in XML documents.

Can anyone show me how to properly add them ?

役に立ちましたか?

解決

You need to use the decimal value for your characters instead, check out this site which will show you all of the representations. (You can change the value in the URL to find different characters)

Your correct XML should be:

<CharacterRegions>
  <CharacterRegion>
    <Start>&#9650;</Start>
    <End>&#9668;</End>
  </CharacterRegion>
  <CharacterRegion>
    <Start>&#32;</Start>
    <End>&#126;</End>
  </CharacterRegion>
</CharacterRegions>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top