Font Editor II - This time it's impersonal.

posted in NO
Published August 12, 2007
Advertisement
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.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Gorgon 3.2

10129 views

Gorgon v3.1.46.255

3322 views

Gorgon v3.1.45.248

2955 views

Gorgon v3.1.29.243

4239 views

Gorgon v3.1

4063 views

Gorgon Update #10

2968 views

Gorgon Update #9

3168 views

Gorgon Update #8

2901 views

Gorgon Update #7

3132 views

v3.0 Release

3685 views
Advertisement