org.extex.backend.documentWriter.postscript.util
Class FontManager

java.lang.Object
  extended by org.extex.backend.documentWriter.postscript.util.FontManager
All Implemented Interfaces:
java.lang.Iterable<ManagerInfo>

public class FontManager
extends java.lang.Object
implements java.lang.Iterable<ManagerInfo>

The font manager keeps track of the fonts and characters used.

Version:
$Revision: 6447 $
Author:
Gerd Neugebauer

Constructor Summary
FontManager(BackendFontManager manager)
          Creates a new object.
 
Method Summary
 java.lang.String add(Font font, UnicodeChar c)
          Receive the information that a character in a certain font has been used and should be remembered.
 BackendCharacter getRecognizedCharId()
          Get the most recently recognized back-end character.
 java.util.Iterator<ManagerInfo> iterator()
          Return the iterator for all recognized back-end fonts as ManagerInfo.
 void reset()
          Clear the memory and forget everything about fonts used.
 void write(java.io.PrintStream stream)
          Write all fonts to a given PostScript stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontManager

public FontManager(BackendFontManager manager)
Creates a new object.

Parameters:
manager - the back-end front manager
Method Detail

add

public java.lang.String add(Font font,
                            UnicodeChar c)
                     throws GeneralException
Receive the information that a character in a certain font has been used and should be remembered.

Parameters:
font - the font which is used
c - the character in the font which is used
Returns:
true iff the font is not the one previously reported
Throws:
GeneralException - in case of an error

getRecognizedCharId

public BackendCharacter getRecognizedCharId()
Get the most recently recognized back-end character. This might be null if the character is not defined in the font.

Returns:
the back-end character
See Also:
BackendFontManager.getRecognizedCharId()

iterator

public java.util.Iterator<ManagerInfo> iterator()
Return the iterator for all recognized back-end fonts as ManagerInfo. The fonts are sorted by the name.

Specified by:
iterator in interface java.lang.Iterable<ManagerInfo>
Returns:
the iterator for all recognized back-end font as ManagerInfo.
See Also:
BackendFontManager.iterate()

reset

public void reset()
Clear the memory and forget everything about fonts used.


write

public void write(java.io.PrintStream stream)
           throws java.io.IOException
Write all fonts to a given PostScript stream.

Parameters:
stream - the target stream
Throws:
java.io.IOException - in case of an IO error