FontGet icon indicating copy to clipboard operation
FontGet copied to clipboard

Per-user installs on Windows are lost after reboot (no HKCU Fonts registry value)

Open avodahrwx opened this issue 1 month ago • 1 comments

On Windows, fonts installed with the default user scope disappear from applications after a reboot, although the files remain in %LOCALAPPDATA%\Microsoft\Windows\Fonts.

Cause. internal/platform/windows.go copies the file and calls AddFontResource, but writes the Fonts registry value only if scope == MachineScope, under HKEY_LOCAL_MACHINE. A per-user font is only persistent when it has a value under HKCU\Software\Microsoft\Windows NT\CurrentVersion\Fonts (name <Face> (TrueType), value the full path of the file). AddFontResource registrations last only for the current session (Font Installation and Deletion), so the font works until the next sign-in and then is gone.

Repro

  1. Install any font with FontGet at user scope.
  2. Confirm it shows in an app.
  3. Reboot.
  4. The file is still in %LOCALAPPDATA%\Microsoft\Windows\Fonts, but no app lists the font, and HKCU\...\Fonts has no value for it.

Suggested fix. For user scope, write the value under HKCU with the full path (HKLM values are bare file names), and remove it when the font is removed. oh-my-posh does this in src/cli/font/install_windows.go, and the scoop nerd-fonts bucket in its installer scripts.

Environment: Windows 11, FontGet v2.7.0.

avodahrwx avatar Oct 23 '26 16:10 avodahrwx

Hey @simsrw73 thanks for catching this. Totally slipped past me because my windows test box never got rebooted, so the fonts kept looking fine until I dug into what you described.

This is fixed on main now. It’ll go out in the next release.

Thanks for writing up the issue so clearly.

Graphixa avatar Nov 15 '26 10:11 Graphixa