org.pentaho.reporting.libraries.fonts.truetype
Class TrueTypeFontRegistry

java.lang.Object
  extended by org.pentaho.reporting.libraries.fonts.registry.AbstractFontFileRegistry
      extended by org.pentaho.reporting.libraries.fonts.truetype.TrueTypeFontRegistry
All Implemented Interfaces:
FontRegistry

public class TrueTypeFontRegistry
extends AbstractFontFileRegistry

Creation-Date: 07.11.2005, 19:05:46

Author:
Thomas Morgner

Constructor Summary
TrueTypeFontRegistry()
           
 
Method Summary
protected  boolean addFont(java.io.File file, java.lang.String encoding)
          Adds the fontname by creating the basefont object.
 FontMetricsFactory createMetricsFactory()
          Creates a new font metrics factory.
 java.lang.String[] getAllRegisteredFamilies()
           
protected  java.io.FileFilter getFileFilter()
           
 FontFamily getFontFamily(java.lang.String name)
          Tries to find a font family with the given name, looking through all alternative font names if neccessary.
 java.lang.String[] getRegisteredFamilies()
           
 FontCache getSecondLevelCache()
           
protected static FontCache internalGetSecondLevelCache()
           
protected  void loadFromCache(java.lang.String encoding)
           
protected  void storeToCache(java.lang.String encoding)
           
 
Methods inherited from class org.pentaho.reporting.libraries.fonts.registry.AbstractFontFileRegistry
createStorageLocation, getDefaultEncoding, getSeenFiles, initialize, isCached, isCacheValid, registerDefaultFontPath, registerFontFile, registerFontFile, registerFontPath, safeSystemGetProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrueTypeFontRegistry

public TrueTypeFontRegistry()
Method Detail

internalGetSecondLevelCache

protected static FontCache internalGetSecondLevelCache()

getSecondLevelCache

public FontCache getSecondLevelCache()

getFileFilter

protected java.io.FileFilter getFileFilter()
Specified by:
getFileFilter in class AbstractFontFileRegistry

addFont

protected boolean addFont(java.io.File file,
                          java.lang.String encoding)
                   throws java.io.IOException
Description copied from class: AbstractFontFileRegistry
Adds the fontname by creating the basefont object. This method tries to load the fonts as embeddable fonts, if this fails, it repeats the loading with the embedded-flag set to false.

Specified by:
addFont in class AbstractFontFileRegistry
Parameters:
file - the font file name.
encoding - the encoding.
Throws:
java.io.IOException - if the base font file could not be read.

getRegisteredFamilies

public java.lang.String[] getRegisteredFamilies()

getAllRegisteredFamilies

public java.lang.String[] getAllRegisteredFamilies()

getFontFamily

public FontFamily getFontFamily(java.lang.String name)
Description copied from interface: FontRegistry
Tries to find a font family with the given name, looking through all alternative font names if neccessary.

Returns:
the font family or null, if there is no such family.

createMetricsFactory

public FontMetricsFactory createMetricsFactory()
Creates a new font metrics factory. That factory is specific to a certain font registry and is not required to handle font records from foreign font registries.

A font metrics factory should never be used on its own. It should be embedded into and used by a FontStorage implementation.

Returns:
a new FontMetricsFactory instance

loadFromCache

protected void loadFromCache(java.lang.String encoding)
Overrides:
loadFromCache in class AbstractFontFileRegistry

storeToCache

protected void storeToCache(java.lang.String encoding)
Overrides:
storeToCache in class AbstractFontFileRegistry