public class PSTextPainter extends NativeTextPainter
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.
font, fontFamilyResolver, fontInfo, log, tpi
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, YPOS
Constructor and Description |
---|
PSTextPainter(FontInfo fontInfo)
Create a new PS text painter with the given font information.
|
Modifier and Type | Method and Description |
---|---|
protected void |
beginTextObject() |
protected void |
clip(java.awt.Shape shape) |
protected void |
endTextObject() |
protected boolean |
isSupported(java.awt.Graphics2D g2d)
Indicates whether the given
Graphics2D instance if compatible with this text painter
implementation. |
protected void |
positionGlyph(java.awt.geom.Point2D prevPos,
java.awt.geom.Point2D glyphPos,
boolean reposition) |
protected void |
preparePainting(java.awt.Graphics2D g2d) |
protected void |
restoreGraphicsState() |
protected void |
saveGraphicsState() |
protected void |
setInitialTransform(java.awt.geom.AffineTransform transform) |
protected void |
writeGlyph(char glyph,
java.awt.geom.AffineTransform localTransform) |
collectCharacters, computeTextRuns, getFontFamilyResolver, getTextLayoutFactory, getTextRunBoundaryAttributes, logCharacter, logTextRun, paintTextRun, paintTextRuns, reorderTextRuns, writeGlyphs
adjustChunkOffsets, computeTextRuns, createModifiedACIForFontMatching, getBounds2D, getDecorationOutline, getDecorationStrokeOutline, getHighlightShape, getInstance, getMark, getOutline, getSelected, getTextChunk, getTextChunkACIs, getTextRuns, hitTest, paint, paintDecorations, printAttrs, selectFirst, selectLast
public PSTextPainter(FontInfo fontInfo)
fontInfo
- the font collectionprotected boolean isSupported(java.awt.Graphics2D g2d)
Graphics2D
instance if compatible with this text painter
implementation.isSupported
in class NativeTextPainter
g2d
- the instance to checkprotected void preparePainting(java.awt.Graphics2D g2d)
preparePainting
in class NativeTextPainter
protected void saveGraphicsState() throws java.io.IOException
saveGraphicsState
in class NativeTextPainter
java.io.IOException
protected void restoreGraphicsState() throws java.io.IOException
restoreGraphicsState
in class NativeTextPainter
java.io.IOException
protected void setInitialTransform(java.awt.geom.AffineTransform transform) throws java.io.IOException
setInitialTransform
in class NativeTextPainter
java.io.IOException
protected void clip(java.awt.Shape shape) throws java.io.IOException
clip
in class NativeTextPainter
java.io.IOException
protected void beginTextObject() throws java.io.IOException
beginTextObject
in class NativeTextPainter
java.io.IOException
protected void endTextObject() throws java.io.IOException
endTextObject
in class NativeTextPainter
java.io.IOException
protected void positionGlyph(java.awt.geom.Point2D prevPos, java.awt.geom.Point2D glyphPos, boolean reposition)
positionGlyph
in class NativeTextPainter
protected void writeGlyph(char glyph, java.awt.geom.AffineTransform localTransform) throws java.io.IOException
writeGlyph
in class NativeTextPainter
java.io.IOException
Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.