# Text() on Mac causes program to pause

**URL:** <https://discourse.processing.org/t/text-on-mac-causes-program-to-pause/8353>\
**Category:** Coding Questions\
**Created:** [February 13, 2019, 2:10pm UTC](https://discourse.processing.org/t/text-on-mac-causes-program-to-pause/8353 "2019-02-13T14:10:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgolanka](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sgolanka](https://discourse.processing.org/u/sgolanka)\
**Post date:** [February 13, 2019, 2:10pm UTC](https://discourse.processing.org/t/text-on-mac-causes-program-to-pause/8353/1 "2019-02-13T14:10:15Z")

</div>

This problem occurs on Apple computers, but not not on Windows. The code below comes from a simple game. When the condition is true, the program (on a Mac), stops for a few seconds, and then displays “You Lose.” When run on a Windows computer, there is no pause. Is there a way to prevent the pause on a Mac?

```auto
if (rainDrop.checkForReachBottom(height)) {
    text("You Lose", width/2, height/2);
  }

```

---

<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:** [February 17, 2019, 11:00pm UTC](https://discourse.processing.org/t/text-on-mac-causes-program-to-pause/8353/2 "2019-02-17T23:00:06Z")

</div>

Text may be lazy loading the very first time it is called. One way to overcome this is to display some text on the very first frame – getting the one-time delay out of the way.

That said, “a few seconds” is a very long delay. I wonder if you have a problem with font(s).

---

<div class="post-metadata">

**Author:** ![sgolanka](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sgolanka](https://discourse.processing.org/u/sgolanka)\
**Post date:** [February 26, 2019, 5:20pm UTC](https://discourse.processing.org/t/text-on-mac-causes-program-to-pause/8353/3 "2019-02-26T17:20:24Z")

</div>

Thanks, your workaround is good.

I timed this, and the delay is closer to 1 second, but very noticeable. Still curious about what is different between the Mac and PC implementation of text().

---

<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:** [February 26, 2019, 6:36pm UTC](https://discourse.processing.org/t/text-on-mac-causes-program-to-pause/8353/4 "2019-02-26T18:36:00Z")

</div>

I have seen various version of this crop up several time, depending on the MacOS version. I believe it is related to Java and its interface to Mac fonts, not anything specific to Processing. Here is one example of a recent open Java JDK bug:

### Text rendering has slow initialization time

[https://bugs.openjdk.java.net/browse/JDK-8179209](https://bugs.openjdk.java.net/browse/JDK-8179209)
