Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Install Fonts.
#1
How would you go about installing fonts with QM and replace any existing with the new file.

Thanks,
Jimmy Vig
#2
MSDN:

Font Installation and Deletion
AddFontResource
#3
Tried
int i=AddFontResource("\\APT62005\actapps\workstation files\newstribworkstations\all\FONTS\8514FIX.FON")
out i

Outputs "1" but does not install font.
#4
The "AddFontResource" command did not apply so I did the following:

Function font_install_example
Code:
Copy      Help
str font_temp.expandpath("$Cache$\Calibri.ttf");;font_path

;single_font
str font_install=
;$FONTS = 0x14
;$objShell = New-Object -ComObject Shell.Application
;$objFolder = $objShell.Namespace($FONTS)
;$objFolder.CopyHere("FONT_TEMP_PATH")


;folder in fonts
;str font_install=
;;$FONTS = 0x14;
;;
;;$FromPath = FONT_TEMP_PATH
;;
;;$ObjShell = New-Object -ComObject Shell.Application;
;;$ObjFolder = $ObjShell.Namespace($FONTS);
;;
;;$CopyOptions = 4 + 16;
;;$CopyFlag = [String]::Format("{0:x}", $CopyOptions);
;;
;;foreach($File in $(Get-ChildItem -Path $FromPath)){
;;;;;;If (Test-Path "c:\windows\fonts\$($File.name)")
;;;;;;{ }
;;;;;;Else
;;;;;;{
;;;;;;;;;;$CopyFlag = [String]::Format("{0:x}", $CopyOptions);
;;;;;;;;;;$ObjFolder.CopyHere($File.fullname, $CopyOptions);
;;
;;;;;;;;;;New-ItemProperty -Name $File.fullname -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts" -PropertyType string -Value $File
;;;;;;}
;;}
;
;
font_install.findreplace("FONT_TEMP_PATH" font_temp)



if(!FileExists("$fonts$\Calibri.ttf"))
,sub.font_Export
,if(FileExists(font_temp))
,,PsCmd font_install



#sub font_Export

#if EXE=1
#exe addfile "$desktop$\Calibri.ttf" 23
_s.expandpath(F"$Cache$\Calibri.ttf")
if !FileExists(_s)
,ExeExtractFile(23 _s)
#endif
ret 1


Forum Jump:


Users browsing this thread: 1 Guest(s)