CreateFont doesn't Create correct font
Posted on 1997-07-16
I have an app that allows users to select fonts from the available system fonts (Windows NT 4.0). Some of the fonts seem to get mapped to a "default" font. Here is a sample of the code in the OnDraw section of AppView...
Font_Name = "Times New Roman"
Old_Font = pDC->SelectObject(&Font);
OutPut = "Font name = " + Font_Name;
This works fine, the output says...
Font name = Times New Roman
in the Times New Roman font (as would be expected), but if I set Font_Name = "WingDings", the output says...
Font name = WingDings
What should be displayed is a bunch of unreadable characters in the WingDings font. The same thing happens with the "Script" font, and a few others. CreateFont seems to map some fonts to their correct font, while setting others to some default font. It makes no difference if the font is TT or not.
Why doesn't CreateFont work for some fonts, but it does for others? Am I using CreateFont incorrectly? I have tried setting some of the 0'ed out parameters, but I don't seem to be getting anywhere.