# Can someone post the code for the text() function with 5 params here please?

**URL:** <https://discourse.processing.org/t/can-someone-post-the-code-for-the-text-function-with-5-params-here-please/47144>\
**Category:** Project Guidance\
**Created:** [September 14, 2025, 5:50pm UTC](https://discourse.processing.org/t/can-someone-post-the-code-for-the-text-function-with-5-params-here-please/47144 "2025-09-14T17:50:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [September 14, 2025, 5:50pm UTC](https://discourse.processing.org/t/can-someone-post-the-code-for-the-text-function-with-5-params-here-please/47144/1 "2025-09-14T17:50:17Z")

</div>

Hello all,

Can someone post the JAVA SOURCE code for the `text()` function with **5** params here please?

I need to modify it for my purpose.

For example I have a **list of buttons** (rectangles) and within each botton is a text of unknown length. Since I work with 5 params, I need to know how many line breaks there were and how high the text box is as a result. (e.g., text Quit, no line break, height 20; e.g. text “bla bla bla bla bla bla bla bla bla…..“, line breaks 4, height 44….).

I need the **height** so that I know, where I have to draw the next button in the list.

All complicate.

Thank you all.

Warm regards,

Chrisir

---

<div class="post-metadata">

**Author:** ![stefterv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/stefterv/32/21678_2.png) [@stefterv](https://discourse.processing.org/u/stefterv)\
**Post date:** [September 15, 2025, 6:05am UTC](https://discourse.processing.org/t/can-someone-post-the-code-for-the-text-function-with-5-params-here-please/47144/2 "2025-09-15T06:05:07Z")

</div>

> <https://github.com/processing/processing4/blob/bdbd0254c75e7b809bf649c5042c9b7e5dd98bee/core/src/processing/core/PApplet.java#L12530-L12533>

- 

> <https://github.com/processing/processing4/blob/bdbd0254c75e7b809bf649c5042c9b7e5dd98bee/core/src/processing/core/PGraphics.java#L4745-L4783>

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [September 15, 2025, 10:47am UTC](https://discourse.processing.org/t/can-someone-post-the-code-for-the-text-function-with-5-params-here-please/47144/3 "2025-09-15T10:47:33Z")

</div>

Thank you so much!

That’s great!

The link is correct, but it’s rather from line 4810 ff.

and then in 4829 `text(String str, float x1, float y1, float x2, float y2) {`

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [September 16, 2025, 5:15pm UTC](https://discourse.processing.org/t/can-someone-post-the-code-for-the-text-function-with-5-params-here-please/47144/4 "2025-09-16T17:15:38Z")

</div>

The function was too deep rooted in the code and had too many dependencies within the code (to other functions and vars), so I ended up writing my own function.

But thank you!

 ![grafik](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/2/2/22912fe08ebe1a110536716229c403ed1698e19e.png)
