Skip to content

webgl text() fails to render new glyphs on second call in v0.8.0 #3695

Closed
@jwdunn1

Description

@jwdunn1

Nature of issue?

  • Found a bug

Most appropriate sub-area of p5.js?

  • Typography
  • WebGL

Which platform were you using when you encountered this?

  • Mobile/Tablet (touch devices)
  • Desktop/Laptop

Details about the bug:

  • p5.js version: v0.8.0

  • OS and Web browsers:
    Windows 7x64:
    Chrome 73.0.3683.103
    Chrome 75.0.3764.0
    Firefox 66.0.3
    Firefox 67.0b10
    Opera 60.0.3255.27
    Android 7:
    Chrome 73.0.3683.90
    iOS 12.1.4:
    Chrome 73.0.3683.68
    Safari 12

  • Steps to reproduce:
    Expected additional calls to text() to draw new glyphs.
    Below is a minimal sketch that reproduces the issue.
    Conditions are: webgl, additional calls to text(), different glyphs than first call, any browser
    Sketch on OpenProcessing:
    https://www.openprocessing.org/sketch/698922
    (Note: this was working in v0.7.3 For comparison, if p5 v0.7.3 is selected, the sketch works as expected and both the "A" and "B" glyphs are correctly rendered.)

No console errors.

function preload() {
  f = loadFont('inconsolata.otf');
}

function setup() {
  createCanvas(100, 100, WEBGL);
  textFont(f);
  textSize(40);
}

function draw() {
  background(100);
  text("A", -30, 0);
	
  // this next call to text() 
  // does not display in v0.8.0
  text("B", 10, 0);
  // Note: if the same glyphs as the first instance
  // are used, it will work.
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions