NO

Sign in to follow this  
  • entries
    145
  • comments
    222
  • views
    138277

Font Editor II - This time it's impersonal.

Sign in to follow this  
Tape_Worm

24 views

So, I downloaded BM Font yesterday evening. It's been a while since I've seen it. Personally, I'm not a fan of the interface (aesthetically only, functionally it's quite good), but it is a very well done program. I noted something that it does that my font editor in Gorgon does not. UNICRON!! ... er, UNICODE!! Not that there's much of a difference, unicode still destroyed my world.

I was up until 5 AM trying to figure out how to enumerate the character sets from a font. It was bloody painful.

For those who are curious, the API function EnumFontFamiliesEx was the key. Inside that bastard's call back function (FONTENUMPROC) there's a structure passed as a parameter: NEWTEXTMETRICEX, and inside that there's another struct (small wonder I can't find anything) called FONTSIGNATURE. In FONTSIGNATURE, there's an array called fsUsb, it's 4 DWORDs. Each of these DWORDs are the seperate 32 bit pieces of a 128 bit value, from this value you can determine which character sets are supported. FUN! The MSDN has a list. Lists are fun.

Anyway, thanks to adding of the unicode crap,I reworked the character selection screen. It works MUCH better and MUCH faster than it did prior.

I also found out something else as I was finishing the unicode implementation today: C# sets the default CharSet on pinvoked functions to CharSet.ANSI by default. I wonder what the reasoning behind that was? Frankly it'd be a fuckload more useful to have it set to CharSet.Auto by default (apparently the default can vary from language to language). I know this to be true because my imported GetCharABCWidths() function seriously messed up on unicode characters above 255. When I changed the DllImport attribute to set the CharSet to CharSet.Auto it worked beautifully.

So, in summary, use BM font, it's much better than anything I can do.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

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