nanogui: True type font


Previous by date: 23 Dec 2004 13:16:28 +0000 lincense for chinese fonts, Seol,Keun-Seok
Next by date: 23 Dec 2004 13:16:28 +0000 checkbox in microwindows, Miana Husada
Previous in thread:
Next in thread: 23 Dec 2004 13:16:28 +0000 true type font, Marco Rossi

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



Previous by date: 23 Dec 2004 13:16:28 +0000 lincense for chinese fonts, Seol,Keun-Seok
Next by date: 23 Dec 2004 13:16:28 +0000 checkbox in microwindows, Miana Husada
Previous in thread:
Next in thread: 23 Dec 2004 13:16:28 +0000 true type font, Marco Rossi


Powered by ezmlm-browse 0.20.