<div dir="ltr"><div><div><div><div>Hi,<br><br></div>I remember we had similar problems with a missing libfontconfig library an AIX and Neil Richards fixed that issue:<br><br><a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7068471">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7068471</a><br>
<br></div>As far as I remember it was still reasonable in that context to continue even without libfontfonfig so please avoid linking against libfontconfig if possible or otherwise check with the colleagues from IBM if that really covers all use cases.<br>
<br></div>Thanks,<br></div>Volker<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 5, 2013 at 12:29 AM, Phil Race <span dir="ltr"><<a href="mailto:philip.race@oracle.com" target="_blank">philip.race@oracle.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Jeremy,<br>
<br>
Why didn't it return any fonts ? Is this because the libfontconfig library isn't installed ?<br>
<br>
We've been runtime loading that lib but these days could potentially<br>
switch to linking against it at compile time, in which case you won't<br>
even get this far. So in other words this could be a system config issue.<br>
The most common thing I've seen is that 64 bit Linux doesn't have<br>
all the libs to run a 32 bit JRE. You probably found and fixed all of those<br>
because it was Unsatisfiedlinkerror or similar but the runtime linking<br>
is disguising that its really the same problem.<br>
<br>
If you really don't have any fonts installed, then that's also<br>
a missing package and we perhaps should have a better diagnostic,<br>
but there isn't really any point in continuing anyway without any fonts.<br>
Even headless applications may require fonts.<br>
<br>
-phil.<div class="im"><br>
<br>
On 6/4/2013 2:50 PM, Jeremy Manson wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi folks,<br>
<br>
I encountered a NullPointerException in the above method, when fontconfig doesn't return any fonts:<br>
<br>
<a href="http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/7eae7c89dab4/src/solaris/classes/sun/awt/X11FontManager.java" target="_blank">http://hg.openjdk.java.net/<u></u>jdk8/jdk8/jdk/file/<u></u>7eae7c89dab4/src/solaris/<u></u>classes/sun/awt/<u></u>X11FontManager.java</a><br>
<br>
Line 779. The issue is that FontConfigManager sets fontConfigFonts to null when Fontconfig doesn't return any fonts:<br>
<br>
<a href="http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/7eae7c89dab4/src/solaris/classes/sun/font/FontConfigManager.java" target="_blank">http://hg.openjdk.java.net/<u></u>jdk8/jdk8/jdk/file/<u></u>7eae7c89dab4/src/solaris/<u></u>classes/sun/font/<u></u>FontConfigManager.java</a><br>
<br>
Line 218.<br>
<br>
The solution I came up with is to initialize fontConfigFonts with a zero-element array in this case:<br>
<br>
diff --git a/src/solaris/classes/sun/<u></u>font/FontConfigManager.java b/src/solaris/classes/sun/<u></u>font/FontConfigManager.java<br>
--- a/src/solaris/classes/sun/<u></u>font/FontConfigManager.java<br>
+++ b/src/solaris/classes/sun/<u></u>font/FontConfigManager.java<br>
@@ -216,6 +216,7 @@<br>
</div><a href="http://logger.info" target="_blank">logger.info</a> <<a href="http://logger.info" target="_blank">http://logger.info</a>>("<u></u>Fontconfig returned no fonts at all.");<div class="im"><br>
}<br>
fontConfigFailed = true;<br>
+ fontConfigFonts = new FcCompFont[0];<br>
return;<br>
} else if (fontConfigFailed) {<br>
for (int i = 0; i< fontArr.length; i++) {<br>
<br>
Thanks for your attention!<br>
<br>
Jeremy<br>
</div></blockquote>
<br>
</blockquote></div><br></div>