FreeHEP API
Version current

org.freehep.graphicsio.font
Class FontIncluder

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

public abstract class FontIncluder
extends 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,v 1.3 2005/01/03 21:22:27 duns Exp $
Author:
Simon Fischer
Source Code:
FontIncluder.java

Field Summary
static double FONT_SIZE
           
 
Constructor Summary
FontIncluder(FontRenderContext context)
           
 
Method Summary
protected  void closeIncludeFont()
          Does nothing, but can be implemented by subclasses if necessary.
protected  String getCharName(int i)
           
protected  FontRenderContext getContext()
           
protected  CharTable getEncodingTable()
           
protected  Font getFont()
           
protected  Rectangle2D getFontBBox()
           
protected  String getFontName()
           
protected  int getNODefinedChars()
           
protected  double getUndefinedWidth()
           
protected  char[] getUnicode()
           
protected  char getUnicode(int i)
           
 void includeFont(Font font, CharTable charTable, 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(FontRenderContext context)
Method Detail

openIncludeFont

protected abstract void openIncludeFont()
                                 throws 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:
IOException

writeEncoding

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

Throws:
IOException

closeIncludeFont

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

Throws:
IOException

getContext

protected FontRenderContext getContext()

getFontName

protected String getFontName()

getFont

protected Font getFont()

getEncodingTable

protected CharTable getEncodingTable()

getFontBBox

protected Rectangle2D getFontBBox()

getCharName

protected String getCharName(int i)

getUnicode

protected char getUnicode(int i)

getUnicode

protected char[] getUnicode()

getNODefinedChars

protected int getNODefinedChars()

includeFont

public void includeFont(Font font,
                        CharTable charTable,
                        String name)
                 throws 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:
IOException

getUndefinedWidth

protected double getUndefinedWidth()

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.