Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enumerate available fonts
#1
Using this example (most simple example I found)

http://www.catch22.net/tuts/enumfont

I cannot figure out how to work the EnumFontFamiliesEx especially the callback function.

MSDN is not simple enough for me to understand http://msdn.microsoft.com/en-us/library/...S.85).aspx

Function EnumFixedFonts
Code:
Copy      Help
LOGFONT logfont

;ZeroMemory(&logfont, sizeof(logfont));

logfont.lfCharSet = DEFAULT_CHARSET
logfont.lfPitchAndFamily = FIXED_PITCH|FF_DONTCARE
;logfont.lfFaceName = ""
;lstrcpy(logfont.lfFaceName "\0");

int hdc = GetDC(0)

EnumFontFamiliesEx(hdc &logfont &FontNameProc 0 0)
;EnumFontFamiliesEx(hdc &logfont call(&FontNameProc) 0 0)

ReleaseDC(0 hdc)

Function FontNameProc
Code:
Copy      Help
function ENUMLOGFONTEX'&lpelfe NEWTEXTMETRICEX'&lpntme FontType lParam
int i
out "in"
out lpelfe.elfLogFont.lfPitchAndFamily
out lpelfe.elfFullName
if (lpelfe.elfLogFont.lfPitchAndFamily&FIXED_PITCH)
,out "%s" lpelfe.elfFullName


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)