Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8304024 | jfx17.0.7 | Johan Vos | P4 | Resolved | Fixed |
A DESCRIPTION OF THE PROBLEM :
SeeJDK-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.
FREQUENCY : always
See
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.
FREQUENCY : always
- backported by
-
JDK-8304024 JavaFX does not support fonts installed per-user on Windows 10/11
- Resolved
- relates to
-
JDK-8218914 Support fonts installed per-user on Windows 10
- Resolved
-
JDK-8255281 Support fonts installed per-user on Windows 10
- Closed
- links to
-
Commit openjdk/jfx17u/d165e5c6
-
Commit openjdk/jfx/f4ca00dd
-
Review openjdk/jfx17u/118
-
Review openjdk/jfx/1017
(2 links to)