Java: How to determine which fontconfig file my system uses?

I am trying to debug a font related issue in a third-party Java application. In particular, ChemAxon JChem. I consulted this guide: http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html

Part of the problem is that I'm not sure which fontconfig.properties.src file is currently referencing my Java setup.

Here are my fontconfig files:

$ ls fontconfig*src 
fontconfig.Fedora.properties.src  fontconfig.properties.src   
fontconfig.SuSE.properties.src  fontconfig.Ubuntu.properties.src

My system is a CentOS system, so I guess it will probably either go to the default fontconfig.properties.srcfile or the file fontconfig.Fedora.properties.src, since CentOS and Fedora are both sourced from Red Hat.

So, can I finally determine which fontconfigfile my system uses?

Thank,

-John David

+3
5

, lsof,

lsof -r | grep fontconfig
0

strace, , :

$ strace -f -e open java ... 2>&1 | grep fontconfig
[pid  3321] open("/usr/java/jdk1.7.0_55/jre/lib/fontconfig.RedHat.6.bfc", O_RDONLY|O_LARGEFILE) = 115

, , , fonctconfig. :

[pid  3259] open("/usr/java/jdk1.7.0_55/jre/lib/i386/xawt/libfontconfig.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3259] open("/usr/java/jdk1.7.0_55/jre/lib/i386/xawt/../libfontconfig.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3259] open("/usr/java/jdk1.7.0_55/bin/../lib/i386/jli/libfontconfig.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3259] open("/usr/lib/libfontconfig.so.1", O_RDONLY) = 116
0

JRE sun.awt.FontConfiguration , .

  • Java -Dsun.java2d.debugfonts=true
  • jre/lib/logging.properties

java.util.logging.ConsoleHandler.level = ALL

sun.awt.FontConfiguration.level = ALL

And you will see a line like this in your stderr (for some reason logger uses stderr)

CONFIG: Read logical font configuration from /your/path/jre/lib/fontconfig.RedHat.6.bfc
0
source

You can use the above parameters, but with JDK 7 and 8 there is a problem with the JDK, the fontconfig file is not matched for any Linux operating system. Its default is libfontconfig, which is present on the OS.

Here is the defect URL http://bugs.java.com/view_bug.do?bug_id=7175487

0
source

Source: https://habr.com/ru/post/1740044/


All Articles