Bug 407 : some fonts cannot be specified on Mac OS X with Java 1.5
Last modified: 2008-06-24 13:25




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
fry
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2006-10-05 17:49
There's a problem with Java 1.5 on Mac OS X that prevents some fonts from
being used on Mac OS X, even if they show up in PFont.list(). This isn't a
problem with Java 1.3 or 1.4, and it works OK with Windows Java 1.5, so it
appears to be a Mac OS X bug.

A bug has been filed with Apple (bug reporter #4769141), hopefully it's
something that will be fixed.

In the meantime, the workaround is to use createFont("filename.ttf") with a
font that's been added to the data folder of your sketch. Only .ttf or .otf
files will work in this situation.
Additional Comment #1 From JohnG 2006-10-17 08:40
I'm seeing the same on windows with 0118, except even the workaround
doesn't seem to be working. All fonts I've tried, both using
f=createFont("BKANT.TTF",32); and f=createFont("Book Antiqua",32); come out
bitmapped with each character on a black background. The font displays
correctly in the applet window, but the output PDF (using beginRecord) is
broken.

I tried the exact same sketch with 0114, and everything is fine.
Additional Comment #2 From fry 2006-10-17 21:33
you're using a valid TTF file with createFont(), and
hint(ENABLE_NATIVE_FONTS) and it's still not working?

in 0120 there are other fixes for this, but in the meantime, it should be
working if you follow the instructions.
Additional Comment #3 From mhuyck 2006-10-21 11:43
hint(ENABLE_NATIVE_FONTS) works great for me. Until I knew about that I was getting
exactly the symptoms described by JohnG. Thanks!
Additional Comment #4 From fry 2006-11-05 09:24
see notes added to the PDF section of the reference for 0120 regarding
other font issues.

this bug report is specific to a problem that is the fault of Apple's Java
implementation.

* for other font problems, please file a new bug *
Additional Comment #5 From fry 2006-11-05 09:25
This has been filed as bug #4769141, but Apple has not yet confirmed the
report. This is specific to Java 1.5 on Mac OS X, Java 1.4 on OS X, or 1.5
on Windows and Linux are not affected.
Additional Comment #6 From fry 2007-02-03 09:41
this affects both the creatFont() function and "Create Font" tool. for
instance, selecting a styled font in the create font tool, even though
listed, will not show the actual font.
Additional Comment #7 From fry 2008-06-24 13:25
Gave up on waiting for Apple to fix their bug, so i've implemented a
workaround for 0143.

For Mac OS X, using createFont() in code may cause a lag (on my machine
it's 150 ms with 800 fonts) or in some cases when using
hint(ENABLE_NATIVE_FONTS).