1 /* 2 * aTunes 3 * Copyright (C) Alex Aranda, Sylvain Gaudard and contributors 4 * 5 * See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors 6 * 7 * http://www.atunes.org 8 * http://sourceforge.net/projects/atunes 9 * 10 * This program is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU General Public License 12 * as published by the Free Software Foundation; either version 2 13 * of the License, or (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 */ 20 21 package net.sourceforge.atunes.gui.lookandfeel.substance; 22 23 import java.awt.Font; 24 25 import javax.swing.plaf.FontUIResource; 26 27 import org.pushingpixels.substance.api.fonts.FontSet; 28 29 /** 30 * Several types of fonts for different UI components 31 * 32 * @author alex 33 * 34 */ 35 final class CustomFontSet implements FontSet { 36 37 private final FontUIResource windowTitleFont; 38 private final FontUIResource titleFont; 39 private final FontUIResource smallFont; 40 private final FontUIResource messageFont; 41 private final FontUIResource menuFont; 42 private final FontUIResource controlFont; 43 44 /** 45 * @param baseFont 46 */ CustomFontSet(final Font baseFont)47 public CustomFontSet(final Font baseFont) { 48 this.windowTitleFont = new FontUIResource(baseFont.deriveFont( 49 Font.BOLD, baseFont.getSize() + 1f)); 50 this.titleFont = new FontUIResource( 51 baseFont.deriveFont((float) baseFont.getSize())); 52 this.smallFont = new FontUIResource(baseFont.deriveFont(baseFont 53 .getSize() - 1f)); 54 this.messageFont = new FontUIResource(baseFont.deriveFont(baseFont 55 .getSize() - 1f)); 56 this.menuFont = new FontUIResource(baseFont.deriveFont((float) baseFont 57 .getSize())); 58 this.controlFont = new FontUIResource( 59 baseFont.deriveFont((float) baseFont.getSize())); 60 } 61 62 @Override getWindowTitleFont()63 public FontUIResource getWindowTitleFont() { 64 return windowTitleFont; 65 } 66 67 @Override getTitleFont()68 public FontUIResource getTitleFont() { 69 return titleFont; 70 } 71 72 @Override getSmallFont()73 public FontUIResource getSmallFont() { 74 return smallFont; 75 } 76 77 @Override getMessageFont()78 public FontUIResource getMessageFont() { 79 return messageFont; 80 } 81 82 @Override getMenuFont()83 public FontUIResource getMenuFont() { 84 return menuFont; 85 } 86 87 @Override getControlFont()88 public FontUIResource getControlFont() { 89 return controlFont; 90 } 91 }