"Christoph Schneegans" <
chri...@schneegans.de> schrieb:
> Hallo allerseits!
>
> Wie kann man Fonts (etwa .ttf oder .otf) per Konsole installieren?
Mit oder ohne weitere Interaktion?
Kopiere die Dateien nach %SystemRoot%\Fonts\ und starte Windows neu.-)
Falls der Neustart stoert: oeffne dieses Verzeichnis in einem mit
Administrator-Privilegien laufenden Explorer.
> Wenn ich mich ausgehend von [HKEY_CLASSES_ROOT\.ttf] durch die Registry
> hangele, stoße ich irgendwann auf fontext.dll, und
%COMSPEC% /K ASSOC .ttf && FTYPE ttffile
Unter
[HKEY_CLASSES_ROOT\ttffile\Shell]
ist dummerweise kein Kontextmenueeintrag "Install" statisch definiert,
dessen Kommandozeile Du aufrufen koenntest.
Den dynamisch erzeugten Kontextmenueeintrag kannst Du aber per Skript
aufrufen; fuer ein Beispiel siehe
<
https://skanthak.homepage.t-online.de/autoplay.html>
> dumpbin /exports c:\windows\system32\fontext.dll
>
> aus Visual Studio liefert u.a. diese Ausgabe:
>
> ordinal hint RVA name
> 2 3 0001F3C0 InstallFontFile
>
> Bin ich da halbwegs auf dem richtigen Weg?
Auf dem Holzweg bzw. in der Sackgasse: FONTEXT.dll und deren
Schnittstellen sind nicht dokumentiert!
Fuehre folgende Kommandos aus und bewundere deren Ausgaben:
FINDSTR.exe /S /M "FontFile" "%ProgramFiles%\Windows Kits\*.lib"
FINDSTR.exe /S "AddFontFile nstallFontFile" "%ProgramFiles%\Windows Kits\*.?"
Damit kannst Du auf MSDN PrivateFontCollection::AddFontFile finden
<
https://msdn.microsoft.com/en-us/library/ms534992.aspx> ... und
wegen des Praefix "Private" gleich ignorieren.
ABER: neben PrivateFontCollection findest Du InstalledFontCollection
<
https://msdn.microsoft.com/en-us/library/ms534469.aspx>
mit folgendem zielfuehrenden Hinweis:
| Windows GDI+ clients should not use the InstalledFontCollection
| class to install a font to Windows. Instead, use the Windows
| Graphics Device Interface (GDI) AddFontResource function.
<
https://msdn.microsoft.com/en-us/library/dd183326.aspx>
| This function installs the font only for the current session.
| When the system restarts, the font will not be present. To have
| the font installed even after restarting the system, the font
| must be listed in the registry.
Weiteres siehe "Font Installation and Deletion"
<
https://msdn.microsoft.com/en-us/library/dd144833.aspx>
JFTR: beschwere Dich bei den VOLLIDIOTEN von Microsoft, die den
Begriff "Resource" hier missbrauchen!
Stefan
PS: Microsoft hat vor AEONEN mit diversen Produkten ein Programm
namens FONTINST.exe geliefert: das liest eine FONTINST.ini mit
den Namen der zu installierenden Dateien.