我正在尝试调试第三方Java应用程序中与字体有关的问题。具体而言,ChemAxon JChem。我一直在咨询本指南:
http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html

问题的一部分是,我不确定我的Java设置当前正在引用哪个fontconfig.properties.src文件。

这是我的fontconfig文件:

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

我的系统是CentOS系统,所以我想它可能是在默认的fontconfig.properties.src文件或fontconfig.Fedora.properties.src文件中使用,因为CentOS和Fedora都来自Red Hat。

那么,我可以确定地说我的系统正在使用哪个fontconfig文件吗?

谢谢,

-约翰·戴维

最佳答案

JRE类sun.awt.FontConfiguration已经为此进行了日志记录,您只需要启用它即可。

  • 将此选项添加到Java -Dsun.java2d.debugfonts=true
  • 编辑jre/lib/logging.properties

  • 更改此行
    java.util.logging.ConsoleHandler.level = ALL
    

    添加此行
    sun.awt.FontConfiguration.level = ALL
    

    然后,您将在stderr中看到这样的一行(记录器出于某种原因使用stderr)
    CONFIG: Read logical font configuration from /your/path/jre/lib/fontconfig.RedHat.6.bfc
    

    09-27 05:30