/** Return the value of the font with the given name, or the given default if it doesn't exist */ public Font getFontOption(String prop, Font dflt) { String s = getOptionProperty(prop); if (s == null) return dflt; String[] split = s.split("/"); return BoardFont.getFont(split[0], Integer.parseInt(split[1]), Integer.parseInt(split[2])); }
/** Return the value of the font with the given name, or the given default if it doesn't exist */ public Font getFont(String prop, Font dflt) { String s = getProperty(prop); if (s == null) return dflt; String[] split = s.split("/"); String fam = split[0]; int md = dflt.getStyle(); if (split.length >= 2) md = Integer.parseInt(split[1]); int sz = dflt.getSize(); if (split.length >= 3) sz = Integer.parseInt(split[2]); return BoardFont.getFont(fam, md, sz); }
/** * Return the value of the font with the given name, or a serif size 12 font if it doesn't exist */ public Font getFontOption(String prop) { return getFontOption(prop, BoardFont.getFont("Serif", Font.PLAIN, 12)); }