|
Post by pablosl on Jun 14, 2020 17:50:31 GMT -5
|
|
cundo
Full Member
Muchas Gracias!!
Posts: 146
|
Post by cundo on Jun 15, 2020 18:20:23 GMT -5
|
|
|
Post by pablosl on Jun 16, 2020 14:36:17 GMT -5
@ cundo : Good catch!. But I don't know how to translate VB to LB. If somebody can provide sample LB code... Regards, -Pablo
|
|
cundo
Full Member
Muchas Gracias!!
Posts: 146
|
Post by cundo on Jun 16, 2020 15:20:17 GMT -5
I'm trying but failing... I'm coding a big struct, with all the properties by now. I think the gdi Function Call expects a Device Context, I'm not sure.
|
|
|
Post by Chris Iverson on Jun 16, 2020 17:14:35 GMT -5
Here's a sample that uses EnumFontFamiliesExA.
size = _LF_FACESIZE 'size = 32 callback fontcb, EnumFontFamExProc(ulong, ulong, long, long), long
struct LOGFONT,_ lfHeight as long,_ lfWidth as long,_ lfEscapement as long,_ lfOrientation as long,_ lfWeight as long,_ lfItalic as char[1],_ lfUnderline as char[1],_ lfStrikeOut as char[1],_ lfCharSet as char[1],_ lfOutPrecision as char[1],_ lfClipPrecision as char[1],_ lfQuality as char[1],_ lfPitchAndFamily as char[1],_ lfFaceName as char[32]
hDC = GetDC(0)
LOGFONT.lfCharSet.struct = _DEFAULT_CHARSET
CallDLL #gdi32, "EnumFontFamiliesExA",_ hDC as ulong,_ LOGFONT as struct,_ fontcb as ulong,_ 0 as long,_ 0 as long,_ ret as long
Function GetDC(hWnd) CallDLL #user32, "GetDC",_ hWnd as ulong,_ GetDC as ulong End Function
Function EnumFontFamExProc(logFontPtr, lpntme, fontType, lParam)
copySize = len(LOGFONT.struct) CallDLL #kernel32, "RtlMoveMemory",_ LOGFONT as struct,_ logFontPtr as ulong,_ copySize as long,_ dummy as void
print "Font found - ";LOGFONT.lfFaceName.struct
'Return value must be 1 to continue enumeration EnumFontFamExProc = 1 End Function
|
|
|
Post by pablosl on Jun 16, 2020 18:39:36 GMT -5
Thank you Chris!. That do the trick.
-Pablo
|
|