OpenJFX is not using FontConfig

Fabian Keller mail at
Wed Jan 8 15:30:19 UTC 2020

I'm currently investigating a problem where openjfx is not using
FontConfig on a CentOS machine.

Error message:
Loading FontFactory com.sun.javafx.font.freetype.FTFactory
Subpixel: enabled
Freetype2 Loaded (version 2.8.0)
LCD support Disabled
Fallback fontDir is /root/jdk-11.0.5+10/lib/fonts exists = false null/ (No such file
or directory)
Fall back to opening the files
Not using FontConfig
Fontconfig returned no font for sans:regular:roman

I'm using openjfx bundled with my application in a fat jar.
(dependencies javafx-base, javafx-web, javafx-swing) (Tested openjfx
versions: 11, 11.0.1, 13, 13.0.1)
The jar is working without any problems on two different machines, one
with a fresh installation of CentOS 7.4 with Gnome.
On other existing machines (CentOS 7.4) i see the error above,
terminating with jvm core dump due to no available fonts.
I tested the behaviour with two jdk distributions from adoptopenjdk
(OpenJDK11U-jdk_x64_linux_hotspot_11.0.5_10) and Bellsoft

FontConfig seem's to work properly
# fc-match sans.regular
DejaVuSans.ttf: "DejaVu Sans" "Book"
# fc-match sans:regular:roman
DejaVuSans.ttf: "DejaVu Sans" "Book"

The jvm command line i used:
java -Dprism.useFontConfig=true -Dprism.debugfonts=true
-Dprism.verbose=true -cp nalf.jar de.dummy.Main

I took a look at the source which produces the line "Not using FontConfig":

If I read correctly the only case where this output can happen is if
'useFontConfig' is false.

The only assignment of 'useFontConfig' is here:

useFontConfig should only be false if the property
'prism.useFontConfig' is not equals 'true'. But I set it explicitly to
"true" (default should also be true).

Does anybody have a clue, what's the problem or has anybody an idea
how to debug this further?

Best regards
Fabian Keller

More information about the openjfx-dev mailing list