com.atlassian.confluence.plugins.templates.servlet
Class DefaultFontProvider

java.lang.Object
  extended by com.atlassian.confluence.plugins.templates.servlet.DefaultFontProvider
All Implemented Interfaces:
FontProvider

public class DefaultFontProvider
extends Object
implements FontProvider


Constructor Summary
DefaultFontProvider()
           
 
Method Summary
 Font getConfluenceFont(String name)
          Get the specified Confluence bundled Font.
 Font getFirstAvailableFont(String... desiredFontNames)
          Returns the first available font among the specified fonts (respects order).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFontProvider

public DefaultFontProvider()
Method Detail

getFirstAvailableFont

public Font getFirstAvailableFont(String... desiredFontNames)
Description copied from interface: FontProvider
Returns the first available font among the specified fonts (respects order).

Specified by:
getFirstAvailableFont in interface FontProvider
Parameters:
desiredFontNames - desired font names
Returns:
the first available font among the specified fonts (respects order).

getConfluenceFont

public Font getConfluenceFont(String name)
Description copied from interface: FontProvider
Get the specified Confluence bundled Font. Not that the returned font will default to a size of 12. Font.deriveFont(int) can be used on the returned Font if you need a different size. This method does not look to system installed Fonts but only considers those bundled with Confluence.

On Windows and Linux platforms explicitly retrieving a Font will constrain you to only the glyphs available within that font. On Mac OS X the JVM will try to find a suitable glyph from all available fonts. If you want this behaviour on the other platforms then you should use logical font names and the FontProvider.getFirstAvailableFont(String...) method.

Specified by:
getConfluenceFont in interface FontProvider
Parameters:
name - the name of the Font required.
Returns:
the named font bundled with Confluence, or null if no Font can be found


Copyright © 2003-2013 Atlassian. All Rights Reserved.