com.jrefinery.report.targets.support.itext
Class BaseFontFactory

java.lang.Object
  extended bycom.lowagie.text.pdf.DefaultFontMapper
      extended bycom.jrefinery.report.targets.support.itext.BaseFontFactory
All Implemented Interfaces:
com.lowagie.text.pdf.FontMapper

public class BaseFontFactory
extends com.lowagie.text.pdf.DefaultFontMapper

The BaseFontFactory is used to find and register all TrueType fonts for embedding them in the PDF file.

Author:
Thomas Morgner

Nested Class Summary
 
Nested classes inherited from class com.lowagie.text.pdf.DefaultFontMapper
com.lowagie.text.pdf.DefaultFontMapper.BaseFontParameters
 
Method Summary
static java.lang.String getDefaultFontEncoding()
          Returns the default font encoding.
static BaseFontFactory getFontFactory()
          Returns/creates the singleton font factory.
 java.lang.String getFontfileForName(java.lang.String font)
          Returns the name of the font file by looking up the name.
 java.util.Iterator getRegisteredFonts()
          Returns all registered fonts as enumeration.
 void registerDefaultFontPath()
          Register os-specific font paths to the PDF-FontFactory.
 void registerFontFile(java.lang.String filename, java.lang.String encoding)
          Register the font (must end this *.ttf) to the FontFactory.
 void registerFontPath(java.io.File file, java.lang.String encoding)
          Register all fonts (*.ttf files) in the given path.
 
Methods inherited from class com.lowagie.text.pdf.DefaultFontMapper
awtToPdf, getAliases, getBaseFontParameters, getMapper, insertDirectory, insertNames, pdfToAwt, putAlias, putName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerDefaultFontPath

public void registerDefaultFontPath()
Register os-specific font paths to the PDF-FontFactory. For unix-like operating systems, X11 is searched in /usr/X11R6 and the default truetype fontpath is added. For windows the system font path is added (%windir%/fonts)


registerFontPath

public void registerFontPath(java.io.File file,
                             java.lang.String encoding)
Register all fonts (*.ttf files) in the given path.

Parameters:
file - the directory that contains the font files.
encoding - the encoding.

registerFontFile

public void registerFontFile(java.lang.String filename,
                             java.lang.String encoding)
Register the font (must end this *.ttf) to the FontFactory.

Parameters:
filename - the filename.
encoding - the encoding.

getRegisteredFonts

public java.util.Iterator getRegisteredFonts()
Returns all registered fonts as enumeration.

Returns:
an enumeration of the registered fonts.

getFontfileForName

public java.lang.String getFontfileForName(java.lang.String font)
Returns the name of the font file by looking up the name.

Parameters:
font - the font name
Returns:
the font file name.

getDefaultFontEncoding

public static final java.lang.String getDefaultFontEncoding()
Returns the default font encoding.

Returns:
the default font encoding.

getFontFactory

public static BaseFontFactory getFontFactory()
Returns/creates the singleton font factory.

Returns:
the font factory.