Bug 711 : font display differs depending on when loadFont is executed
Last modified: 2008-01-11 12:47




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

 

Reporter:
vertikalist
Assigned To:
fry

Attachment Type Created Size Actions
screen shot of wrongly rendered font image/png 2008-01-11 12:43 24.74 KB

Description:   Opened: 2008-01-11 12:41
Strange observation, if a font is loaded in a method free processing code,
the fonts are displayed correctly. If fonts are loaded within a draw
method, they look screwed. This happens with Processing: 0135Beta on Mac OS
X 10.4, fully patched to 10.4.11

Code example - bad looking font:

void setup() {
size(200, 100);
background(102);
}

void draw(){
PFont fontA = loadFont("Bauhaus93-32.vlw");
textFont(fontA, 32);
fill(0);
text("Bauhaus", 30, 60);
}


Code example - ok looking font:
size(200, 100);
background(102);

PFont fontA = loadFont("Bauhaus93-32.vlw");
textFont(fontA, 32);
fill(0);
text("Bauhaus", 30, 60);
Additional Comment #1 From vertikalist 2008-01-11 12:43
edit]
screen shot of wrongly rendered font
Additional Comment #2 From fry 2008-01-11 12:47
that's because you're drawing the text over itself repeatedly, and the
background is not being cleared. so eventually the pixels on the outer edge
that have transparency are accumulating to make things look crappy.

also, *do not* use loadFont() inside draw(), it will slow down your sketch
considerably as it will reload the font on each frame.