문제

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