# Text in WEBGL crashes mobile browsers

**URL:** https://discourse.processing.org/t/text-in-webgl-crashes-mobile-browsers/17134
**Category:** p5.js
**Created:** [January 17, 2020, 8:20am UTC](https://discourse.processing.org/t/text-in-webgl-crashes-mobile-browsers/17134 "2020-01-17T08:20:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![0\_O\_W\_O\_0](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/0_o_w_o_0/32/7834_2.png) [@0\_O\_W\_O\_0](https://discourse.processing.org/u/0_O_W_O_0)
#### Post date: [January 17, 2020, 8:20am UTC](https://discourse.processing.org/t/text-in-webgl-crashes-mobile-browsers/17134/1 "2020-01-17T08:20:38Z")

</div>

hello,

first time p5js user here

i am trying to make a sketch display text in a 3D environment  
it works just fine on a computer browser, but on mobile devices it crashes the browser.

you can try it out here: [https://www.jacobremin.com/websynth/crash.html](https://www.jacobremin.com/websynth/crash.html)

i am pretty sure it is the text causing the crash, the sketch works fine on mobile if i take away the text part.

any tips?  
thanks!

code follows:

```auto
var boxSize, rotationSpeed;
var textBoxSize, fontSize;
var quote;

function preload() {
  cineType = loadFont('assets/fonts/GT-Cinetype-Regular.otf');
}

function setup() {

  createCanvas(windowWidth, windowHeight, WEBGL);
  fullscreen(true);

  boxSize = random(windowWidth/2,windowWidth);
  rotationSpeed = random(0.01,0.02);
 
  textFont(cineType);

}

function draw() {

    background(150);
    drawBox();
    displayText();

}

function displayText() {

  fill(0);
  rectMode(CENTER);
  textAlign(CENTER, CENTER);
  textSize(300);
  text("some text",0,0,width*0.9,height*0.9);

}

function drawBox() {

  var rotX = map (mouseX, 0, windowWidth, -1, 1);
  var rotY = map (mouseY, 0, windowHeight, -1, 1);
  push();
  rotateY(frameCount * 0.01 + rotX);
  rotateX(frameCount * 0.01 + rotY);

  strokeWeight(10);
  noFill();
  stroke(255);
  box(boxSize);
  pop();

}

```

---

<div class="post-metadata">

### Author: ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)
#### Post date: [January 21, 2020, 11:39pm UTC](https://discourse.processing.org/t/text-in-webgl-crashes-mobile-browsers/17134/2 "2020-01-21T23:39:55Z")

</div>

Consider filing an issue here: [https://github.com/processing/p5.js/issues](https://github.com/processing/p5.js/issues)
