Package com.teamten.typeset.element
Class Kern
java.lang.Object
com.teamten.typeset.element.Element
com.teamten.typeset.element.DiscardableElement
com.teamten.typeset.element.Kern
- All Implemented Interfaces:
Dimensions
Represents a kerning adjustment.
-
Field Summary
Fields inherited from class com.teamten.typeset.element.Element
DRAW_DEBUG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongThe amount to adjust.longgetDepth()Return the depth (below the baseline) of the element.longReturn the height (above the baseline) of the element.longgetWidth()Return the width of the element.booleanWhether this kern is intended to be horizontal (between letters) or vertical (between lines).longlayOutHorizontally(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) Add the element to the contents as part of a horizontal sequence.longlayOutVertically(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) Add the element to the contents as part of a vertical sequence.voidprintln(PrintStream stream, String indent) Pretty prints the element to the PrintWriter with the given indent.Return a text version of the element, ideally containing only the text of the element and its children.Methods inherited from class com.teamten.typeset.element.Element
getVerticalSize, println, shouldSkipElementAtStart, toTextString, visit
-
Constructor Details
-
Kern
public Kern(long amount, boolean isHorizontal)
-
-
Method Details
-
getAmount
public long getAmount()The amount to adjust. This is normally negative. -
isHorizontal
public boolean isHorizontal()Whether this kern is intended to be horizontal (between letters) or vertical (between lines). It's normally horizontal. -
getWidth
public long getWidth()Description copied from class:ElementReturn the width of the element.- Specified by:
getWidthin interfaceDimensions- Specified by:
getWidthin classElement
-
getHeight
public long getHeight()Description copied from class:ElementReturn the height (above the baseline) of the element.- Specified by:
getHeightin interfaceDimensions- Specified by:
getHeightin classElement
-
getDepth
public long getDepth()Description copied from class:ElementReturn the depth (below the baseline) of the element.- Specified by:
getDepthin interfaceDimensions- Specified by:
getDepthin classElement
-
layOutHorizontally
public long layOutHorizontally(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) throws IOException Description copied from class:ElementAdd the element to the contents as part of a horizontal sequence.- Specified by:
layOutHorizontallyin classElement- Parameters:
x- the left-most point of the element.y- the baseline of the element.contents- the stream to add the element to.- Returns:
- how much to move right afterward.
- Throws:
IOException
-
layOutVertically
public long layOutVertically(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) throws IOException Description copied from class:ElementAdd the element to the contents as part of a vertical sequence.- Specified by:
layOutVerticallyin classElement- Parameters:
x- the left-most point of the element.y- the upper-left point of the element.contents- the stream to add the element to.- Returns:
- how much to move down afterward.
- Throws:
IOException
-
println
Description copied from class:ElementPretty prints the element to the PrintWriter with the given indent. The method must print its own newline. -
toTextString
Description copied from class:ElementReturn a text version of the element, ideally containing only the text of the element and its children.- Overrides:
toTextStringin classElement
-