Sign in to follow this  

Unicode characters

This topic is 3777 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
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
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

This topic is 3777 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this