Package org.apache.batik.extension.svg
Class FlowExtGlyphLayout
- java.lang.Object
-
- org.apache.batik.bridge.GlyphLayout
-
- org.apache.batik.extension.svg.FlowExtGlyphLayout
-
- All Implemented Interfaces:
TextSpanLayout
public class FlowExtGlyphLayout extends GlyphLayout
A GlyphLayout class for SVG 1.2 flowing text.
-
-
Field Summary
-
Fields inherited from class org.apache.batik.bridge.GlyphLayout
advance, eps, FLOW_EMPTY_PARAGRAPH, FLOW_LINE_BREAK, FLOW_PARAGRAPH, gv, GVT_FONT, HORIZONTAL_ORIENTATION_ANGLE, layoutApplied, LINE_HEIGHT, runAtts, szAtts, VERTICAL_ORIENTATION, VERTICAL_ORIENTATION_ANGLE
-
Fields inherited from interface org.apache.batik.bridge.TextSpanLayout
DECORATION_ALL, DECORATION_OVERLINE, DECORATION_STRIKETHROUGH, DECORATION_UNDERLINE
-
-
Constructor Summary
Constructors Constructor Description FlowExtGlyphLayout(java.text.AttributedCharacterIterator aci, int[] charMap, java.awt.geom.Point2D offset, java.awt.font.FontRenderContext frc)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
layoutChunk(GVTGlyphVector gv, java.awt.geom.Point2D origin, int justification, java.util.List lineInfos)
static void
textWrapTextChunk(java.text.AttributedCharacterIterator[] acis, java.util.List chunkLayouts, java.util.List flowRects)
This will wrap the text associated withaci
andlayouts
.static void
updateVerticalAlignOffset(java.awt.geom.Point2D.Float verticalAlignOffset, RegionInfo region, float maxDescent)
Updates the specified verticalAlignmentOffset using the current alignment rule and the heights of the flow rect and the maximum descent of the text.-
Methods inherited from class org.apache.batik.bridge.GlyphLayout
addPtsToPath, adjustTextSpacing, applyStretchTransform, doExplicitGlyphLayout, doPathLayout, doSpacing, draw, epsEQ, getAdvance2D, getBounds2D, getCharacterCount, getComputedOrientationAngle, getDecorationOutline, getFont, getGeometricBounds, getGlyphAdvances, getGlyphCount, getGlyphIndex, getGlyphMetrics, getGlyphOrientationAngle, getGlyphVector, getHighlightShape, getLastGlyphIndex, getLineMetrics, getOffset, getOutline, getOverlineShape, getStrikethroughShape, getTextPathAdvance, getUnderlineShape, hasCharacterIndex, hitTestChar, isAltGlyph, isGlyphOrientationAuto, isLatinChar, isLeftToRight, isOnATextPath, isReversed, isVertical, makeConvexHull, maybeReverse, mergeAreas, setOffset, setScale
-
-
-
-
Method Detail
-
textWrapTextChunk
public static void textWrapTextChunk(java.text.AttributedCharacterIterator[] acis, java.util.List chunkLayouts, java.util.List flowRects)
This will wrap the text associated withaci
andlayouts
.- Parameters:
acis
- An array of Attributed Charater Iterators containing the text to wrap. There is one aci per text chunk (which maps to flowPara elements. Used to access font, paragraph, and line break info.chunkLayouts
- A List of List of GlyphLayout objects. There is a List of GlyphLayout objects for each flowPara element. There is a GlyphLayout for approximately each sub element in the flowPara element.flowRects
- A List of Rectangle2D representing the regions to flow text into.
-
updateVerticalAlignOffset
public static void updateVerticalAlignOffset(java.awt.geom.Point2D.Float verticalAlignOffset, RegionInfo region, float maxDescent)
Updates the specified verticalAlignmentOffset using the current alignment rule and the heights of the flow rect and the maximum descent of the text. This method gets for called every line, but only the value that is calculated for the last line of the flow rect is used by the glyph rendering. This is achieved by creating a new verticalAlignOffset object everytime a new flow rect is encountered, thus a single verticalAlignmentOffset is shared for allLineInfo
objects created for a given flow rect. The value is calculated by determining the left over space in the flow rect and scaling that value by 1.0 to align to the bottom, 0.5 for middle and 0.0 for top.- Parameters:
verticalAlignOffset
- thePoint2D.Float
object that is storing the alignment offset.region
- theRegionInfo
object that we are rendering into.maxDescent
- the very lowest point this line reaches.
-
layoutChunk
public static void layoutChunk(GVTGlyphVector gv, java.awt.geom.Point2D origin, int justification, java.util.List lineInfos)
-
-