org.freehep.graphicsio.pdf
Class PDFFontTable

java.lang.Object
  extended by org.freehep.graphicsio.font.FontTable
      extended by org.freehep.graphicsio.pdf.PDFFontTable

public class PDFFontTable
extends FontTable

A table to remember which fonts were used while writing a pdf document. Entries to resource dictionaries and embedding of fonts can be done when the drawing is finished by calling addAll().

Version:
$Id: PDFFontTable.java 9329 2006-11-14 22:29:00Z duns $
Author:
Simon Fischer

Nested Class Summary
 
Nested classes/interfaces inherited from class org.freehep.graphicsio.font.FontTable
FontTable.Entry
 
Constructor Summary
PDFFontTable(PDFWriter pdf)
           
 
Method Summary
 int addFontDictionary()
          Adds all fonts to a dictionary named "FontList".
protected  java.lang.String createFontReference(java.awt.Font f)
          Creates the reference by numbering them.
 void embedAll(java.awt.font.FontRenderContext context, boolean embed, java.lang.String embedAs)
          Embeds all not yet embedded fonts to the file.
 void firstRequest(FontTable.Entry e, boolean embed, java.lang.String embedAs)
          Called whenever a specific font is used for the first time.
 CharTable getEncodingTable()
          Returns a default CharTable to be used for normal text (not Symbol or Dingbats).
protected  java.awt.Font substituteFont(java.awt.Font font)
           
 
Methods inherited from class org.freehep.graphicsio.font.FontTable
fontReference, getEntries, normalize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFFontTable

public PDFFontTable(PDFWriter pdf)
Method Detail

addFontDictionary

public int addFontDictionary()
                      throws java.io.IOException
Adds all fonts to a dictionary named "FontList".

Throws:
java.io.IOException

embedAll

public void embedAll(java.awt.font.FontRenderContext context,
                     boolean embed,
                     java.lang.String embedAs)
              throws java.io.IOException
Embeds all not yet embedded fonts to the file.

Throws:
java.io.IOException

getEncodingTable

public CharTable getEncodingTable()
Description copied from class: FontTable
Returns a default CharTable to be used for normal text (not Symbol or Dingbats).

Specified by:
getEncodingTable in class FontTable

firstRequest

public void firstRequest(FontTable.Entry e,
                         boolean embed,
                         java.lang.String embedAs)
Description copied from class: FontTable
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.

Specified by:
firstRequest in class FontTable

substituteFont

protected java.awt.Font substituteFont(java.awt.Font font)
Specified by:
substituteFont in class FontTable

createFontReference

protected java.lang.String createFontReference(java.awt.Font f)
Creates the reference by numbering them.

Specified by:
createFontReference in class FontTable
Returns:
"F"+currentFontIndex


Copyright © 2000-2007 FreeHEP. All Rights Reserved.