See JDK-8218914:

Starting from build 17704, Windows 10 supports per-user font installation
> (see
> https://blogs.windows.com/windowsexperience/2018/06/27/announcing-windows-10-insider-preview-build-17704/#SgtQaWxPhRKl3mHR.97).
> This installation method actually becomes default, while 'Install for all
> users' action does it now the old (system-wide) way.
> JRE currently doesn't recognize fonts installed in the new way. In
> particular, GraphicsEnvironment.getAllFonts() doesn't list them, and such
> fonts cannot be used by passing their name to Font constructor.


Starting with Java 13, java.awt.GraphicsEnvironment::getAllFonts() can
correctly find the font installed for the current user on Windows 10/11,
but javafx.scene.text.Font is not yet supported.

I checked the source code of OpenJFX and found that
PrismFontFactory::getPlatformFontDirs() tried to distinguish between the
system font folder and the user font folder.

But unfortunately, PrismFontFactory::getFontPath() (
https://github.com/openjdk/jfx/blob/717cfdc85817aee57d5326e592340c849382d7a4/modules/javafx.graphics/src/main/native-font/fontpath.c#L68)
doesn't seem to work properly. It always seems to find the same folder on
windows.

I didn't see the corresponding issue on JBS, and I don't have a JBS
account. If you need to open an issue for this problem, please do it for
me, thanks.

Reply via email to