# Not displaying text over certain size

**URL:** <https://discourse.processing.org/t/not-displaying-text-over-certain-size/20077>\
**Category:** Libraries\
**Created:** [April 23, 2020, 4:08pm UTC](https://discourse.processing.org/t/not-displaying-text-over-certain-size/20077 "2020-04-23T16:08:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanzor](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@tanzor](https://discourse.processing.org/u/tanzor)\
**Post date:** [April 23, 2020, 4:08pm UTC](https://discourse.processing.org/t/not-displaying-text-over-certain-size/20077/1 "2020-04-23T16:08:14Z")

</div>

Dear experts,

I’m coding an online experiment in jspsych and p5js and enjoying it very much.

There’s a strange issue with font sizes however: if I increase the fontsize from 39 to 40 the text disappears (see [line 61 in jspsych\_p5text.js](https://glitch.com/edit/#!/flicker-detect-discrim?path=jspsych-p5text.js:61:16)).

What am I doing wrong?  
cheers,  
-Matan

---

<div class="post-metadata">

**Author:** ![tony](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tony/32/949_2.png) [@tony](https://discourse.processing.org/u/tony)\
**Post date:** [April 23, 2020, 9:07pm UTC](https://discourse.processing.org/t/not-displaying-text-over-certain-size/20077/2 "2020-04-23T21:07:01Z")

</div>

This is very perplexing. I can recreate the bug on the website, but when I try to recreate it on my own nothin happens. It might have to do with the custom font?

Also, cool experiment.

---

<div class="post-metadata">

**Author:** ![tanzor](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@tanzor](https://discourse.processing.org/u/tanzor)\
**Post date:** [April 24, 2020, 3:48am UTC](https://discourse.processing.org/t/not-displaying-text-over-certain-size/20077/3 "2020-04-24T03:48:25Z")

</div>

Thanks! I tried it without the custom font and the same happens ☹

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 3, 2020, 8:06pm UTC](https://discourse.processing.org/t/not-displaying-text-over-certain-size/20077/4 "2020-05-03T20:06:16Z")

</div>

This is almost certainly a text overflow issue.

Size 30 works:

```
		p.textSize(30)
		p.text(trial.title,p.width/2-300, 50, 600, 50)

```

Size 40 doesn’t work:

```
		p.textSize(40)
		p.text(trial.title,p.width/2-300, 50, 600, 50)

```

You are creating a “p” text area for your title that is 50 pixels tall. When you create a 40px font inside that area (plus default padding) it “overflows” – it is hanging out of the box, and the overflow control needs to decide whether to hide it or let it hang out. It hides it. Try making your p box taller, for example 55:

Size 40 works in a taller box:

```
		p.textSize(40)
		p.text(trial.title,p.width/2-300, 50, 600, 55)

```

https://glitch.com/embed/#!/embed/flicker-detect-discrim?path=jspsych-p5text.js&previewSize=0

---

<div class="post-metadata">

**Author:** ![tanzor](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@tanzor](https://discourse.processing.org/u/tanzor)\
**Post date:** [May 5, 2020, 7:24am UTC](https://discourse.processing.org/t/not-displaying-text-over-certain-size/20077/5 "2020-05-05T07:24:32Z")

</div>

Thanks so much Jeremy. It worked! \<3
