org.freehep.graphicsio.font
Class FontIncluder

java.lang.Object
  extended by org.freehep.graphicsio.font.FontIncluder
Direct Known Subclasses:
FontEmbedder, PDFFontIncluder

public abstract class FontIncluder
extends java.lang.Object

Instances of this class write the information into documents (ps or pdf) that is necessary in order to include or embed fonts. In order to guarantee a time-invariant interface the main methods to implement by subclasses includeFont takes no arguments. All necessary data should be available by getter methods which can easily be added.
The abstract methods are called in the following order:

Version:
$Id: FontIncluder.java 8584 2006-08-10 23:06:37Z duns $
Author:
Simon Fischer

Field Summary
static double FONT_SIZE
           
 
Constructor Summary
FontIncluder(java.awt.font.FontRenderContext context)
           
 
Method Summary
protected  void closeIncludeFont()
          Does nothing, but can be implemented by subclasses if necessary.
protected  java.lang.String getCharName(int i)
           
protected  java.awt.font.FontRenderContext getContext()
           
protected  CharTable getEncodingTable()
           
protected  java.awt.Font getFont()
           
protected  java.awt.geom.Rectangle2D getFontBBox()
           
protected  java.lang.String getFontName()
           
protected  int getNODefinedChars()
           
protected  double getUndefinedWidth()
           
protected  char[] getUnicode()
           
protected  char getUnicode(int i)
           
 void includeFont(java.awt.Font font, CharTable charTable, java.lang.String name)
          Embed this font to the file.
protected abstract  void openIncludeFont()
          Writes the given information about the font into the file.
protected abstract  void writeEncoding(CharTable charTable)
          Writes the encoding table to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FONT_SIZE

public static final double FONT_SIZE
See Also:
Constant Field Values
Constructor Detail

FontIncluder

public FontIncluder(java.awt.font.FontRenderContext context)
Method Detail

openIncludeFont

protected abstract void openIncludeFont()
                                 throws java.io.IOException
Writes the given information about the font into the file. When this method is called all getXXX() are guaranteed to return reasonable values.

Throws:
java.io.IOException

writeEncoding

protected abstract void writeEncoding(CharTable charTable)
                               throws java.io.IOException
Writes the encoding table to the file.

Throws:
java.io.IOException

closeIncludeFont

protected void closeIncludeFont()
                         throws java.io.IOException
Does nothing, but can be implemented by subclasses if necessary.

Throws:
java.io.IOException

getContext

protected java.awt.font.FontRenderContext getContext()

getFontName

protected java.lang.String getFontName()

getFont

protected java.awt.Font getFont()

getEncodingTable

protected CharTable getEncodingTable()

getFontBBox

protected java.awt.geom.Rectangle2D getFontBBox()

getCharName

protected java.lang.String getCharName(int i)

getUnicode

protected char getUnicode(int i)

getUnicode

protected char[] getUnicode()

getNODefinedChars

protected int getNODefinedChars()

includeFont

public void includeFont(java.awt.Font font,
                        CharTable charTable,
                        java.lang.String name)
                 throws java.io.IOException
Embed this font to the file.

Parameters:
font - The font to include
name - The name under which this font is addressed within the document (can be retrieved by getFontName())
Throws:
java.io.IOException

getUndefinedWidth

protected double getUndefinedWidth()


Copyright © 2000-2007 FreeHEP. All Rights Reserved.