We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsSoftware Bugs › New Font issues with 117
Page Index Toggle Pages: 1
New Font issues with 117 (Read 1960 times)
New Font issues with 117
Oct 1st, 2006, 7:17pm
 
Hi there I have a complicated program that ivolves exporting PDF's with text in them. Now with the new 117 version I am having problems. I tried using the hint(ENABLE_NATIVE_FONTS) but i can't seem to make it work nicely. I just wrote here a little program to illustrate my issue. I get really jaggy nasty outlines or even solid black blocks:


import processing.pdf.*;

PFont myFont;
boolean record;


void setup() {
 size(400, 400);

 hint(ENABLE_NATIVE_FONTS);
 myFont = createFont("FFScala", 32);


}

void draw() {
 if (record) {
   // note that #### will be replaced with the frame number. fancy!
   beginRecord(PDF, "frame-####.pdf");
 }

 textFont(myFont, 70);
 text("!@#$%", 10, 50);

 if (record) {
   endRecord();
 }
}

// use a keypress so a million files aren't created
void mousePressed() {
 record = true;
}
Re: New Font issues with 117
Reply #1 - Oct 1st, 2006, 11:13pm
 
from a ways down in revisions.txt:

Caveats with PDF rendering:

+ use createFont() with a truetype font (some opentype also work) to
 make fonts work properly. any font that shows up in PFont.list()
 should work. if you don't use createFont(), they'll likely show up
 bitmappy and gross like images. the shape of the characters may be
 weird in some cases, there seems to be a java bug with cubic vs.
 quadric splines. looking into a workaround if necessary.

i'll get this added to the pdf reference as well.
Re: New Font issues with 117
Reply #2 - Oct 2nd, 2006, 10:05am
 
Hi Fry,
Thanks for getting back to me but I am still confused.

I used a font from the PFont.list() "HelveticaNeue" in my case its a TTF but I am still getting ugly screen and PDF output. What am I doing wrong?

I am on Intel Mac
Re: New Font issues with 117
Reply #3 - Oct 3rd, 2006, 9:42pm
 
use an actual ttf file, and put it in the data folder of your sketch.

seems that something has broken with native fonts in java 1.5. you can also try switching to the java 1.4 vm as your default. i'm not sure whether this is 1) apple's bug, 2) sun's bug or 3) something new that they decided to enforce, and therefore our bug.
Re: New Font issues with 117
Reply #4 - Oct 6th, 2006, 2:50am
 
This is specific to Java 1.5 on Mac OS X. Switching back to Java 1.4 as your default will prevent the bug, as will using a .TTF file. I've filed a bug in the bugs db so that we can track this, and have also just filed a bug with Apple.

http://dev.processing.org/bugs/show_bug.cgi?id=407

(Closing this thread, follow-up can happen at the bug report)
Page Index Toggle Pages: 1