>*-- 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 > >oreg = createobject('udf.registry') >cVersion = os(1) > >*-- Make key to registry to permenent install fonts >if type('oReg') = 'O' > do case > case 'Windows 4.' $ cVersion && Windows 9x > WITH oReg > .ClassKey = -2147483646 > .SecTionKey = [SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts] > IF .KeyExists > .ValueKey = [.VnArial (TrueType)] > .valuetype = 1 > .value = [VNARIAL.TTF] > .createkey > ... > endif > endwith > case ('Windows 5.' $ cVersion) or ('Windows NT' $ cVersion) && Windows 2000 > WITH oReg > .ClassKey = -2147483646 > .SecTionKey = [SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts] > IF .KeyExists > .ValueKey = [.VnArial (TrueType)] > .valuetype = 1 > .value = [VNARIAL.TTF] > .createkey > > ... > endif > endwith > endcase >endif > >oInfo = createobject('udf.getinfo') > >*-- Reboot the system >do case > case 'Windows 4.' $ cVersion && Windows 9x > = oInfo.rebootMachine9x() > case ('Windows 5.' $ cVersion) or ('Windows NT' $ cVersion) && Windows 2000 > = oInfo.rebootMachine2k() >endcase