views:

218

answers:

2

I'm getting a

java.awt.FontFormatException: Unrecognised Font Format

error, and I believe this has been happening only since performing the 10.5 java 4 update, though I can't verify that to be exact. My java version after the update is 1.5.0_19

I'm using jruby in rails to generate a font with the following code:

font = java.awt.Font.createFont(java.awt.Font::TRUETYPE_FONT, java.io.FileInputStream.new("#{RAILS_ROOT}/lib/Arial.ttf"))

The Arial.ttf is taken from my OSX fonts folder and it is obviously a TTF, so what is wrong?

Has anyone experienced any odd font issues after upgrading java? I don't know if I have to update jruby after updating java, but I can't imagine that's the case.

Any thoughts are appreciated.

A: 

Hi Brad,

Am experiencing the exact same problem :( no solution yet

+1  A: 

Hi Brad, I found a solution that worked for me. Apparently its a problem with user permissions. In my case the problem occurred when starting up my weblogic server. I was running Weblogic as root, but my font file was owned by a system user. Changing the permissions of the file did not solve my problem, but changing the ownership of Weblogic itself did. So if I run my server with the same user that owns the font file, the problem magically disappeared.

I guess the update solved some security or ownership issues that introduced a new problem. Hope the solution to my problem helps you find the cause of yours.

good luck

Siets

that's interesting. I'm glad at least that I'm not alone. Unfortunately for me, I am already running my jruby rails app server as the user that owns the TTF file :(
brad
scratch that, Completely forgot I'm running jruby as sudo to access rdebug. Running it normally fixed the problem. Good find!
brad