How do I change the font that is used by a button in p5?

I am not sure how I can do this. I have tried all the style() properties that I know, but none of them are able to change the font on a button. Example code I am trying to write:

let drawButton;
let circle = false;

function setup() {
  txt = loadFont('assets/font.ttf');
  createCanvas(800, 800);

  drawButton = createButton('Draw');
  drawButton.position(230, 650);
  drawButton.size(350, 100);
  drawButton.mousePressed(yes);'background-color', 'black');'font-size', '44px');'color', 'white');

  //this code doesn't work the way I want it to'font-type', txt);

function yes() {
  circle = true

function draw() {
  if (circle === true) {
    ellipse(400, 400, 100, 100);

Is this p5 or css or…?

Maybe it’s…

I tried that and it didn’t work.

You also haven’t answered my question

It is p5. It says so in the tag for this question.

1 Like

Maybe you look here