Theme theme = Theme.getTheme();
Font font = theme.getFont();
// Search for a font that can support the sample string
String sampleResource = (String)resources.get("firstName");
if (font.canDisplayUpTo(sampleResource) != -1) {
Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
for (int i = 0; i < fonts.length; i++) {
if (fonts[i].canDisplayUpTo(sampleResource) == -1) {
theme.setFont(fonts[i].deriveFont(Font.PLAIN, 12));