Bug 45 : Create Font (tool) and createFont() doesn't work with some fonts
Last modified: 2008-12-18 08:54



Assigned To:

Attachment Type Created Size Actions

Description:   Opened: 2005-05-31 16:45
it's not clear where this showed up, but many fonts don't show up in the
create font dialog, and createFont() or loadFont() doesn't work with some
fonts. PFont.list() leaves these fonts out too.

this is a Java problem, unfortunately, as it appears that some fonts are
simply not supported with Java because they use their own font renderer.

it appears to be happening with opentype fonts especially, and in
partiular, may be CFF fonts specifically (which would mean most of adobe's
ot font folio).

haven't yet found any information on sun's site or elsewhere about exactly
what's going on.
Additional Comment #1 From backspaces 2006-03-28 16:02
Just ran into this myself on Mac OS X. I tried using a font that showed up in the Create
Font Tool. I chose AlBayan-24. Didn't show up in my program. So looked at some of the
text docs and copied & pasted one of the examples. Sure enough, the font I chose failed in
the example. Tried another, more common font, Arial-Black. Worked fine!

I wonder if there is a set of fonts we might recommend based on their success. BTW, when
I looked at the fonts themselves, it was pretty clear there was a problem just based on size:
-rw-r--r-- 1 owen owen 65499 Mar 28 16:53 Arial-Black-24.vlw
-rw-r--r-- 1 owen owen 2551 Mar 28 16:49 AlBayan-24.vlw
Maybe we could use suspicious font sizes to warn users?

Here's the code snippet:
size(100, 100, P3D);
PFont font;
// AlBayan-24.vlw Arial-Black-24.vlw
font = loadFont("Arial-Black-24.vlw"); //works
//font = loadFont("AlBayan-24.vlw"); //doesn't work
text("word", 15, 60, -30);
fill(0, 102, 153);
text("word", 15, 60);
Additional Comment #2 From fry 2006-03-28 16:33
that may actually be one of two separate issues that have to do with how
java handles font encodings.

1) did you try exporting the font with the "all characters" option set? is
the font a roman font, or something else? if something else (as i suspect
from the name), then you'll need to use "all characters".

2) unfortunately even when 'all chars' is set, i've had trouble with some
fonts with weird encodings (i.e. adobe's "sonata" font) but that's another

this bug refers more to the fact that fonts don't show up in the menu, and
the only available fonts are those from PFont.list() (or the list in the
create font dialog).
Additional Comment #3 From fry 2008-06-24 13:23
these problems should be ironed out for 0142, though this bug report is a
mix of a handful of problems, so it's not clear.

closing this bug for now. if you have further problems, file a new bug with
an exact description.
Additional Comment #4 From fry 2008-12-18 08:53
This bug should not have been closed--it's still the case that not all
fonts can be specified, and it's a Java implementation issue. The other
comments on this bug refer to other, unrelated problems. See the original
bug description (comment #0) for details.
Additional Comment #5 From fry 2008-12-18 08:54
*** Bug 1104 has been marked as a duplicate of this bug. ***