Unified Typesetting API M1-20040817

de.inghuimische.uta.typeset
Interface Typesetter

All Superinterfaces:
QManageable
All Known Implementing Classes:
AbstractTypesetter

public interface Typesetter
extends QManageable

A typesetter takes care of all aspects of typesetting text. This includes

Typesetters of different quality will mostly only implement a subset of the features mentioned above. Different scripts need different features. Therefore it can happen that a typesetter fulfills highest-quality requirements for one particular script, while it doesn't even fit the simplest for another. A typesetter is designed so that additional Scripts can be plugged in. These scripts directly extend functionality of the typesetter.

Note: Not all mentioned features are currently fully supported by UTA. Text has to be NFKC normalized, see typeset(UtaAttributedString).

Author:
Christian Ziesemer

Method Summary
 Script addScript(Script aScript)
          Adds support for a new script.
 FeatureList getFeatures()
          Returns a list of features the typesetter supports.
 JustificationAlgorithm getJustificationAlgorithm()
          Returns the justification algorithm used.
 LinebreakAlgorithm getLinebreakAlgorithm()
          The linebreak algorithm used.
 Script getScript(Locale aLocale)
          Returns the script for the given locale or null if no script is registered for the locale.
 List getScripts()
          Returns a list of all registered scripts.
 EmbeddingLevel typeset(UtaAttributedString text)
          Typesets a piece of text.
 

Method Detail

getLinebreakAlgorithm

public LinebreakAlgorithm getLinebreakAlgorithm()
The linebreak algorithm used.

Returns:
The linebreaker used to split paragraphs up into several lines.

getJustificationAlgorithm

public JustificationAlgorithm getJustificationAlgorithm()
Returns the justification algorithm used. Justification is performed after linebreaking.

Returns:
The justification algorithm used.

typeset

public EmbeddingLevel typeset(UtaAttributedString text)
Typesets a piece of text. The text has to be normalized after Unicode NFKC. This is compatibility decomposition, followed by canonical composition. Therefore compatibility ligatures like U+FB03 (ffi-Ligature) are not preserved, so that simple script implementations do not have to care about all possible substitutions.

Hints which substring should be substituted by a ligature may be embedded in the attributes. Complex script implementations may consult a dictionary when a ligature has to be formed in a word an when not.

Extensive analysis needs to be done with the complete text. Therefore there is no character-by-character based typeset method in this interface.

The method returns the embedding level with the lowest order produced during typesetting. It contains all sub-levels, glyphs and other boxes generated during typesetting.

Parameters:
text - The text to typeset.
Returns:
The embedding level with the lowest order produced during typesetting.

addScript

public Script addScript(Script aScript)
Adds support for a new script. A script provides all features needed to typeset one script.

Parameters:
aScript - The script to add.
Returns:
The script previously registered for the locale, or null if there was no such script before.

getFeatures

public FeatureList getFeatures()
Returns a list of features the typesetter supports.

Specified by:
getFeatures in interface QManageable
Returns:
A list of features the typesetter supports.

getScript

public Script getScript(Locale aLocale)
Returns the script for the given locale or null if no script is registered for the locale.

Parameters:
aLocale - The locale a script is searched for.
Returns:
The script for the given locale or null if no script is registered for the locale.

getScripts

public List getScripts()
Returns a list of all registered scripts.

Returns:
A list of all registered scripts.

Unified Typesetting API M1-20040817


An inghuimische.de project.
Copyright (C) 2004 Christian Ziesemer; See the Mozilla Public License for more details.