问题
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.
回答1:
You just need to right click on your font file and select install font for all user.
It will be visible in every apps then.
回答2:
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.
回答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.
来源:https://stackoverflow.com/questions/55264642/how-to-force-win10-to-install-fonts-in-c-windows-fonts