Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8281327

JavaFX does not support fonts installed per-user on Windows 10/11

XMLWordPrintable

    • b05
    • generic
    • windows

        A DESCRIPTION OF THE PROBLEM :
        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.


        FREQUENCY : always


              jpereda Jose Pereda
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: