Skip to content

[p5.js 2.0 Bug Report]: fonts don't render in WEBGL mode  #8078

@rofoto

Description

@rofoto

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.0.5

Web browser and version

firefox 142.0.1

Operating system

win 10

Steps to reproduce this

Steps:

  1. run the code in the snippet in p5js 2.0.5
  2. no text is drawn and WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts with glyph data are supported
    3.same code works pre 2.0 ( https://editor.p5js.org/lmccart/sketches/fXAu0pIYM )

Snippet:

let font;


async function setup() {
  font = await loadFont("Roboto-Bold.ttf");

  createCanvas(100, 100, WEBGL);
  textFont(font);
  textSize(width / 3);
  textAlign(CENTER, CENTER);
}
function draw() {
  background(0);
  let time = millis();
  rotateX(time / 1000);
  rotateZ(time / 1234);
  text('p5.js', 0, 0);
}

seems to be a regression based on closed report #3818 ( its an old report but its what google showed when searching for the error message )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions