Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enumerate available fonts
#2
Function EnumFixedFonts
Code:
Copy      Help
out

ARRAY(ENUMLOGFONTEX) a

LOGFONT logfont

logfont.lfCharSet = DEFAULT_CHARSET
logfont.lfPitchAndFamily = FIXED_PITCH|FF_DONTCARE

int hdc = GetDC(0)

EnumFontFamiliesEx(hdc &logfont &FontNameProc &a 0)

ReleaseDC(0 hdc)

int i
for i 0 a.len
,ENUMLOGFONTEX& r=a[i]
,lpstr s=&r.elfLogFont.lfFaceName; out s
,;lpstr s=&r.elfFullName; out s
out a.len

Function FontNameProc
Code:
Copy      Help
;/
function ENUMLOGFONTEX&lpelfe NEWTEXTMETRICEX&lpntme FontType ARRAY(ENUMLOGFONTEX)&a
a[]=lpelfe
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)