Setting Font In Paint Routine


#1

When using g.setFont(), is it best to store a fixed size font within the class being painted or can I simply use g.setFont (Font (10)) each time the paint function is called? I would assume the first option is more performant, but I’m not 100% what’s going on under the hood


#2

If you simply want to set the size, calling g.setFont (10.0f); will re-use the current font in the context, so no need to create or recycle the font yourself:

…use the source, Luke! :slight_smile: