Click here to Skip to main content
Sign Up to vote bad
good
See more: C#XNA4.0
I want to draw special characters like: "π,Ω,θ,ξ" in XNA by using method
spriteBatch.DrawString() but unsuccessful. Problem in file SpriteFont? Have any solution for it?
Posted 5 Nov '12 - 14:28

Comments
Sergey Alexandrovich Kryukov - 5 Nov '12 - 21:51
Who "invented" this question about special characters?! These characters are not special at all. Just Greek. There is no such thing as "special character". Well, your font should support sufficient Unicode repertoire. --SA
haitrieu749 - 5 Nov '12 - 22:07
Thanks!

2 solutions

I've solved this myself! In my class spritefont. I've been edit it flowing:
<characterregions>
      <characterregion>
        <start>& #32;</start>
        <end>& #126;</end>
      </characterregion>
      <characterregion>
        <start>& #913;</start>
        <end>& #969;</end>
      </characterregion>
    </characterregions>
& #913 -> & # 969 are Greek charaters like "π,Ω,θ,ξ". It begin "A" and the end "ω"
  Permalink  
Comments
haitrieu749 - 8 Nov '12 - 13:32
Note: & # 913 and & # 969 write consecutive.
Please see my comment to the question and read on Unicode just a bit, to have an idea. You don't need any special to do to support it. Nearly all modern systems support Unicode by default, and of course, such a popular "Unicode range" as Greek is included, also by default. Some weird fonts which do not support Unicode are gradually phased out...
 
http://en.wikipedia.org/wiki/Unicode[^],
http://en.wikipedia.org/wiki/Code_point[^],
http://en.wikipedia.org/wiki/UTF[^],
http://en.wikipedia.org/wiki/Byte_order_mark[^];
 
http://unicode.org/[^],
http://www.unicode.org/faq/utf_bom.html[^].
 
—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 310
1 Slacker007 240
2 Mahesh Bailwal 230
3 Ron Beyer 215
4 Aarti Meswania 200
0 Sergey Alexandrovich Kryukov 8,598
1 OriginalGriff 7,024
2 CPallini 3,668
3 Rohan Leuva 3,011
4 Maciej Los 2,343


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 8 Nov 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid