* Re: Java fontconfig issues
2019-11-28 23:50 ` Björn Höfling
@ 2019-11-30 23:53 ` Björn Höfling
0 siblings, 0 replies; 3+ messages in thread
From: Björn Höfling @ 2019-11-30 23:53 UTC (permalink / raw)
To: Jonathan Frederickson; +Cc: help-guix
[-- Attachment #1: Type: text/plain, Size: 13749 bytes --]
Some more analysis:
Creating a simple logger file:
$ cat logging.properties
handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
Then debugging the font loading process:
In a Guix container with JDK11:
$ java -Dsun.java2d.debugfonts=true
-Djava.util.logging.config.file=logging.properties -cp . Main Nov 30, 2019 11:34:07 PM sun.awt.X11FontManager registerFontDir
INFO: ParseFontDir /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fonts
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration <init>
INFO: Creating standard Font Configuration
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.4.15.0-65-generic.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.4.15.0-65-generic.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.4.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.4.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.4.15.0-65-generic.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.4.15.0-65-generic.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.4.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.4.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findFontConfigFile
INFO: Did not find a fontconfig file.
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration <init>
INFO: Creating standard Font Configuration
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.4.15.0-65-generic.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.4.15.0-65-generic.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.4.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.4.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.Linux.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.4.15.0-65-generic.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.4.15.0-65-generic.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.4.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.4.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for text fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.properties
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findImpl
INFO: Looking for binary fontconfig file : /gnu/store/vpily8s5ad5ryb27p88mxprs5xv3m0vm-openjdk-11.28-jdk/lib/fontconfig.bfc
Nov 30, 2019 11:34:08 PM sun.awt.FontConfiguration findFontConfigFile
INFO: Did not find a fontconfig file.
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for sans:regular:roman
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for sans:bold:roman
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for sans:regular:italic
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for sans:bold:italic
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for serif:regular:roman
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for serif:bold:roman
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for serif:regular:italic
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for serif:bold:italic
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for monospace:regular:roman
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for monospace:bold:roman
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for monospace:regular:italic
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no font for monospace:bold:italic
Nov 30, 2019 11:34:09 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Fontconfig returned no fonts at all.
Nov 30, 2019 11:34:09 PM sun.font.FcFontConfiguration warning
WARNING: Failed to get info from libfontconfig
Nov 30, 2019 11:34:09 PM sun.font.FcFontConfiguration warning
WARNING: Failed to get info from libfontconfig
Exception in thread "main" java.lang.InternalError: java.lang.reflect.InvocationTargetException
at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
at java.desktop/sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:189)
at java.desktop/sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:223)
at java.desktop/sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:251)
at java.desktop/sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames(HeadlessGraphicsEnvironment.java:75)
at Main.main(Main.java:8)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84)
... 7 more
Caused by: java.lang.NullPointerException
at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:367)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:312)
at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)
... 12 more
In that same environment, if I add fontsconfig as a package, the same
error occours, but fontconfig finds fonts:
$ fc-list
/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/p052023l.pfb: URW Palladio L:style=Italic
/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/b018015l.pfb: URW Bookman L:style=Demi Bold
/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/n022004l.pfb: Nimbus Mono L:style=Bold
/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/n022023l.pfb: Nimbus Mono L:style=Regular Oblique
/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/c059013l.pfb: Century Schoolbook L:style=Roman
/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/n021024l.pfb: Nimbus Roman No9 L:style=Medium Italic
/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/b018012l.pfb: URW Bookman L:style=Light
/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/a010015l.pfb: URW Gothic L:style=Demi
/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/b018032l.pfb: URW Bookman L:style=Light Italic
/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/a010033l.pfb: URW Gothic L:style=Book Oblique
[..]
But in a container with icedtea@3: fonts are found:
Nov 30, 2019 11:41:16 PM sun.awt.X11FontManager registerFontDir
INFO: ParseFontDir /gnu/store/05flqf4bqwwj4zwl2vqiqg0dlb1alzm8-icedtea-3.7.0-jdk/jre/lib/fonts
Nov 30, 2019 11:41:16 PM sun.awt.FontConfiguration <init>
INFO: Creating standard Font Configuration
Nov 30, 2019 11:41:16 PM sun.awt.FontConfiguration <init>
INFO: Creating standard Font Configuration
Nov 30, 2019 11:41:17 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Time spent accessing fontconfig=563ms.
Nov 30, 2019 11:41:17 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font sans:regular:roman maps to family Nimbus Sans L in file /gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/n019003l.pfb
Nov 30, 2019 11:41:17 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=Nimbus Sans L Style=Regular Fullname=null File=/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/n019003l.pfb
Nov 30, 2019 11:41:17 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=Dingbats Style=Regular Fullname=null File=/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/d050000l.pfb
Nov 30, 2019 11:41:17 PM sun.font.FontConfigManager initFontConfigFonts
INFO: Family=Standard Symbols L Style=Regular Fullname=null File=/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/s050000l.pfb
Nov 30, 2019 11:41:17 PM sun.font.FontConfigManager initFontConfigFonts
INFO: FC font sans:bold:roman maps to family Nimbus Sans L in file /gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/n019004l.pfb
Nov 30, 2019 11:41:17 PM sun.font.FontConfigManager initFontConfigFonts
[...]
INFO: Registered file /gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/a010035l.pfb as font ** Type1 Font: Family=URW Gothic L Name=URW Gothic L Demi Oblique style=3 fileName=/gnu/store/8ppj83wc1mmrdydh9cy7vqvg0bym8l0q-gs-fonts-8.11/share/fonts/type1/ghostscript/a010035l.pfb rank=4
Century Schoolbook L
Dialog
DialogInput
Dingbats
Monospaced
Nimbus Mono L
Nimbus Roman No9 L
Nimbus Sans L
SansSerif
Serif
Standard Symbols L
URW Bookman L
URW Chancery L
URW Gothic L
URW Palladio L
Björn
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread