I am trying to make a font using the LOGFONT structure. This is my function:
Code:
void NFont(char* FontName, UINT size, bool bold, bool italic, bool underline, bool strikethrough)
{
if (abs(size)>72) size = 72;
LOGFONT lg = {
abs(size), //height
0, //width
0, //escapement
0, //orientation
bold ? FW_BOLD : FW_NORMAL,
italic,
underline,
strikethrough,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
ANTIALIASED_QUALITY,
DEFAULT_PITCH,
*FontName //"Comic Sans MS"};
...
...
The problem is that I always get an Arial font! For example:
Code:
NFont ("Comic Sans MS", true, false,false,false);
returns an Arial font. However, if i change the *FontName (the one in the LOGFONT list) to a font name f.e "Comic Sans MS", it works. I get the right font. What might be the solution??