Unified Typesetting API M1-20040817

de.inghuimische.uta.typeset
Interface Justifiable


public interface Justifiable

A justifiable is some kind of box/item with changeable width. In latin scripts this is in most cases shrink/stretchable whitespace. A script generates justifiables where it is appropriate. They are used to justify a line. After linebreaking the widths of all encountered justifiables must be adjusted if justification is required.

A justifiable may either stretch or shrink infinitely variable or have a set of fixed possible widths. This may be the case if a script requires alternative fixed-width glyphs. Adjusting the width may also involve a change of the glyph shape.

Note that this allows fine-tuning of justification and such things like inter letter spacing.

The concept of a justifiable is very similar to the glue in TeX.

Author:
Christian Ziesemer

Method Summary
 double[] getPossibleWidths()
          This method provides valid values for the call to setWidth(double)or null if any value between getShrinkability()and getStrechability()is valid.
 double getShrinkability()
          Returns the shrinkability of this justifiable.
 double getStrechability()
          Returns the stretchability of this justifiable.
 int getValidPositions()
          Returns the positions where the Justifiable should be used for justification.
 void setValidPositions(int validPositions)
          The position argument tells when the justifiable should be used for justification.
 void setWidth(double newWidth)
          Sets the width of the justifiable.
 

Method Detail

setWidth

public void setWidth(double newWidth)
Sets the width of the justifiable. Some algorithm has calculated the new width in consideration of the linebreaking results.

Parameters:
newWidth - The new width of the justifiable.
See Also:
getPossibleWidths()

getPossibleWidths

public double[] getPossibleWidths()
This method provides valid values for the call to setWidth(double)or null if any value between getShrinkability()and getStrechability()is valid.

Returns:
An array of double values containing possible width this justifiable can have or null if it is infinitely variable.

getShrinkability

public double getShrinkability()
Returns the shrinkability of this justifiable.

Returns:
The shrinkability of this justifiable.

getStrechability

public double getStrechability()
Returns the stretchability of this justifiable.

Returns:
The stretchability of this justifiable.

setValidPositions

public void setValidPositions(int validPositions)
The position argument tells when the justifiable should be used for justification. Valid position arguments is any combination of Item.POSTBREAK, Item.PREBREAK, Item.STANDALONE and Item.SURROUNDED. The most common value will be SOUROUNDED. If a justifiable is valid for any position say STANDALONE | SOURROUNDED | PREBREAK | POSTBREAK.

Parameters:
validPositions - The positions where the justifiable is valid, telling when it should be used for justification

getValidPositions

public int getValidPositions()
Returns the positions where the Justifiable should be used for justification.

Returns:
The positions where the Justifiable should be used for justification.

Unified Typesetting API M1-20040817


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