Page 1 of 1
Posted: Sun Mar 17, 2002 5:36 pm
by BackupUser
Restored from previous forum. Originally posted by wickedRush.
Hello, I've been trying to get the installed font list from my machine into an array. I know enumfonts is the answer (and I have a working VB6 project) but I cannot figure it out w/PB. Any help or code samples would be great

Thanks!
Posted: Sun Mar 17, 2002 9:12 pm
by BackupUser
Restored from previous forum. Originally posted by fred.
Here is a sample..
Code: Select all
OpenConsole()
; Internal PB ENUMLOGFONT structure is broken.. Fixed now.
;
Structure ENUMLOGFONT2
elfLogFont.LOGFONT
elfFullName.b[#LF_FULLFACESIZE]
elfStyle.b[#LF_FACESIZE]
EndStructure
Procedure EnumFontFamProc(*lpelf.ENUMLOGFONT2, *lpntm.NEWTEXTMETRIC, FontType, lParam)
PrintN("Name: "+PeekS(@*lpelf\elfFullName[0]))
ProcedureReturn 1
EndProcedure
*Win = GetForegroundWindow_()
*DC = GetDC_(*Win)
If *DC
EnumfontFamilies_(*DC, @EnumFontFamProc(), 0)
ReleaseDC_(*Win,*DC)
EndIf
Print("Press a ENTER to quit")
Input()
Fred - AlphaSND
Posted: Sun Mar 17, 2002 11:25 pm
by BackupUser
Restored from previous forum. Originally posted by wickedRush.
I get a syntax error at line 19: EnumfontFamilies_(*DC, @EnumFontFamProc(), 0) which after reading the win32api manual I changed to EnumfontFamilies_(*DC,#NULL,@EnumFontFamProc(), 0) now the program compiles but errors and closes.?
Posted: Mon Mar 18, 2002 8:24 am
by BackupUser
Restored from previous forum. Originally posted by fred.
Ho, sorry, I'm coding on the new version of PB. You have to change the following line:
Procedure EnumFontFamProc(*lpelf.ENUMLOGFONT2, *lpntm.NEWTEXTMETRIC, FontType, lParam)
with
Procedure EnumFontFamProc(lParam, FontType, *lpntm.NEWTEXTMETRIC, *lpelf.ENUMLOGFONT2)
Fred - AlphaSND
Posted: Mon Mar 18, 2002 11:39 am
by BackupUser
Restored from previous forum. Originally posted by wickedRush.
Thanks Fred! That did the trick.