FreeHEP API
Version current

org.freehep.graphicsio.font
Class FontTable

java.lang.Object
  extended byorg.freehep.graphicsio.font.FontTable
Direct Known Subclasses:
PDFFontTable, PSFontTable

public abstract class FontTable
extends Object

A table to remember which fonts were used while writing a document.

Version:
$Id: FontTable.java,v 1.5 2005/01/03 21:22:28 duns Exp $
Author:
Simon Fischer
Source Code:
FontTable.java

Nested Class Summary
protected  class FontTable.Entry
           
 
Constructor Summary
FontTable()
           
 
Method Summary
protected abstract  String createFontReference(Font f)
          Creates a unique reference to address this font.
protected abstract  void firstRequest(FontTable.Entry e, boolean embed, String embedAs)
          Called whenever a specific font is used for the first time.
 String fontReference(Font font, boolean embed, String embedAs)
          Returns a name for this font that can be used in the document.
abstract  CharTable getEncodingTable()
          Returns a default CharTable to be used for normal text (not Symbol or Dingbats).
 Collection getEntries()
          Returns a Collection view of all fonts.
protected abstract  Font substituteFont(Font font)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontTable

public FontTable()
Method Detail

getEncodingTable

public abstract CharTable getEncodingTable()
Returns a default CharTable to be used for normal text (not Symbol or Dingbats).


firstRequest

protected abstract void firstRequest(FontTable.Entry e,
                                     boolean embed,
                                     String embedAs)
                              throws IOException
Called whenever a specific font is used for the first time. Subclasses may use this method to include the font instantly. This method may change the value of the reference by calling e.setReference(String) e.g. if it wants to substitute the font by a standard font that can be addressed under a name different from the generated one.

Throws:
IOException

createFontReference

protected abstract String createFontReference(Font f)
Creates a unique reference to address this font.


substituteFont

protected abstract Font substituteFont(Font font)

fontReference

public String fontReference(Font font,
                            boolean embed,
                            String embedAs)
Returns a name for this font that can be used in the document. A new name is generated if the font was not used yet. For different fontsizes the same name is returned.


getEntries

public Collection getEntries()
Returns a Collection view of all fonts. The elements of the collection are Entries.


FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.