I am trying to export text to a PDF file, but all I get are little blocks of white, gray, or black, instead of the actual letterforms. (It looks like all the letters have been obscured, as in a confidential government document released to the public.) I am sure I'm missing something obvious, and would appreciate your suggestions. Here's my story. I'm using OS X 10.5.2.
I started out trying beginRecord(), and have also tried beginRaw(), and createGraphics(), all with the same issue. I see this bug for createGraphics():
http://dev.processing.org/bugs/show_bug.cgi?id=641
...which would explain the problem I'm seeing, but I don't think that affects the other two methods.
I started out using a .vlw font file:
Code:font = loadFont("Monaco-24.vlw");
Then, thinking that it would be better to use outlines rather than the bitmapped VLW format, I tried using a native font:
Code:hint(ENABLE_NATIVE_FONTS);
font = loadFont("Monaco.ttf");
This gives me an error: "Could not load font Monaco.ttf. Make sure that the font has been copied to the data folder of your sketch." Of course, I have verified that the TTF file is in the data folder, so I'm not sure why it can't find it.
Then, I tried using createFont():
Code:hint(ENABLE_NATIVE_FONTS);
font = createFont("Monaco.ttf", 24);
This does not give an error, but simply hangs the applet.
Also, this note in the PDF library seems relevant:
Quote:Starting in release 0120, text is no longer treated as shape data by default, meaning that the font will need to be installed to view the PDF that's created. The upside is that the PDF will render better (particularly in light of the Mac OS X bug noted here). To force text to be treated as shape data, use textMode(SHAPE), immediately after size(). See the developer reference for textMode() inside PGraphicsPDF for more specifics.
...but when I use textMode(SHAPE), I get an error that SHAPE is not available with the P3D renderer. So I switch to OPENGL (fine for this project), and instead of little blocks in my PDF, I get a gray canvas with one diagonal gray line through it.
Thanks in advance for your thoughts!