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

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.

2 Likes

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.

2 Likes

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

2 Likes

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

2 Likes

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??

No.

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

1 Like

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.

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…