a place in the sun

about Sun, Solaris 10 and Java Workstation w2100z -- Posts with "sunshine" in titles will praise SUNW, Solaris 10 or w2100z. Posts with "sunspot" will complain. Other posts will fall somewhere in-between.

Home   Atom Feed

2005-06-13

sunspot - Java2D font locator

IDEA 4.5 Java IDE would dump core when looking up fonts. Symptom: try changing choice of fonts. IDEA would popup a box and go through lots of fonts and crash. This was not IDEA's fault -- JVM (java full version "1.4.2_06-b03") dumped core with a message like Assertion failed ../../../src/share/native/sun/awt/font/t2k/t1.c, line 2178. If you really want to find out what font is messing up with Java2D, export JAVA2D_DEBUGFONTS=1 and watch the debug output. It turns out that Java2D on Solaris is dumb: it reads every font file listed in /var/sadm/install/contents then chokes on the first offending font it sees. You can sorta workaround this braino by boxing Java2D:
JAVA_FONTS=../jre/lib/fonts
export JAVA_FONTS
exec $IDEA_JRE/java -Djava.awt.fonts=../jre/lib/fonts -Djava2d.font.usePlatformFont=false ...
but this is annoying and prone to error. I just grep'ed the offending font from /var/sadm/install/contents and found it to be a TeX font. Because I never use TeX, it was simpler and faster to just pkgrm SFWtetex and move on.

At 23:10 by Jay


Post a Comment

This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.

Jay Han