Jump to content
  • Advertisement
Sign in to follow this  
Tape_Worm

Unicode characters

This topic is 4061 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been working on getting unicode characters into my bitmap font editor. It's going well thus far. However, I've noticed something odd. For the standard character set (typically 0x00-0xFF) if I call GetCharABCWidths() I get the proper placement data. However, on several characters (but not all) above this range the ABC struct returns with all 0's in it. This does not work because I at the very least need the B portion which specifies the actual width of the font character (A and C specifies the over/under hang for the font character). So I end up with a character that goes nowhere. My question is this: Is GetCharABCWidths suitable for higher unicode characters? Or do I use another API/function for that? If so, which API or function? I'd like to reiterate from past posts in other forums: I hate unicode. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
If you set your project to use unicode, it should work properly. If you don't want to (for whatever reason) but still want to use the unicode version of the function, add a 'W' suffix to make it "GetCharABCWidthsW" (or 'A' for the ansi version in a unicode program "GetCharABCWidthsA").
The same 'trick' can be applied to many functions that would process text in some way.

Share this post


Link to post
Share on other sites
Well I'm using .NET, but perhaps the pinvoke for the function isn't set to use the unicode version. I'll force it and give it a shot, thanks.

Share this post


Link to post
Share on other sites
Quote:
Original post by Extrarius
If you set your project to use unicode, it should work properly. If you don't want to (for whatever reason) but still want to use the unicode version of the function, add a 'W' suffix to make it "GetCharABCWidthsW" (or 'A' for the ansi version in a unicode program "GetCharABCWidthsA").
The same 'trick' can be applied to many functions that would process text in some way.


That looks like it worked, apparently C# defaults the pinvoke functions to CharSet.ANSI, switching it to CharSet.Auto seemed to work like a charm.

Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!