org.jfree.report.modules.output.support.itext
Class BaseFontFactory

java.lang.Object
  |
  +--com.lowagie.text.pdf.DefaultFontMapper
        |
        +--org.jfree.report.modules.output.support.itext.BaseFontFactory

public final 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

Inner classes inherited from class com.lowagie.text.pdf.DefaultFontMapper
com.lowagie.text.pdf.DefaultFontMapper.BaseFontParameters
 
Field Summary
static java.lang.String GC_AFTER_REGISTER
          The name of the report property, which defines, whether the GarbageCollector should be run after the font registration.
static java.lang.String ITEXT_FONT_AUTOINIT
          The 'PDF auto init' property key.
static java.lang.String ITEXT_FONT_AUTOINIT_DEFAULT
          The default 'PDF auto init' property value.
static java.lang.String ITEXT_FONT_AUTOINIT_LAZY
          The default 'PDF auto init' property value.
static java.lang.String ITEXT_FONT_AUTOINIT_NEVER
          The default 'PDF auto init' property value.
static java.lang.String ITEXT_FONT_AUTOINIT_ONINIT
          The default 'PDF auto init' property value.
static java.lang.String ITEXT_FONT_ENCODING
          The iText font encoding specifies how to encode the text of iText documents for the given font.
static java.lang.String ITEXT_FONT_ENCODING_DEFAULT
          The default 'PDF encoding' property value.
 
Method Summary
static java.lang.String getDefaultFontEncoding()
          Returns the BaseFont encoding property value.
static BaseFontFactory getFontFactory()
          Returns/creates the singleton font factory.
 java.lang.String getFontfileForName(java.lang.String font)
          Deprecated. this method does not support font styles.
 org.jfree.fonts.registry.FontRecord getFontForName(java.lang.String font, boolean bold, boolean italics)
           
 java.lang.String getPDFTargetAutoInit()
          Returns whether to search for ttf-fonts when the PDFOutputTarget is loaded.
 java.util.Iterator getRegisteredFonts()
          Returns all registered fonts as enumeration.
 boolean isInitialized()
          Checks, whether the factory is initialized.
 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.
static void setDefaultFontEncoding(java.lang.String encoding)
          Sets the BaseFont encoding property value.
 void setPDFTargetAutoInit(java.lang.String autoInit)
          Sets the PDF target auto init status.
 
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
 

Field Detail

ITEXT_FONT_AUTOINIT

public static final java.lang.String ITEXT_FONT_AUTOINIT
The 'PDF auto init' property key.

ITEXT_FONT_AUTOINIT_ONINIT

public static final java.lang.String ITEXT_FONT_AUTOINIT_ONINIT
The default 'PDF auto init' property value.

ITEXT_FONT_AUTOINIT_LAZY

public static final java.lang.String ITEXT_FONT_AUTOINIT_LAZY
The default 'PDF auto init' property value.

ITEXT_FONT_AUTOINIT_NEVER

public static final java.lang.String ITEXT_FONT_AUTOINIT_NEVER
The default 'PDF auto init' property value.

ITEXT_FONT_AUTOINIT_DEFAULT

public static final java.lang.String ITEXT_FONT_AUTOINIT_DEFAULT
The default 'PDF auto init' property value.

ITEXT_FONT_ENCODING

public static final java.lang.String ITEXT_FONT_ENCODING
The iText font encoding specifies how to encode the text of iText documents for the given font.

ITEXT_FONT_ENCODING_DEFAULT

public static final java.lang.String ITEXT_FONT_ENCODING_DEFAULT
The default 'PDF encoding' property value.

GC_AFTER_REGISTER

public static final java.lang.String GC_AFTER_REGISTER
The name of the report property, which defines, whether the GarbageCollector should be run after the font registration.
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 for the given font.

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)
Deprecated. this method does not support font styles.

Returns the name of the font file by looking up the name.
Parameters:
font - the font name
Returns:
the font file name.

getFontForName

public org.jfree.fonts.registry.FontRecord getFontForName(java.lang.String font,
                                                          boolean bold,
                                                          boolean italics)

isInitialized

public boolean isInitialized()
Checks, whether the factory is initialized.
Returns:
true, if the factory is initalized, false otherwise.

getDefaultFontEncoding

public static java.lang.String getDefaultFontEncoding()
Returns the BaseFont encoding property value.
Returns:
the BaseFont encoding property value.

setDefaultFontEncoding

public static void setDefaultFontEncoding(java.lang.String encoding)
Sets the BaseFont encoding property value.
Parameters:
encoding - the new encoding.

getPDFTargetAutoInit

public java.lang.String getPDFTargetAutoInit()
Returns whether to search for ttf-fonts when the PDFOutputTarget is loaded.
Returns:
the PDFOutputTarget autoinitialisation value.

setPDFTargetAutoInit

public void setPDFTargetAutoInit(java.lang.String autoInit)
Sets the PDF target auto init status.
Parameters:
autoInit - the new status.

getFontFactory

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