FreeHEP API
Version current

org.freehep.graphicsio.font
Class FontEmbedderType1

java.lang.Object
  extended byorg.freehep.graphicsio.font.FontIncluder
      extended byorg.freehep.graphicsio.font.FontEmbedder
          extended byorg.freehep.graphicsio.font.FontEmbedderType1
Direct Known Subclasses:
PDFFontEmbedderType1

public class FontEmbedderType1
extends FontEmbedder

Font embedder for type 1 fonts. The output can be directly fed into a ps file or as a FontFile to a pdf file.

Todo

Version:
$Id: FontEmbedderType1.java,v 1.4 2005/01/03 21:22:27 duns Exp $
Author:
Simon Fischer
Source Code:
FontEmbedderType1.java

Field Summary
 
Fields inherited from class org.freehep.graphicsio.font.FontEmbedder
NOTDEF
 
Fields inherited from class org.freehep.graphicsio.font.FontIncluder
FONT_SIZE
 
Constructor Summary
FontEmbedderType1(FontRenderContext context, OutputStream out, boolean addZeros)
           
 
Method Summary
protected  void closeEmbedFont()
           
protected  void closeGlyphs()
          Called after the glyph loop ends.
protected  void closeIncludeFont()
          Does nothing, but can be implemented by subclasses if necessary.
 int getAsciiLength()
          Returns the length of the ascii portion of the output.
 int getEncryptedLength()
          Returns the length of the encrypted portion of the output.
protected  void openGlyphs()
          Called before the glyph loop starts.
protected  void openIncludeFont()
          Writes the given information about the font into the file.
protected  void writeEncoding(CharTable t)
          Writes the encoding table to the file.
protected  void writeGlyph(String characterName, Shape glyph, GlyphMetrics glyphMetrics)
          Writes a single glyph to the file.
protected  void writeWidths(double[] w)
          Writes the character widths to the file.
 
Methods inherited from class org.freehep.graphicsio.font.FontEmbedder
getAdvanceWidth, getAdvanceWidths, getGlyph, getGlyphMetrics, includeFont
 
Methods inherited from class org.freehep.graphicsio.font.FontIncluder
getCharName, getContext, getEncodingTable, getFont, getFontBBox, getFontName, getNODefinedChars, getUndefinedWidth, getUnicode, getUnicode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontEmbedderType1

public FontEmbedderType1(FontRenderContext context,
                         OutputStream out,
                         boolean addZeros)
Method Detail

writeWidths

protected void writeWidths(double[] w)
                    throws IOException
Description copied from class: FontEmbedder
Writes the character widths to the file.

Specified by:
writeWidths in class FontEmbedder
Throws:
IOException

writeEncoding

protected void writeEncoding(CharTable t)
                      throws IOException
Description copied from class: FontIncluder
Writes the encoding table to the file.

Specified by:
writeEncoding in class FontIncluder
Throws:
IOException

openIncludeFont

protected void openIncludeFont()
                        throws IOException
Description copied from class: FontIncluder
Writes the given information about the font into the file. When this method is called all getXXX() are guaranteed to return reasonable values.

Specified by:
openIncludeFont in class FontIncluder
Throws:
IOException

closeIncludeFont

protected void closeIncludeFont()
Description copied from class: FontIncluder
Does nothing, but can be implemented by subclasses if necessary.

Overrides:
closeIncludeFont in class FontIncluder

openGlyphs

protected void openGlyphs()
                   throws IOException
Description copied from class: FontEmbedder
Called before the glyph loop starts. Does nothing by default but can be implemented.

Overrides:
openGlyphs in class FontEmbedder
Throws:
IOException

closeGlyphs

protected void closeGlyphs()
                    throws IOException
Description copied from class: FontEmbedder
Called after the glyph loop ends. Does nothing by default but can be implemented.

Overrides:
closeGlyphs in class FontEmbedder
Throws:
IOException

closeEmbedFont

protected void closeEmbedFont()
                       throws IOException
Specified by:
closeEmbedFont in class FontEmbedder
Throws:
IOException

writeGlyph

protected void writeGlyph(String characterName,
                          Shape glyph,
                          GlyphMetrics glyphMetrics)
                   throws IOException
Description copied from class: FontEmbedder
Writes a single glyph to the file. A null value for glyphMetrics indicates the undefined character. In this case the value of unicodeName equals the value of NOTDEF (=.notdef).

Specified by:
writeGlyph in class FontEmbedder
Parameters:
characterName - the character's name according to the unicode standard
glyph - the shape that represents this glyph
glyphMetrics - the metrics of this glyph
Throws:
IOException

getAsciiLength

public int getAsciiLength()
Returns the length of the ascii portion of the output.


getEncryptedLength

public int getEncryptedLength()
Returns the length of the encrypted portion of the output.


FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.