|
Unified Typesetting API M1-20040817 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.inghuimische.uta.typeset.AbstractTypesetter
Abstract typesetter to ease implementation of typesetters. It implements
the algorithm as described in my thesis (see
typeset(UtaCharacterIterator)
).
This class provides a feature list which should be used by subclasses.
This Typesetter is meant for single pass typesetting, so the scripts have to hyphenate in the first pass (if this is desired).
Field Summary | |
protected Stack |
embeddingLevels
|
protected FeatureList |
features
Holds the features supported by this typesetter. |
protected EmbeddingLevel |
previousEmbeddingLevel
|
protected Script |
previousScript
|
Constructor Summary | |
AbstractTypesetter()
|
Method Summary | |
protected EmbeddingLevel |
fixItemPositions(EmbeddingLevel level,
List breakpoints)
Fixes the position of the items. |
protected void |
fixItemPositions(Iterator breakItems)
Takes a list of prebreak-items and iterates over all items generated during typesetting. |
EmbeddingLevel |
getActiveEmbeddingLevel()
|
protected abstract int |
getEmbeddingLevelOrder(int charIndex,
Glyph glyph)
Retrieves the order of the embedding level of the given glyph. |
FeatureList |
getFeatures()
Returns a list of features the typesetter supports. |
abstract GlyphFactory |
getGlyphFactory()
Returns the factory to use for resolving glyphs. |
protected abstract Iterator |
getItemIterator()
Returns an iterator for iteration over all items. |
abstract boolean |
getJustifyText()
Tells whether to justify text or not. |
EmbeddingLevel |
getRootLevel()
|
protected abstract Script |
getScript(int aChar,
Glyph aGlyph)
This method is responsible for finding the right script for a given Glyph . |
protected EmbeddingLevel |
typeset(UtaCharacterIterator it)
Typesets a sequence of glyphs. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.inghuimische.uta.typeset.Typesetter |
addScript, getJustificationAlgorithm, getLinebreakAlgorithm, getScript, getScripts, typeset |
Field Detail |
protected FeatureList features
protected Script previousScript
protected EmbeddingLevel previousEmbeddingLevel
protected Stack embeddingLevels
Constructor Detail |
public AbstractTypesetter()
Method Detail |
protected EmbeddingLevel typeset(UtaCharacterIterator it)
Following steps must be performed for every character:
The method locates the proper script by
calling getScript(int, Glyph)
. If the script changes between two
scripts the Script.relax()
method of the previous script
is called as well as the Script.wakeup(Script, EmbeddingLevel)
method of the current script. After this Script.typeset(int, Glyph)
is called.
it
- The iterator containing the characters to typeset.protected EmbeddingLevel fixItemPositions(EmbeddingLevel level, List breakpoints)
level
- The level which item positions should be fixed.breakpoints
- The resolved breakpoints.protected void fixItemPositions(Iterator breakItems)
breakItems
- The iterator contains the various prebreak-items.protected abstract Iterator getItemIterator()
public abstract GlyphFactory getGlyphFactory()
protected abstract int getEmbeddingLevelOrder(int charIndex, Glyph glyph)
charIndex
- The index of the char from the unmodified input
of typeset(UtaCharacterIterator)
.glyph
- The glyph representing the index.
protected abstract Script getScript(int aChar, Glyph aGlyph)
Glyph
. This is a
quite central aspect of the whole typeset process cause it
decides by which script the glyph is to be typeset.
While simple implementations may always return the same script, complex should take a look into the glyph if there is already a matching attribute. Otherwise some processing is required.
public abstract boolean getJustifyText()
true
if the text should be justified,
false
otherwise.public FeatureList getFeatures()
Typesetter
getFeatures
in interface Typesetter
public EmbeddingLevel getActiveEmbeddingLevel()
public EmbeddingLevel getRootLevel()
|
Unified Typesetting API M1-20040817 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
![]() An inghuimische.de project. | Copyright (C) 2004 Christian Ziesemer; See the Mozilla Public License for more details. |