nanogui: True type font
Subject:
True type font
From:
"R" ####@####.####
Date:
23 Dec 2004 13:16:28 +0000
Message-Id: <000c01c4e8f2$71fc5b30$4201a8c0@GAUL.local>
Hi,
I am trying to use Microwin with Truetype2 fonts.
I amusing the following code to create and select
some true type fonts. The function is returning a
valid hFont. But I am not able to see any text output.
If I use some other font, then I can see messages
like
"Cannot find <fontname > using system font"
and the text is displayed using system font.
HFONT InitializeFont(char* pFontName , HDC hdc)
{
LOGFONT lf;
HFONT hFont;
memset(&lf, 0, sizeof(LOGFONT));
strcpy(lf.lfFaceName, pFontName);
/* lf.lfHeight = -MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);*/
lf.lfHeight = 12;
lf.lfWeight = FW_BOLD;
hFont = CreateFontIndirect( &lf );
if (NULL == hFont) return NULL;
return SelectObject( hdc, hFont);
}
Would appreciate any help
TIA
RR