Slightly Off-topic: Fixed-width font detection

A customer of our applications reported a crash when he clicks the combobox
for choosing fonts. Upon click it scans all fonts known to Java whether they
seems to have fixed width or not. On his system a couple of strange fonts
(e.g. dymsmall.ttf) were installed causing the VM to crash when
fontMetrics.stringWidth is invoked (I can reproduce it on my XP machine).

The surprising thing is that if I open the font chooser in IDEA 8.1.4 (which
I'm using), it does NOT crash the VM. So my question is: how does IDEA
detect the fixed-width-fonts? Thanks in advance.

--
Best regards,
Thomas Singer
=============
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com

4 comments
Comment actions Permalink


The surprising thing is that if I open the font chooser in IDEA 8.1.4 (which
I'm using), it does NOT crash the VM. So my question is: how does IDEA
detect the fixed-width-fonts? Thanks in advance.


Let me ask a more general question.
We deploy some desktop Java applications (typically CPU-bound, parallel, symbolic computation), and suffer from occasional, unpredictable JVM crashes.
I've noticed that IDEA is much more crash-resistant, and I wonder if the Jetbrains team has some tips to share on what can cause JVM crashes and how to avoid them.

thanks in advance,

best, Francesco

0
Comment actions Permalink

First off, SmartSVN is the bomb! :)

I know this isn't too helpful, especially as I haven't looked myself either, but is there anything in the community edition source that might help?

0
Comment actions Permalink

Update: I've got other fonts which cause our application to crash, but now
also IDEA crashes when opening the font chooser.

Tom

0
Comment actions Permalink

This is known problem indeed (http://devnet.jetbrains.net/docs/DOC-172) and we generally have no solution for this other than uninstalling faulty fonts. List of the fonts that appear faulty may vary from JRE version so this most probably explains difference with your app.

0

Please sign in to leave a comment.