How to install True Type Fonts in Windows
Only for TrueType (.ttf) or OpenType (.otf) fonts. #Include <WinAPIEx.au3>
ConsoleWrite(_FontInstall('MyFont.ttf') & @CR)
Func _FontInstall($sFile)
Local $Font, $Name, $Path
$Name = _WinAPI_GetFontResourceInfo($sFile, 1)
If @error Then
Return SetError(1, 0, 0)
EndIf
$Name &= ' (TrueType)'
$Font = StringRegExpReplace($sFile, '^.*\\', '')
If Not RegWrite('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts', $Name, 'REG_SZ', $Font) Then
Return SetError(2, 0, 0)