I don't know why Alan didn't ship it in the distro. It's a good
example of the usage of callback. Will show all fonts installed.

--------------------- EnumFonts.PowerPro -----------------------------
@EnumFontFamiliesEx
local hDC,tLF,tTM,eFF

tLF=dll.create_struct("i[5] cn[8] ca[32] ca[64] ca[32] ca[32]")
tTM=dll.create_struct("i[11] ca[4] ucn[5] ui i[3] ui[4] ui[2]")
eFF=dll.create_callback("[EMAIL PROTECTED]",tLF++" "++tTM++" ui ui")

tLF[9]=1

hDC=dll.call("GetDC|ui",0)
dll.call("EnumFontFamiliesEx|ui t* k ui ui",hDC,tLF,eFF,0,0)
dll.call("ReleaseDC|ui ui",0,hDC)
quit

@Font
args  tLF,tTM,nType,lParam
local pElf,pNtm,sData

pElf=tLF.get_pointer(14)
pNtm=tTM.get_pointer

dll.call("Cdecl|wsprintf|s+ s- ui ui ui ui","sData";;+
,?"'%s' '%s' '%s' '%s'",pElf,pElf+32,pElf+96,pElf+128)

/* nType
RASTER_FONTTYPE = 1
DEVICE_FONTTYPE = 2
TRUETYPE_FONTTYPE = 4
*/

win.debug(nType,sData)
quit(1)
----------------------------------------------------------------------

Sean




Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to