OpenJFX is not using FontConfig

Philip Race philip.race at oracle.com
Wed Jan 8 16:59:25 UTC 2020


Perhaps you could trace the process to see if we successfully load the 
shared library ?
Maybe we can't do that or can't initialise it for some reason.

But Centos 7.4 is the same as RH 7.4 and OL 7.4 so this is surprising.

Do you have the same fontconfig packages on working and non-working ?
For example do both (or neither) have the fontconfig-develop (or 
whatever it is called)
package as well as the runtime ?

What does a pure Java SE (java 2d) app do on the same machine ?
It also loads fontconfig to find fonts so does it succeed or does it 
fail too ?
Try an Oracle produced OpenJDK build to tet this.

-phil


On 1/8/20, 7:30 AM, Fabian Keller wrote:
> Hi,
> 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
> java.io.FileNotFoundException: null/allfonts.properties (No such file
> or directory)
> Fall back to opening the files
>   *** FONTCONFIG LOCATED FONTS:
> 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
> (bellsoft-jdk11.0.5+11).
>
> 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":
> https://github.com/openjdk/jfx/blob/master/modules/javafx.graphics/src/main/java/com/sun/javafx/font/FontConfigManager.java#L161
>
> If I read correctly the only case where this output can happen is if
> 'useFontConfig' is false.
>
> The only assignment of 'useFontConfig' is here:
> https://github.com/openjdk/jfx/blob/master/modules/javafx.graphics/src/main/java/com/sun/javafx/font/FontConfigManager.java#L52
>
> 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