org.extex.font
Interface BackendFontManager

All Known Implementing Classes:
AbstractBackendFontManager, AfmBackendFontManager, BackendFontManagerList, TfmBackendFontManager, XtfBackendFontManager

public interface BackendFontManager

The back-end font manager describes the abilities needed by a back-end to deal with fonts. The procedure assumes that in a first pass all characters of all fonts on a page or in a range of pages are passed to the manager. The manager returns a representation appropriate for the back-end format.

In a second pass the manager can be asked to return all fonts. Those fonts can be embedded into the output file – either completely or simply as a list of font names.

Version:
$Revision: 5890 $
Author:
Gerd Neugebauer, Michael Niedermair

Method Summary
 BackendCharacter getRecognizedCharId()
          Get the char info for the most recently recognized pair of font and character.
 BackendFont getRecognizedFont()
          Get the font info for the most recently recognized pair of font and character.
 boolean isNewRecongnizedFont()
          Get the new font indicator for the most recently recognized pair of font and character.
 java.util.Iterator<ManagerInfo> iterate()
          Return the iterator for all recognized back-end fonts as ManagerInfo.
 boolean recognize(FontKey fontKey, UnicodeChar uc)
          Take a character and a font and see if they can be managed by this manager.
 void reset()
          Rest the internal state to the initial state.
 void setBackendFontFactory(BackendFontFactory factory)
          Setter for the back-end font factory.
 

Method Detail

getRecognizedCharId

BackendCharacter getRecognizedCharId()
Get the char info for the most recently recognized pair of font and character. If invoked before any character has been recognized successfully then null is returned.

Returns:
the char info for the most recently recognized font/character pair

getRecognizedFont

BackendFont getRecognizedFont()
Get the font info for the most recently recognized pair of font and character. If invoked before any character has been recognized successfully then null is returned.

Returns:
the font info for the most recently recognized font/character pair

isNewRecongnizedFont

boolean isNewRecongnizedFont()
Get the new font indicator for the most recently recognized pair of font and character. If the font has never been recognized before then true is returned. The font compared for this test is the back-end font – not the font passed in. This means that each time getRecognizedFont() returns a new font info this method returns true.

If invoked before any character has been recognized successfully then null is returned.

Returns:
the font info for the most recently recognized font/character pair

iterate

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

Returns:
the iterator for all recognized back-end font as ManagerInfo.

recognize

boolean recognize(FontKey fontKey,
                  UnicodeChar uc)
                  throws FontException
Take a character and a font and see if they can be managed by this manager. The internal state is adjusted to report the font and the character appropriately after the invocation has returned.

Parameters:
fontKey - the font key for the character at hand
uc - the Unicode character at hand
Returns:
true iff the character is defined in the font given and a font of a requested format can be delivered.
Throws:
FontException - if a font error occurred.

reset

void reset()
Rest the internal state to the initial state. Afterwards the instance does not know anything about recognized fonts and can be used like a newly created instance.


setBackendFontFactory

void setBackendFontFactory(BackendFontFactory factory)
Setter for the back-end font factory.

Parameters:
factory - the back-end font factory to set