package utility; import java.awt.Font; /** * It contains fonts with different styles. * All fonts are by default of size 12. * @author Konrad Borowiecki */ public enum Fonts { BookAntiqua("Book Antiqua", Font.PLAIN, 12), BookAntiquaBold("Book Antiqua", Font.BOLD, 12), BookAntiquaItalic("Book Antiqua", Font.ITALIC, 12), BookAntiquaItalicBold("Book Antiqua", Font.ITALIC + Font.BOLD, 12), Dialog("Dialog", Font.PLAIN, 12), DialogBold("Dialog", Font.BOLD, 12), DialogItalic("Dialog", Font.ITALIC, 12), DialogItalicBold("Dialog", Font.ITALIC + Font.BOLD, 12); private Font font; private Fonts(String name, int style, int size) { font = new Font(name, style, size); } /** * It gets a font with a default size i.e. 12; *@return a font of a default size i.e. 12 *@see getFontOfSize(int size) */ public Font getFont() { return font; } /** * It creates neew font, for the selected enume and it changes its size. * @param size the size of new font * @return new font of family and style eual to enume font but of size equal to specified 'size'. */ public Font getFontOfSize(int size) { return new Font(font.getName(), font.getStyle(), size); } }