q5play
    Preparing search index...

    Function textFont

    • 📘 Sets the current font to be used for rendering text.

      By default, the font is set to the CSS font family "sans-serif" or the last font loaded.

      Parameters

      • fontName: string

        name of the font family or a FontFace object

      Returns void

      await Canvas(200, 160);
      background(0.8);

      textFont('serif');

      text('Hello, world!', -96, 10);
      await Canvas(200);
      background(0.8);

      textFont('monospace');

      text('Hello, world!', -96, 10);