Using another text renderer

I guess this is how to do proper font rendering in P2D.
(This will be slow)



PGraphics pg;

void setup() {
  size(200, 200, P2D);
  pixelDensity(2);
  
  textSize(120);

  
  pg = createGraphics(1200, 200);
  pg.beginDraw();
  pg.clear();
  pg.fill(255);
  pg.textSize(60);
  pg.textAlign(LEFT, TOP);
  pg.text("The quick brown fox", 0, 0);
  pg.endDraw();
  
}

void draw() {
  background(0);  
  
  
  float s = 0.16;
  image(pg, 10, 10, pg.width * s, pg.height * s);
  
  fill(255);
  textSize(9);
  textAlign(LEFT, TOP);
  text("The quick brown fox", 10, 25);
}
1 Like