Class PSTextPainter
java.lang.Object
org.apache.batik.bridge.BasicTextPainter
org.apache.batik.bridge.StrokingTextPainter
org.apache.fop.svg.NativeTextPainter
org.apache.fop.render.ps.PSTextPainter
- All Implemented Interfaces:
org.apache.batik.bridge.TextPainter
- Direct Known Subclasses:
PSBatikFlowTextElementBridge.PSFlowExtTextPainter, PSSVGFlowRootElementBridge.PSFlowTextPainter
Renders the attributed character iterator of a
TextNode.
This class draws the text directly using PostScript text operators so
the text is not drawn using shapes which makes the PS files larger.
The text runs are split into smaller text runs that can be bundles in single calls of the xshow, yshow or xyshow operators. For outline text, the charpath operator is used.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate classNested classes/interfaces inherited from class org.apache.batik.bridge.StrokingTextPainter
org.apache.batik.bridge.StrokingTextPainter.TextChunk, org.apache.batik.bridge.StrokingTextPainter.TextRunNested classes/interfaces inherited from class org.apache.batik.bridge.BasicTextPainter
org.apache.batik.bridge.BasicTextPainter.BasicMark -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate FontResourceCacheprivate org.apache.xmlgraphics.ps.PSGeneratorprivate static final AffineTransformprivate org.apache.xmlgraphics.java2d.ps.PSGraphics2Dprivate PSTextPainter.PSTextRunprivate Point2D.Doubleprivate PSTextPainter.TextUtilFields inherited from class NativeTextPainter
font, fontFamilyResolver, fontInfo, log, tpiFields inherited from class org.apache.batik.bridge.StrokingTextPainter
ADJUST_ALL, ADJUST_SPACING, ALT_GLYPH_HANDLER, ANCHOR_TYPE, BIDI_LEVEL, FLOW_PARAGRAPH, FLOW_REGIONS, GVT_FONT, GVT_FONTS, PAINT_INFO, singleton, TEXT_COMPOUND_ID, TEXTPATH, WRITING_MODE, WRITING_MODE_RTL, WRITING_MODE_TTB, XPOS, YPOSFields inherited from class org.apache.batik.bridge.BasicTextPainter
aaOffFontRenderContext, fontRenderContext -
Constructor Summary
ConstructorsConstructorDescriptionPSTextPainter(FontInfo fontInfo) Create a new PS text painter with the given font information. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidprivate PSFontResourcegetResourceForFont(Font f, String postfix) protected booleanisSupported(Graphics2D g2d) Indicates whether the givenGraphics2Dinstance if compatible with this text painter implementation.protected voidpositionGlyph(Point2D prevPos, Point2D glyphPos, boolean reposition) protected voidprotected voidprotected voidprotected voidsetInitialTransform(AffineTransform transform) protected voidwriteGlyph(char glyph, AffineTransform localTransform) Methods inherited from class NativeTextPainter
collectCharacters, computeTextRuns, getFontFamilyResolver, getLocalTransform, getTextLayoutFactory, getTextRunBoundaryAttributes, logCharacter, logTextRun, paintTextRun, paintTextRuns, reorderTextRuns, writeGlyphsMethods inherited from class org.apache.batik.bridge.StrokingTextPainter
adjustChunkOffsets, computeTextRuns, createModifiedACIForFontMatching, getBounds2D, getDecorationOutline, getDecorationStrokeOutline, getHighlightShape, getInstance, getMark, getOutline, getSelected, getTextChunk, getTextChunkACIs, getTextRuns, hitTest, paint, paintDecorations, printAttrs, selectFirst, selectLastMethods inherited from class org.apache.batik.bridge.BasicTextPainter
getGeometryBounds, selectAt, selectTo
-
Field Details
-
fontResources
-
ps
private org.apache.xmlgraphics.java2d.ps.PSGraphics2D ps -
gen
private org.apache.xmlgraphics.ps.PSGenerator gen -
textUtil
-
flushCurrentRun
private boolean flushCurrentRun -
psRun
-
relPos
-
IDENTITY_TRANSFORM
-
-
Constructor Details
-
PSTextPainter
Create a new PS text painter with the given font information.- Parameters:
fontInfo- the font collection
-
-
Method Details
-
isSupported
Indicates whether the givenGraphics2Dinstance if compatible with this text painter implementation.- Specified by:
isSupportedin classNativeTextPainter- Parameters:
g2d- the instance to check- Returns:
- true if the instance is compatible.
-
preparePainting
- Specified by:
preparePaintingin classNativeTextPainter
-
saveGraphicsState
- Specified by:
saveGraphicsStatein classNativeTextPainter- Throws:
IOException
-
restoreGraphicsState
- Specified by:
restoreGraphicsStatein classNativeTextPainter- Throws:
IOException
-
setInitialTransform
- Specified by:
setInitialTransformin classNativeTextPainter- Throws:
IOException
-
getResourceForFont
-
clip
- Specified by:
clipin classNativeTextPainter- Throws:
IOException
-
beginTextObject
- Specified by:
beginTextObjectin classNativeTextPainter- Throws:
IOException
-
endTextObject
- Specified by:
endTextObjectin classNativeTextPainter- Throws:
IOException
-
positionGlyph
- Specified by:
positionGlyphin classNativeTextPainter
-
writeGlyph
- Specified by:
writeGlyphin classNativeTextPainter- Throws:
IOException
-