30

Formerly I copied a ttf-file to C:\Windows\Fonts, clicked the file to display the font, then clicked on [Install] and everything was fine.

When I do this procedure now, the font is not installed in C:\Windows\Fonts, but in C:\Users\MyName\AppData\Local\Microsoft\Windows\Fonts - to the effect that when I do a GraphicsEnvironment.getAvailableFontFamilyNames() in java, the font is not found.

On my PC there are currently 184 fonts installed, a number which I do not deem to cause the problem.

Nigel Thorne
  • 21,158
  • 3
  • 35
  • 51
Jörg
  • 499
  • 1
  • 5
  • 10
  • Use the [AddFontResourceExW function](https://learn.microsoft.com/en-us/windows/desktop/api/wingdi/nf-wingdi-addfontresourceexw) from GDI32 to install a font and later [RemoveFontResourceEx](https://learn.microsoft.com/en-us/windows/desktop/api/wingdi/nf-wingdi-removefontresourceexa) to remove the font if you don't need it any longer. – magicandre1981 Mar 20 '19 at 16:20
  • Thanks for your response, magicandre1981, yet I want install the font not programmatically, but manually as a Windows user. Applying native code in a java programme breaks its platform independence. – Jörg Mar 20 '19 at 16:52
  • ok, tagging it as java means you want API/coding help. Ask it on superuser.com – magicandre1981 Mar 21 '19 at 15:52
  • Previously in the font previewer the 'Install' button had a shield icon and would install for all users. Now via this route it only installs for the current user. – Jake Nov 11 '21 at 01:38

3 Answers3

40

You just need to right click on your font file and select install font for all user.

enter image description here

It will be visible in every apps then.

Abdul.Moqueet
  • 902
  • 12
  • 19
  • 1
    make sure, that the windows-font-preview application is the default for .ttf-files. Otherwise, it is not in the right click options. (I had IrfanView installed and set up for ttf - and it drove me crazy, why I don't have it) – otori Apr 07 '20 at 14:35
  • If you don't see the menu item "Install for all users", you may be viewing a font file within a zip archive. First, extract the font file from the zip archive. – Flimm Jan 01 '21 at 09:14
  • It would be nice if Microsoft maintained existing functionality when they add new features (like the option to install for current or all users), but that is too much to expect given the standards of their QA. It is no longer possible to install a font for all users from the previewer; one has to go back to the font file. Does anyone at Microsoft know about UX? – Jake Nov 11 '21 at 01:40
7

In the C:\Users\MyName\AppData\Local\Microsoft\Windows\Fonts directory right click on your font file and choose "Install for all users" (translated). A prompt will show up, telling that the font is already installed. Still click "Yes". The font will then be copied to %WINDIR%/Fonts.

One might think that the font file in C:\Users\MyName\AppData\Local\Microsoft\Windows\Fonts is not needed any more and can be deleted. But when you try, a message pops up, telling that the action could not be finished as the file is opened in System. - So we just have another copy of the file.

Jörg
  • 499
  • 1
  • 5
  • 10
  • I don't get the prompt that the font is already installed if I try to install for all users after having inadvertently only installed for the current user. But I have no doubt this was a bug at your time of writing. – Jake Nov 11 '21 at 01:48
  • Looking today (2½ years after my above question) at the given path ( C:\Users\MyName\...\Fonts), I see only those few fonts which I additionally installed, but none of the system fonts. At least the installation of a new font goes right into this directory and there was no need to "install for all users". – Jörg Nov 12 '21 at 18:31
3

To get rid of the *.pfb, *.pfm and *.ttf files in C:\Users\MyName\AppData\Local\Microsoft\Windows\Fonts go to the registry and remove all references to them in "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts" and "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Type 1 Installer". Then reboot. Then you can delete those files.

  • This does not seem to address the problem of an installed front not being visible to a Java runtime. – greybeard Mar 18 '20 at 18:01
  • Yes, but it does answer how to delete an unnecessary second font file, which I mentioned in my own answer. Thank you, Whiterabbit. – Jörg Mar 20 '20 at 08:36