com.atlassian.confluence.util
Class DefaultFontManager

java.lang.Object
  extended by com.atlassian.confluence.util.DefaultFontManager
All Implemented Interfaces:
FontManager

public class DefaultFontManager
extends Object
implements FontManager


Nested Class Summary
static class DefaultFontManager.CustomFontInfo
           
 
Field Summary
static String DEFAULT_FONT
           
static org.apache.log4j.Category log
           
 
Constructor Summary
DefaultFontManager()
           
 
Method Summary
protected  void addFontToFOPConfigFile(com.atlassian.confluence.util.DefaultFontManager.Font font)
          To register a font with FOP we can create an XML with the font information
static String getBaseFontsDir()
           
 String getCurrentFont()
           
 void installFont(File fontFile)
          Builds a FOP font metrics file and copies it and the font file itself to the "fonts" directory inside Confluence home.
 void registerFonts()
          Registration of fonts only needs to be done for the first PDf generated on a server after restart.
 void removeAllCustomFonts()
          Since we only store one font in the fonts folder, we can remove all fonts (and the associated metrics file and FOP configuration file used to register the font with FOP)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Category log

DEFAULT_FONT

public static final String DEFAULT_FONT
See Also:
Constant Field Values
Constructor Detail

DefaultFontManager

public DefaultFontManager()
Method Detail

installFont

public void installFont(File fontFile)
Builds a FOP font metrics file and copies it and the font file itself to the "fonts" directory inside Confluence home. Also builds a FOP config file to register the font with FOP. (currently supports True Type and True Type Collection font files - TTF and TTC)

Specified by:
installFont in interface FontManager
Parameters:
fontFile -

getCurrentFont

public String getCurrentFont()
Specified by:
getCurrentFont in interface FontManager
Returns:
either the custom font (if one exists) or the default font (Verdana).

registerFonts

public void registerFonts()
Registration of fonts only needs to be done for the first PDf generated on a server after restart. From then on, the only other time, is when a new custom font has been intalled

Specified by:
registerFonts in interface FontManager

removeAllCustomFonts

public void removeAllCustomFonts()
Since we only store one font in the fonts folder, we can remove all fonts (and the associated metrics file and FOP configuration file used to register the font with FOP)

Specified by:
removeAllCustomFonts in interface FontManager

addFontToFOPConfigFile

protected void addFontToFOPConfigFile(com.atlassian.confluence.util.DefaultFontManager.Font font)
To register a font with FOP we can create an XML with the font information


getBaseFontsDir

public static String getBaseFontsDir()


Confluence is developed by Atlassian.