Why is the text my text out of focus/in a poor resolution?

#1

My text in this button looks very poorly.
image

But when I click another button on the screen, it looks normal!
image

Here is my code:

void draw (){
  
  
  if (mode== INTRO){  // introskærm
  doIntroMode();
  }
  else if (mode==KASSE){       // kassespil
  doKasseMode();
  }
  else if (mode ==BUTIK){      // i butikken
  doButikMode();
  }
  else if (mode ==STUDY){      // læse op
  doStudyMode();
  }
  
  fill(0);
  textSize(200);
  text("=", 123,130 ); 
  
}
1 Like
#2

Can’t see any text in either picture.

#3

my text is the “=” figure

#4

Text looks better when using createFont in setup() with textFont(…

Also try textMode(SHAPE);

versus

textMode(MODEL);

it’s also different if you are in 2D or 3D

#5

I don’t quite understand. I have downloaded a font

PFont font;
void setup() {
  size(1250,800);
font = loadFont("skrift.vlw");
  textFont(font);
}
void draw (){
fill(0);
  textAlign(CENTER);
  textSize(200);
  text("=", 123,130 ); 
}

Where do you reckon I insert “createFont”?

#6

You obviously created the font file skrift.vlw through Processing - what font size did you use because you are displaying it at very large size (200)

1 Like
#7

I just wanted to make sure you have it. createFont is as good as loadFont

1 Like
#8

this looks good on my computer

PFont font;

void setup() {
  size(1250, 800);
  font = createFont("skrift.vlw", 200);
  textFont(font);
  smooth();
}

void draw () {
  background(255); 
  fill(0);
  textAlign(CENTER);
  textSize(200);
  text("=", 123, 130 );
}
#9

I believe the issue is because you are not calling background(255) as your first line in draw(). This is explained in the reference here:

It is common to call background() near the beginning of the draw() loop to clear the contents of the window, as shown in the first example above. Since pixels drawn to the window are cumulative, omitting background() may result in unintended results.

Kf

3 Likes