# G4P Library / GUI builder: Set default font for all GUI elements in one go?

**URL:** <https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658>\
**Category:** Libraries\
**Created:** [November 20, 2019, 12:19pm UTC](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658 "2019-11-20T12:19:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark\_orion](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mark_orion/32/7180_2.png) [@mark\_orion](https://discourse.processing.org/u/mark_orion)\
**Post date:** [November 20, 2019, 12:19pm UTC](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658/1 "2019-11-20T12:19:23Z")

</div>

I am working on a Processing project that uses the G4P library. The GUI is build with the G4P GUI Builder tool. I love how easy it is now to create GUIs in Processing. The only problem is that I find the fonts far too small and difficult to read. Is there a way to define the default font and font settings for all controls available in the G4P library and/or the GUI builder ? I would like to avoid having to tweak fonts for every single control and have these settings ideally in a variable so that the styling of the GUI can be changed quickly.

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [November 20, 2019, 4:18pm UTC](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658/2 "2019-11-20T16:18:53Z")

</div>

Sorry there is no option to change the default font used by G4P. You can add a request on SourceForge for this featture and I will see what can be done.

---

<div class="post-metadata">

**Author:** ![mark\_orion](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mark_orion/32/7180_2.png) [@mark\_orion](https://discourse.processing.org/u/mark_orion)\
**Post date:** [November 20, 2019, 4:53pm UTC](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658/3 "2019-11-20T16:53:57Z")

</div>

Thanks a lot for this great piece of work. I have created a ticket with an enhancement request.

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [December 31, 2019, 6:39pm UTC](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658/4 "2019-12-31T18:39:35Z")

</div>

In 4.3.1 (latest version) the user can specify the global font face, style and size for display (buttons, labels etc.), input (textfield, textarea and password fields) and slider (values displayed in slider controls)  
The methods can be found in the G4P class and have the patteren  
`G4P.set?????Font(String face, int style, int size)`

If using GUI Builder 4.3 these methods must be called in `setup` before the call to `createGUI` to have effect.

In GUI Builder 4.4 (to be released) these will be changeable in the design window. NOTE GUI Builder 4.4 will not be able to load and edit GUIs created with 3.3

---

<div class="post-metadata">

**Author:** ![ed\_from\_maine](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@ed\_from\_maine](https://discourse.processing.org/u/ed_from_maine)\
**Post date:** [April 26, 2020, 8:24pm UTC](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658/5 "2020-04-26T20:24:33Z")

</div>

I was going to post a similar question, but found this thread. Would placing all the relevant controls within a panel and then using setFont for the panel work??

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [April 27, 2020, 8:19am UTC](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658/6 "2020-04-27T08:19:35Z")

</div>

> [@ed\_from\_maine](#):
>
> Would placing all the relevant controls within a panel and then using setFont for the panel work??

No.

Set the global fonts before creating any controls and then you can use `setFont(...)` on individual controls.

---

<div class="post-metadata">

**Author:** ![ed\_from\_maine](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@ed\_from\_maine](https://discourse.processing.org/u/ed_from_maine)\
**Post date:** [May 1, 2020, 12:27pm UTC](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658/7 "2020-05-01T12:27:25Z")

</div>

For what it’s worth, I found another solution. I called G4P.setDisplayFont() and G4P.setInputFont() in setup() and it worked perfectly, affecting all controls. I do need to resize my controls, but that’s a minimal effort.

---

<div class="post-metadata">

**Author:** ![ed\_from\_maine](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@ed\_from\_maine](https://discourse.processing.org/u/ed_from_maine)\
**Post date:** [May 1, 2020, 12:42pm UTC](https://discourse.processing.org/t/g4p-library-gui-builder-set-default-font-for-all-gui-elements-in-one-go/15658/8 "2020-05-01T12:42:37Z")

</div>

Not doing too well here. I misunderstood your previous post. I’m suggesting what you recommended above. Sorry. Not used to this environment, do much better with Arduino…
