General information
Category:
Windows API functions
Hi Sergey,
I show below my code ro add fonts to windows OS. I am using WIN2K/98
*-- Add font to windows to print reports
#define HWND_BROADCAST 65535
#define WM_FONTCHANGE 29
Declare INTEGER CreateScalableFontResource IN GDI32.DLL ;
INTEGER fHidden, ;
STRING @lpszResourceFile, ;
STRING @lpszFontFile, ;
STRING @lpszCurrentPath
Declare Integer AddFontResource in gdi32 ;
String lpFileName
DECLARE INTEGER SendMessage IN user32 ;
INTEGER hWnd,;
INTEGER Msg,;
INTEGER wParam,;
INTEGER lParam
if adir(aFonts,[c:\temp\fonts\*.ttf]) > 0
*-- Add font to windows system
for i = 1 to alen(aFonts,1)
copy file ([c:\temp\fonts\]+aFonts[i,1]) to ([c:\windows\fonts\]+aFonts[i,1])
if file([c:\windows\fonts\]+juststem(aFonts[i,1])+[.fot])
delete file ([c:\windows\fonts\]+juststem(aFonts[i,1])+[.fot])
endif
= CreateScalableFontResource(0,[c:\windows\fonts\]+juststem(aFonts[i,1])+[.fot],[c:\temp\fonts\]+aFonts[i,1],[c:\windows\fonts])
= AddFontResource([c:\temp\fonts\]+aFonts[i,1])
= SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
endfor
endif
*-- Make key to registry to permenent install fonts here
*-- Reboot the windows OS here
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only