|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.typesetter.tex.paragraph.TeXParagraphBuilder
public class TeXParagraphBuilder
This class implements the paragraph breaking algorithm as used in
813. Breaking paragraphs into lines.
We come now to what is probably the most interesting algorithm of
The method used here is based on an approach devised by Michael F. Plass and the author in 1977, subsequently generalized and improved by the same two people in 1980. A detailed discussion appears in SOFTWARE—Practice & Experience 11 (1981), 1119–1184, where it is shown that the line-breaking problem can be regarded as a special case of the problem of computing the shortest path in an acyclic network. The cited paper includes numerous examples and describes the history of line breaking as it has been practiced by printers through the ages. The present implementation adds two new ideas to the algorithm of 1980: memory space requirements are considerably reduced by using smaller records for inactive nodes than for active ones, and arithmetic overflow is avoided by using "delta distances" instead of keeping track of the total distance from the beginning of the paragraph to the current point.
| Constructor Summary | |
|---|---|
TeXParagraphBuilder()
Creates a new object. |
|
| Method Summary | |
|---|---|
NodeList |
build(HorizontalListNode nodes)
Break a horizontal list into lines. |
void |
enableLogging(java.util.logging.Logger theLogger)
Setter for the logger. |
void |
setNodefactory(NodeFactory factory)
Setter for the node factory. |
void |
setOptions(TypesetterOptions options)
Setter for options. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TeXParagraphBuilder()
| Method Detail |
|---|
public NodeList build(HorizontalListNode nodes)
throws TypesetterException
build in interface ParagraphBuildernodes - the horizontal node list containing all nodes for the
paragraph
VerticalListNode containing the hboxes of the lines
TypesetterException - in case of an errorParagraphBuilder.build(
org.extex.typesetter.type.node.HorizontalListNode)public void setNodefactory(NodeFactory factory)
setNodefactory in interface ParagraphBuilderfactory - the node factoryParagraphBuilder.setNodefactory(
org.extex.typesetter.type.node.factory.NodeFactory)public void setOptions(TypesetterOptions options)
setOptions in interface ParagraphBuilderoptions - the options to set.ParagraphBuilder.setOptions(
org.extex.typesetter.TypesetterOptions)public void enableLogging(java.util.logging.Logger theLogger)
enableLogging in interface LogEnabledtheLogger - the logger to useLogEnabled.enableLogging(
java.util.logging.Logger)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||