Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: fonts
;Installing a font in Windows 95/98/ME ;---------------------------------------- ;Get path to font directory and copy font FontDir=RegQueryEx(@REGCURRENT,"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders[Fonts]","",1) FileCopy("myfont.ttf",FontDir,@FALSE) ;Register font FontKey=RegOpenKey(@REGMACHINE,"SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts") RegSetValue(FontKey,"[My Font (TrueType)]","myfont.ttf") RegCloseKey(FontKey) ;Add the font to the font system DllName=StrCat(DirWindows(1),"gdi32.dll") DllCall(DllName,WORD:"AddFontResourceA",lpstr:"myfont.ttf") ;Inform running apps about the new font IntControl(22,-1,29,0,0)
;Installing a font in Windows NT/2000/XP ;---------------------------------------- ;Get path to font directory and copy font FontDir=RegQueryEx(@REGCURRENT,"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders[Fonts]","",1) FileCopy("myfont.ttf",FontDir,@FALSE) ;Register font FontKey=RegOpenKey(@REGMACHINE,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts") RegSetValue(FontKey,"[My Font (TrueType)]","myfont.ttf") RegCloseKey(FontKey) ;Add the font to the font system DllName=StrCat(DirWindows(1),"gdi32.dll") DllCall(DllName,LONG:"AddFontResourceA",lpstr:"myfont.ttf") ;Inform running apps about the new font IntControl(22,-1,29,0,0)The last line is only needed if currently running applications should be informed about the font addition. All apps started after the installation will recognize the new font even without the IntControl call.
Apparently WordPad has a bug or something in it.
It is not the usual case to install a new font then expect running applications to honor it.
Article ID: W13399
Filename: Installing Fonts in Windows 95 - NT.txt
File Created: 2002:06:13:11:44:12
Last Updated: 2002:06:13:11:44:12