Class FlowExtGlyphLayout
java.lang.Object
org.apache.batik.bridge.GlyphLayout
org.apache.batik.extension.svg.FlowExtGlyphLayout
- All Implemented Interfaces:
TextSpanLayout
A GlyphLayout class for SVG 1.2 flowing text.
- Version:
- $Id$
-
Field Summary
Fields inherited from class 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_ANGLEFields inherited from interface TextSpanLayout
DECORATION_ALL, DECORATION_OVERLINE, DECORATION_STRIKETHROUGH, DECORATION_UNDERLINE -
Constructor Summary
ConstructorsConstructorDescriptionFlowExtGlyphLayout(AttributedCharacterIterator aci, int[] charMap, Point2D offset, FontRenderContext frc) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidlayoutChunk(GVTGlyphVector gv, Point2D origin, int justification, List lineInfos) static voidtextWrapTextChunk(AttributedCharacterIterator[] acis, List chunkLayouts, List flowRects) This will wrap the text associated withaciandlayouts.static voidupdateVerticalAlignOffset(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 GlyphLayout
addPtsToPath, adjustTextSpacing, applyStretchTransform, doExplicitGlyphLayout, doPathLayout, doSpacing, draw, epsEQ, getAciIndex, 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
-
Constructor Details
-
FlowExtGlyphLayout
public FlowExtGlyphLayout(AttributedCharacterIterator aci, int[] charMap, Point2D offset, FontRenderContext frc)
-
-
Method Details
-
textWrapTextChunk
public static void textWrapTextChunk(AttributedCharacterIterator[] acis, List chunkLayouts, List flowRects) This will wrap the text associated withaciandlayouts.- 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(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 allLineInfoobjects 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.Floatobject that is storing the alignment offset.region- theRegionInfoobject that we are rendering into.maxDescent- the very lowest point this line reaches.
-
layoutChunk
public static void layoutChunk(GVTGlyphVector gv, Point2D origin, int justification, List lineInfos)
-