com.alee.utils
Class FontUtils

java.lang.Object
  extended by com.alee.utils.FontUtils

public class FontUtils
extends java.lang.Object

This class provides a set of utilities to work with fonts.

Author:
Mikle Garin

Constructor Summary
FontUtils()
           
 
Method Summary
static void clearDerivedFontsCache()
          Clears derived fonts cache.
static java.awt.Font getCachedDerivedFont(java.awt.Font font, int style, int size)
          Get derived font by font, style and size.
protected static DerivedFontAttributes getFontAttribute(java.awt.Font font, int style, int size)
          Returns derived font attributes object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontUtils

public FontUtils()
Method Detail

clearDerivedFontsCache

public static void clearDerivedFontsCache()
Clears derived fonts cache.


getCachedDerivedFont

public static java.awt.Font getCachedDerivedFont(java.awt.Font font,
                                                 int style,
                                                 int size)
Get derived font by font, style and size. At first it will get the derived font from cache. If it cannot hit the derived font, it will invoke font.deriveFont to derive a font.

Parameters:
font - original font
style - new font style
size - new font size
Returns:
the derived font.

getFontAttribute

protected static DerivedFontAttributes getFontAttribute(java.awt.Font font,
                                                        int style,
                                                        int size)
Returns derived font attributes object.

Parameters:
font - original font
style - new font style
size - new font size
Returns:
font attributes object