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

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

Can’t see any text in either picture.

my text is the “=” figure

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

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”?

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

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

1 Like

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 );
}

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